Docs: no-mixed-operators - allowSamePrecedence option docs improvement
See original GitHub issueTell us about your environment N/A (macOS Sierra 10.12.6)
-
ESLint Version: v4.17.0
-
Node Version: N/A (v8.9.1)
-
npm Version: N/A (v5.5.1)
What parser (default, Babel-ESLint, etc.) are you using? N/A (default)
Please show your full configuration: N/A
What did you expect to happen?
The allowSamePrecedence
option of the no-mixed-operators
rule should correctly document “Examples of incorrect code for this rule with {"allowSamePrecedence": false}
option”.
What actually happened? Please include the actual, raw output from ESLint. The documentation is incorrect, as it is the same as “Examples of correct code for this rule with {“allowSamePrecedence”: true} option”:
/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": true}]*/
// + and - have the same precedence.
var foo = a + b - c;
/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/
// + and - have the same precedence.
var foo = a + b - c;
This should simply be changed to something like this:
/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/
// + and * have different precedence.
var foo = a + b * c;
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
no-mixed-operators - ESLint - Pluggable JavaScript Linter
This rule checks if the operators belong to the same group only. In this case, this rule checks if bitwise operators and logical...
Read more >Mixed operators in JSX - reactjs - Stack Overflow
This rule warns when different operators are used consecutively without parentheses in an expression.
Read more >Functions, operators, and conditionals | BigQuery
Operators with the same precedence are left associative. ... These functions do not allow users to specify the precision for the estimation with...
Read more >Advanced search options - Microsoft Support
Finds webpages that contain either of the terms or phrases. Notes: By default, all searches are AND searches. You must capitalize the NOT...
Read more >Optimize Options (Using the GNU Compiler Collection (GCC))
Turning on optimization flags makes the compiler attempt to improve the performance and/or code size at the expense of compilation time and possibly...
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
@platinumazure sure, I can do that. Maybe it would help clarify things for others 😃
I’ve created the PR. Let me know if there’s anything more to add to that 😃