Rule suggestion: Create an option for allow-short-circuit-evaluation
See original GitHub issuePlease 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:
- Created 8 years ago
- Comments:19 (14 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
👍
@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.