Unused part of sequence expression is not flagged by `no-unused-expressions`
See original GitHub issueWhat version of ESLint are you using?
Whatever version is currently in the ESLint demo.
What configuration and parser (Espree, Babel-ESLint, etc.) are you using?
The ESLint demo.
What did you do? Please include the actual source code causing the issue.
Add the example from no-sequences
docs:
var a = (3, 5);
What did you expect to happen?
To get no-unused-expressions
errors.
What actually happened? Please include the actual, raw output from ESLint.
No expected error (only get a no-unused-vars
error).
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
no-unused-expressions - ESLint - Pluggable JavaScript Linter
This rule aims to eliminate unused expressions which have no effect on the state of the program. This rule does not apply to...
Read more >no-sequences=0 vs no-unused-expressions=2 #3685 - GitHub
The message for a violation of no-unused-expressions is "expected an assignment or function call and instead saw an expression". Is this working ...
Read more >no-unused-expression - Rule
Disallows unused expression statements. Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Read more >Nice way to get rid of no-unused-expressions linter error with ...
I've made a small plugin called eslint-plugin-chai-friendly that overrides the default no-unused-expressions rule and makes it friendly towards chai.
Read more >"Fossies" - the Fresh Open Source Software Archive
... /lib/rules/no-unused-expressions.js 7 // and added support for ... 10 * @fileoverview Flag expressions in statement position that do not side effect 11 ......
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 Free
Top 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
If
no-unused-expressions
would flag left operand of,
, we’d need an exception for the indirect eval pattern(0, eval)("...")
.This is not a bug, it is working as designed. I don’t think we should do anything here.