From d4557a6233d500bc309b08d7b6571a620ce30080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=9A=E8=B0=94=E7=9A=84=E7=8C=AB?= Date: Sat, 11 Nov 2017 04:55:25 +0800 Subject: [PATCH] Docs: disallow use of the comma operator using no-restricted-syntax (#9585) * Docs: disallow use of the comma operator using no-restricted-syntax * Update no-sequences.md * fix typo. * Update no-sequences.md --- docs/rules/no-sequences.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/rules/no-sequences.md b/docs/rules/no-sequences.md index 1d05e82554d..f1f4afea0ac 100644 --- a/docs/rules/no-sequences.md +++ b/docs/rules/no-sequences.md @@ -66,3 +66,12 @@ while ((val = foo(), val < 42)); ## When Not To Use It Disable this rule if sequence expressions with the comma operator are acceptable. +Another case is where you might want to report all usages of the comma operator, even if they are wrapped in parentheses or in a for loop. You can achieve this using rule `no-restricted-syntax`: + +```js +{ + "rules": { + "no-restricted-syntax": ["error", "SequenceExpression"] + } +} +```