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.

Edge case with `no-unused-expressions` rule

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
btmillscommented, Jul 9, 2016

As long as there are no compatibility issues with changing a message in a minor release, 👍 from me.

1reaction
btmillscommented, Jul 9, 2016

Something like “A sequence expression is unnecessary when its return value is unused”?

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

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