Skip to content

Commit

Permalink
Docs: disallow use of the comma operator using no-restricted-syntax (#…
Browse files Browse the repository at this point in the history
…9585)

* Docs: disallow use of the comma operator using no-restricted-syntax

* Update no-sequences.md

* fix typo.

* Update no-sequences.md
  • Loading branch information
aladdin-add authored and ilyavolodin committed Nov 10, 2017
1 parent d602f9e commit d4557a6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/rules/no-sequences.md
Expand Up @@ -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"]
}
}
```

0 comments on commit d4557a6

Please sign in to comment.