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.

no-unused-vars works incorrectly with rested arrays

See original GitHub issue

image

First item is unused, I cant’ skip it. Rule after-used should be applied here I believe

Eslint version: 4.5.0

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
ilyavolodincommented, Aug 22, 2018

You can skip it by doing:

const [, idMaps] = changeScreenLikeItemsId(screen);

This is working as intended.

1reaction
ilyavolodincommented, Aug 22, 2018

Left-hand side is not an array. It’s a spread, so no-sparse-arrays will not flag it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-unused-vars should not trigger array spread #9598 - GitHub
I'm expecting that nothing happens because when I spread an array, the order is important. ... "no-unused-vars": [2, {"ignoreRestSiblings": true}] ...
Read more >
no-unused-vars - 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 >
Remove a property using object destructuring, without eslint ...
If I do it like this, @typescript-eslint/no-unused-vars will consider it an error that a is not used. How can I change the code...
Read more >
The 3 Best ESLint No-Unused-Vars Option Settings (Make it ...
The no-unused-vars rule is one of the most important ESLint rules for ... Rest property; Allowing unused values when destructuring arrays ...
Read more >
eslint-plugin-no-unused-vars-rest - npm package - Snyk
Learn more about eslint-plugin-no-unused-vars-rest: package health score, popularity, ... pattern is considered a problem by the core rule no-unused-vars :
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