question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

key/property rules and ObjectPattern

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mdjermanoviccommented, Dec 14, 2021

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

0reactions
nzakascommented, Apr 29, 2021

@mdjermanovic what do you want to do with this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Galen Specs Language Guide
key property. After that you should be ready to start using ocr spec with the following arguments: ocr text is - checks that...
Read more >
Key Property Management
Las Vegas Property Management and Real Estate Consulting company. Established in 2001 we are the local industry leader.
Read more >
ef core owned types
The terms and conditions set forth …. TractorJoe - Refundable Core Charge • A core charge is a deposit that is refunded after...
Read more >
Turn-Key Property Solutions
Find your Ideal Rental Home or Apartment in Hays, KS · Residents · Owner Investors · Contact Information · Resident Log-in · Owner...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found