-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linter/no-control-regex): allow capture group references
- Loading branch information
Showing
2 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/oxc_linter/src/snapshots/no_control_regex@capture-group-indexing.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: crates/oxc_linter/src/tester.rs | ||
--- | ||
⚠ eslint(no-control-regex): Unexpected control character(s) | ||
╭─[no_control_regex.tsx:1:11] | ||
1 │ const r = /\0/; | ||
· ──── | ||
╰──── | ||
help: Unexpected control character(s) in regular expression: "\0" | ||
|
||
⚠ eslint(no-control-regex): Unexpected control character(s) | ||
╭─[no_control_regex.tsx:1:11] | ||
1 │ const r = /[a-z]\1/; | ||
· ───────── | ||
╰──── | ||
help: Unexpected control character(s) in regular expression: "\1" | ||
|
||
⚠ eslint(no-control-regex): Unexpected control character(s) | ||
╭─[no_control_regex.tsx:1:11] | ||
1 │ const r = /([a-z])\2/; | ||
· ─────────── | ||
╰──── | ||
help: Unexpected control character(s) in regular expression: "\2" | ||
|
||
⚠ eslint(no-control-regex): Unexpected control character(s) | ||
╭─[no_control_regex.tsx:1:11] | ||
1 │ const r = /([a-z])\0/; | ||
· ─────────── | ||
╰──── | ||
help: Unexpected control character(s) in regular expression: "\0" |