Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: Mention character classes in no-useless-escape (#15421)
* docs: Mention character classes in no-useless-escape

* Make it clear which of the brackets needs escaping
  • Loading branch information
SebastianSimon committed Dec 20, 2021
1 parent 9d951ac commit 775d181
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/rules/no-useless-escape.md
Expand Up @@ -26,7 +26,8 @@ Examples of **incorrect** code for this rule:
`\#{foo}`;
/\!/;
/\@/;

/[\[]/;
/[a-z\-]/;
```

Examples of **correct** code for this rule:
Expand All @@ -46,7 +47,9 @@ Examples of **correct** code for this rule:
/\\/g;
/\t/g;
/\w\$\*\^\./;

/[[]/;
/[\]]/;
/[a-z-]/;
```

## When Not To Use It
Expand Down

0 comments on commit 775d181

Please sign in to comment.