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.

Docs: no-mixed-operators - allowSamePrecedence option docs improvement

See original GitHub issue

Tell 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
munkychopcommented, Feb 9, 2018

@platinumazure sure, I can do that. Maybe it would help clarify things for others 😃

1reaction
munkychopcommented, Feb 9, 2018

I’ve created the PR. Let me know if there’s anything more to add to that 😃

Read more comments on GitHub >

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

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