Merge pull request #1691 from airbnb/update-mixed-operators-text

[guide] Improves wording of no-mixed-operators recommendation.

Fixes #1678.
This commit is contained in:
Jordan Harband
2018-01-08 14:57:11 -08:00
committed by GitHub

View File

@@ -1945,7 +1945,7 @@ Other Style Guides
```
<a name="comparison--no-mixed-operators"></a>
- [15.8](#comparison--no-mixed-operators) Enclose operators in parentheses when they are mixed in a statement. When mixing arithmetic operators, do not mix `**` and `%` with themselves or with `+`, `-`, `*`, & `/`. eslint: [`no-mixed-operators`](https://eslint.org/docs/rules/no-mixed-operators.html)
- [15.8](#comparison--no-mixed-operators) When mixing operators, enclose them in parentheses. The only exception is the standard arithmetic operators (`+`, `-`, `*`, & `/`) since their precedence is broadly understood. eslint: [`no-mixed-operators`](https://eslint.org/docs/rules/no-mixed-operators.html)
> Why? This improves readability and clarifies the developers intention.