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.

allowDestructuring option for no-sparse-arrays rule

See original GitHub issue

What rule do you want to change? no-sparse-arrays

Does this change cause the rule to produce more or fewer warnings? fewer warnings

How will the change be implemented? (New option, new default behavior, etc.)? New option

Please provide some example code that this change will affect:

const [, y] = [1, 2];

What does the rule currently do for this code? error Unexpected comma in middle of array no-sparse-arrays

What will the rule do after it’s changed? it’ll allow it, with "no-sparse-array": ["error", {"allowDestructuring": true}]

Are you willing to submit a pull request to implement this change? I can try, yes

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mdjermanoviccommented, Oct 19, 2019

Hi @caub, thanks for the issue!

This would be a bug, but I can’t reproduce it: Online Demo Link

It might be good to fill the bug report issue template.

1reaction
ljharbcommented, Oct 19, 2019

This shouldn’t require an option - it’s broken, since omitting items in array destructuring is in no way “sparse arrays”. This rule simply shouldn’t consider array destructurings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue/no-sparse-arrays - eslint-plugin-vue
vue/no-sparse-arrays #. Disallow sparse arrays in <template>. This rule is the same rule as core no-sparse-arrays rule but it applies to the ...
Read more >
no-this-alias | typescript-eslint
This rule accepts an options object with the following properties: interface Options { ... allowDestructuring?: boolean;
Read more >
Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Disallow aliasing this ( no-this-alias ) - GitLab
This rule prohibits assigning variables to this . Rule Details. Rationale from TSLint: Assigning a variable to this instead of properly using ...
Read more >
I added all the recommended rules from the eslint docs to my ...
The error comes from ESLint thinking that the TypeScript rule is a missing rule. Although your package.json specifies the correct version ...
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