Skip to content

key/property rules and ObjectPattern #12048

Closed
@mdjermanovic

Description

Tell 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionbugESLint is working incorrectlyruleRelates to ESLint's core rules

Type

No type

Projects

  • Status

    Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions