pve-eslint/eslint/docs/rules/no-div-regex.md
Dominik Csapak eb39fafa4f first commit
includes a (minimal) working wrapper

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-06 15:06:03 +02:00

33 lines
613 B
Markdown

# Disallow Regular Expressions That Look Like Division (no-div-regex)
Require regex literals to escape division operators.
```js
function bar() { return /=foo/; }
```
## Rule Details
This is used to disambiguate the division operator to not confuse users.
Examples of **incorrect** code for this rule:
```js
/*eslint no-div-regex: "error"*/
function bar() { return /=foo/; }
```
Examples of **correct** code for this rule:
```js
/*eslint no-div-regex: "error"*/
function bar() { return /[=]foo/; }
```
## Related Rules
* [no-control-regex](no-control-regex.md)
* [no-regex-spaces](no-regex-spaces.md)