Skip to content

Commit

Permalink
docs: Clarify no-div-regex rule docs (#17051) (#17255)
Browse files Browse the repository at this point in the history
* fix: Clarify `no-div-regex` rule docs

* Update opening section



---------

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
fasttime and mdjermanovic committed Jun 8, 2023
1 parent 1b7faf0 commit 0bc257c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/rules/no-div-regex.md
Expand Up @@ -8,15 +8,15 @@ related_rules:



Require regex literals to escape division operators.
Characters `/=` at the beginning of a regular expression literal can be confused with a division assignment operator.

```js
function bar() { return /=foo/; }
```

## Rule Details

This is used to disambiguate the division operator to not confuse users.
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.

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

Expand Down

0 comments on commit 0bc257c

Please sign in to comment.