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.

Rule suggestion: Create an option for allow-short-circuit-evaluation

See original GitHub issue

Please see the comments below by jwarkentin about creating an allow-short-circuit-evaluation option.


Please see https://github.com/eslint/eslint/issues/2684#issuecomment-110255859

We would like to differentiate no-op statements against unused statements. The no-useless-expressions rule would be a subset of the no-unused-expressions rule, and would error on things like:

a;
a + b;
"Hello World!";

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:19 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
mathieumgcommented, Jun 9, 2015

👍

0reactions
ev0rtexcommented, Aug 25, 2015

@gyandeeps, @nzakas: Let me know if anything further is needed for my PR. I tried to be pretty exhaustive on the rule tests and documentation so that it’s clear what the new options allow and disallow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Short-circuit evaluation - Wikipedia
Short -circuit evaluation, minimal evaluation, or McCarthy evaluation (after John McCarthy) is the semantics of some Boolean operators in some programming ...
Read more >
Short-Circuit Evaluation - Courses
A short-circuit evaluation of an expression is one in which the result is determined without evaluating all of the operands and/or operators.
Read more >
Short-circuit evaluation in Programming - GeeksforGeeks
Short -Circuit Evaluation: Short-circuiting is a programming concept in which the compiler skips the execution or evaluation of some ...
Read more >
JavaScript: Short Circuit Evaluation... - ServiceNow Community
To obey the special short circuit evaluation rule, that means the second and third sub-expressions will not be evaluated — and that's a...
Read more >
Short circuit evaluation, is it bad practice?
The technical term is short-circuit evaluation. This is a well-known implementation technique, and where the language standard guarantees it, relying on it is...
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