Edge case with `no-unused-expressions` rule
See original GitHub issueWhat version of ESLint are you using? 3.0.1
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
{
"rules": {
"no-unused-expressions": "error"
}
}
What did you do? Please include the actual source code causing the issue.
one = 1,
two = 2
What did you expect to happen? To not show the error
What actually happened? Please include the actual, raw output from ESLint. it shows the error for the first line
1:1 error Expected an assignment or function call and instead saw an expression no-unused-expressions
It looks like an edge case for not really good code (http://eslint.org/docs/rules/no-sequences), but seems this is still an error
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (20 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 >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 >ESLint v1.4.0 released - ESLint中文文档
ESLint v1.4.0 introduces the --fix command line argument to automatically fix some rules. In this first release, we have implemented autofixing in three...
Read more >eslint/eslint - Gitter
It seems like a potentially-confusing edge case in general for rules that use ... "no-unused-expressions": 0, "chai-friendly/no-unused-expressions": 2 } }.
Read more >eslint-plugin-svelte3 - UNPKG
52, - Fix attribute parsing edge case in `svelte3/ignore-styles` callback ... 62, - Respect `no-unused-expressions` rule again (which is now safe thanks to ......
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
As long as there are no compatibility issues with changing a message in a minor release, 👍 from me.
Something like “A sequence expression is unnecessary when its return value is unused”?