allowDestructuring option for no-sparse-arrays rule
See original GitHub issueWhat 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:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.