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.

Unused part of sequence expression is not flagged by `no-unused-expressions`

See original GitHub issue

What 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:closed
  • Created 8 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelficarracommented, Mar 13, 2016

If no-unused-expressions would flag left operand of ,, we’d need an exception for the indirect eval pattern (0, eval)("...").

0reactions
nzakascommented, Mar 14, 2016

This is not a bug, it is working as designed. I don’t think we should do anything here.

Read more comments on GitHub >

github_iconTop 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 >

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