Skip to content
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

Fix: quote-props shouldn't report object pattern properties #12046

Closed
wants to merge 1 commit into from
Closed

Fix: quote-props shouldn't report object pattern properties #12046

wants to merge 1 commit into from

Conversation

mdjermanovic
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Bug fix

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.

/*eslint quote-props: ["error", "always"]*/
({'a': foo, b: bar} = baz)
/*eslint quote-props: ["error", "as-needed"]*/
({'a': foo, b: bar} = baz)
/*eslint quote-props: ["error", "consistent"]*/
({'a': foo, b: bar} = baz)
/*eslint quote-props: ["error", "consistent-as-needed"]*/
({'a': foo, b: bar} = baz)

What did you expect to happen?

No warnings. By the documentation for this rule it targets object literals, these are object patterns.
Also, there are no test cases with patterns.

What actually happened? Please include the actual, raw output from ESLint.

2 warnings, for always and as-needed.

No warnings for consistent and consistent-as-needed.

What changes did you make? (Give an overview)

Skip the check if the Property is not a property of an ObjectExpression.

Is there anything you'd like reviewers to focus on?

I guess this should be treated as a bug rather than as an undocumented behavior because it doesn't work well - some options report warnings, some not.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Aug 1, 2019
@g-plane g-plane added bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Aug 3, 2019
@mdjermanovic mdjermanovic added the do not merge This pull request should not be merged yet label Oct 1, 2019
@kaicataldo
Copy link
Member

@mdjermanovic How would you like to proceed with this? Is this a WIP?

@mdjermanovic
Copy link
Member Author

Closing this for the same reasons as #12047.

Further analysis in #12048

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jun 13, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly do not merge This pull request should not be merged yet evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants