dustinspecker / eslint-plugin-no-use-extend-native

ESLint plugin to prevent use of extended native objects
MIT License
56 stars 4 forks source link

False positive on multiple computed property access #124

Closed futpib closed 5 years ago

futpib commented 5 years ago

Code like this is reported:

({
    foo: {
        bar: 1,
        buz: 2,
    },
}[i][j])

Quick way to reproduce:

echo '{}[i][j]' | yarn eslint --plugin no-use-extend-native --rule '{"no-use-extend-native/no-use-extend-native":"error"}' --stdin
1:3  error  Avoid using extended native objects  no-use-extend-native/no-use-extend-native

If I remove one level of property access (change to {}[i]), nothing is reported.

dustinspecker commented 5 years ago

Thank you!

Think I got a fix in place to prevent this false positive. I'll publish 0.4.1 after tests pass on CI.

dustinspecker commented 5 years ago

Published 0.4.1.