You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/rules/no-div-regex.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ related_rules:
8
8
9
9
10
10
11
-
Require regex literals to escape division operators.
11
+
Characters `/=` at the beginning of a regular expression literal can be confused with a division assignment operator.
12
12
13
13
```js
14
14
functionbar() { return/=foo/; }
15
15
```
16
16
17
17
## Rule Details
18
18
19
-
This is used to disambiguate the division operator to not confuse users.
19
+
This rule forbids equal signs (`=`) after the slash (`/`) at the beginning of a regular expression literal, because the characters `/=` can be confused with a division assignment operator.
0 commit comments