no-unused-vars bug (for plus plus)
See original GitHub issueconfig is "no-unused-vars": "warn"
warn:
var j = 0; // j is assigned a value but never used
while(typeof window === 'object'){
j++;
}
ok:
var j = 0;
while(typeof window === 'object'){
j = j + 1;
}
can you make the j++ to ok ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
'Form' is defined but never used no-unused-vars
I keep on getting the error Form' is defined but never used no-unused-vars and it says: Search for the keywords to learn more...
Read more >no-unnecessary-condition - TypeScript ESLint
This rule requires type information to run. Any expression being used as a condition must be able to evaluate as truthy or falsy...
Read more >Fix most of the remaining no-unused-vars issues for local ...
This is the next step for bug 1312407. This fixes most of the no-unused-vars for local scope in browser/. There's only a handful...
Read more >disallow the unary operators ++ and -- (no-plusplus) - ESLint
Because the unary ++ and -- operators are subject to automatic semicolon insertion, differences in whitespace can change semantics of source code. var...
Read more >User Guide | eslint-plugin-vue
Above, plus rules to considerably improve code readability and/or dev ... Other rules - because they're not covering potential bugs in the ...
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
Look, the problem is that except for the increment, no one else sees the value of
j
at all. You could removej
entirely from your code and it would have the same effects to calling code.Your code, in terms of observable side effects, is exactly the same as this code:
You need to finish writing your code (as in, write the lines where
j
is actually passed to another function or returned or used in an expression). Right now, the rule is correctly noting thatj
is not used except for self-modification.Closing because this is working as intended.