From a7f747fff111b3a60d56b2b1935f281bb07edad5 Mon Sep 17 00:00:00 2001 From: Ivan Hayes Date: Fri, 9 Feb 2018 16:29:27 +0000 Subject: [PATCH] Docs: Clarify no-mixed-operators options (fixes #9962) --- docs/rules/no-mixed-operators.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/rules/no-mixed-operators.md b/docs/rules/no-mixed-operators.md index 1746c5ed677..3c0bb2fab6b 100644 --- a/docs/rules/no-mixed-operators.md +++ b/docs/rules/no-mixed-operators.md @@ -138,10 +138,19 @@ Examples of **incorrect** code for this rule with `{"allowSamePrecedence": false var foo = a + b - c; ``` +Examples of **correct** code for this rule with `{"allowSamePrecedence": false}` option: + +```js +/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/ + +// + and - have the same precedence. +var foo = (a + b) - c; +``` + ## When Not To Use It If you don't want to be notified about mixed operators, then it's safe to disable this rule. ## Related Rules -* [no-extra-parens](no-extra-parens.md) \ No newline at end of file +* [no-extra-parens](no-extra-parens.md)