New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-dupe-keys: false negative between a normal property and a getter. #6801
Comments
no-dupe-keys
: false positive between a normal property and a getter.
This is interesting: $ git log --oneline -n 1
5d063f2 Docs: Add plugin example to disabling with comments guide (fixes #6742)
$ rm -rf node_modules && npm install
# ...
$ echo "var obj = {a:1, get a() { return 1 }}" | bin/eslint.js --stdin --rule no-dupe-keys:2 --env es6 --no-eslintrc But if I remove $ echo "var obj = {a:1, get a() { return 1 }}" | bin/eslint.js --stdin --rule no-dupe-keys:2 --no-eslintrc
<text>
1:21 error Parsing error: Redefinition of property
✖ 1 problem (1 error, 0 warnings) |
@btmills |
Good call, @platinumazure. I get no errors: $ echo "var obj = {a:1, get a() { return 1 }}" | bin/eslint.js --stdin --rule no-dupe-keys:2 --parser-options ecmaVersion:6 --no-eslintrc
|
Yes. Duplicate properties were a kind of syntax errors until ES5. But ES6 relaxed this restriction due to computed properties. |
This commit fixes a false negative between a normal property and a getter/setter. In addition, I upgrade code by ES2015.
This commit fixes a false negative between a normal property and a getter/setter. In addition, I upgrade code by ES2015.
What version of ESLint are you using?
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered: