key/property rules and ObjectPattern
See original GitHub issueTell us about your environment
- ESLint Version: 6.1.0
- Node Version: 10.16.0
- npm Version: 6.9.0
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
module.exports = {
parserOptions: {
ecmaVersion: 6,
},
};
What did you do? Please include the actual source code causing the issue.
There are 4 rules that report ObjectPattern
properties, it’s probably a bug because there are no examples in the documentation and there are no test cases.
/*eslint quote-props: "error"*/
/*eslint key-spacing: "error"*/
/*eslint no-useless-computed-key: "error"*/
/*eslint computed-property-spacing: "error"*/
({
a : foo,
["b" ]: bar
} = baz)
What did you expect to happen?
No warnings.
What actually happened? Please include the actual, raw output from ESLint.
4 warnings, one for each of the rules.
Are you willing to submit a pull request to fix this bug?
Yes, for whatever is decided.
quote-props
and key-spacing
are not working well at the moment (see PRs #12046 and #12047), I guess these fixes should be applied to skip ObjectPattern
for now. A possible enhancements could be to add options later.
no-useless-computed-key
and computed-property-spacing
might work well already. Possible actions could be:
- Fix to ignore
ObjectPattern
. - Or, consider this as a default behavior feature (it already is) - just modify the docs and add test cases.
- Maybe add options instead.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
For
computed-property-spacing
, it makes the most sense to keep the current behavior and just document it (https://github.com/eslint/eslint/pull/14004 and https://github.com/eslint/eslint/pull/15423). and add tests (https://github.com/eslint/eslint/pull/15424).@mdjermanovic what do you want to do with this issue?