`no-unused-vars` false negative with comma operator
See original GitHub issueTell us about your environment
- ESLint Version: 7.30.0
- Node Version: v14.x
- npm Version: v6.x
- Operating System: MacOS
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
Default
Please show your full configuration:
Configuration
/*eslint no-unused-vars: "error"*/
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
/*eslint no-unused-vars: "error"*/
var z = 0;
z=z+1, z=2;
var x = 0;
x++, x = 2;
var y = 0;
y = y+1;
What did you expect to happen?
no-unused-vars
should report allx
, y
, and z
as unused variables.
What actually happened? Please copy-paste the actual, raw output from ESLint.
no-unused-vars
is reporting only x
and y
as unused variables.
Steps to reproduce this issue:
We probably missed addressing this case in https://github.com/eslint/eslint/issues/14325
Are you willing to submit a pull request to fix this bug? Yes
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
typescript-eslint/no-unused-vars false positive in type ...
I am on version 4.22.1 and am still getting the warnings. Is there any additional configurations required to disable linting on function ...
Read more >ESLint v7.27.0 released - 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 >S878 Unexpected use of comma operator - Sonar Community
Use of comma operator is tolerated : If the expression sequence is explicitly wrapped in parentheses.
Read more >eslint/CHANGELOG.md - UNPKG
421, * d4557a6 Docs: disallow use of the comma operator using ... 881, * 9f540fd2 Update: no-unused-vars false negative about destructuring (fixes #8442) ......
Read more >tslint-eslint-rules - npm
Description: Ensure that the results of typeof are compared against a ... "props": false ... Description: disallow use of the comma operator.
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
@ersachin3112 Sure, let us know if you need any help.
Since this is kind of a continuation of the previous issue, marking as accepted.