Skip to content

Commit 0bc257c

Browse files
docs: Clarify no-div-regex rule docs (#17051) (#17255)
* fix: Clarify `no-div-regex` rule docs * Update opening section --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
1 parent 1b7faf0 commit 0bc257c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/rules/no-div-regex.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ related_rules:
88

99

1010

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.
1212

1313
```js
1414
function bar() { return /=foo/; }
1515
```
1616

1717
## Rule Details
1818

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.
2020

2121
Examples of **incorrect** code for this rule:
2222

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy