Skip to content

Commit 3567f9f

Browse files
adamluiota-meshi
andauthored
Correct capturing group not found grammar (#776)
* Corrected capturing group not found grammar * Create tough-planes-smell.md --------- Co-authored-by: Yosuke Ota <[email protected]>
1 parent aa8857f commit 3567f9f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/tough-planes-smell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-regexp": patch
3+
---
4+
5+
fix(regexp/no-useless-dollar-replacements): Correct capturing group not found grammar

lib/rules/no-useless-dollar-replacements.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export default createRule("no-useless-dollar-replacements", {
3232
numberRef:
3333
"'${{ refText }}' replacement will insert '${{ refText }}' because there are less than {{ num }} capturing groups. Use '$$' if you want to escape '$'.",
3434
numberRefCapturingNotFound:
35-
"'${{ refText }}' replacement will insert '${{ refText }}' because capturing group does not found. Use '$$' if you want to escape '$'.",
35+
"'${{ refText }}' replacement will insert '${{ refText }}' because capturing group is not found. Use '$$' if you want to escape '$'.",
3636
namedRef:
3737
"'$<{{ refText }}>' replacement will be ignored because the named capturing group is not found. Use '$$' if you want to escape '$'.",
3838
namedRefNamedCapturingNotFound:
39-
"'$<{{ refText }}>' replacement will insert '$<{{ refText }}>' because named capturing group does not found. Use '$$' if you want to escape '$'.",
39+
"'$<{{ refText }}>' replacement will insert '$<{{ refText }}>' because named capturing group is not found. Use '$$' if you want to escape '$'.",
4040
},
4141
type: "suggestion", // "problem",
4242
},

tests/lib/rules/__snapshots__/no-useless-dollar-replacements.ts.eslintsnap

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Code:
6262
| ^~ [1]
6363
4 |
6464

65-
[1] '$1' replacement will insert '$1' because capturing group does not found. Use '$$' if you want to escape '$'.
65+
[1] '$1' replacement will insert '$1' because capturing group is not found. Use '$$' if you want to escape '$'.
6666
---
6767

6868

@@ -73,7 +73,7 @@ Code:
7373
| ^~~~ [1]
7474
3 |
7575

76-
[1] '$<a>' replacement will insert '$<a>' because named capturing group does not found. Use '$$' if you want to escape '$'.
76+
[1] '$<a>' replacement will insert '$<a>' because named capturing group is not found. Use '$$' if you want to escape '$'.
7777
---
7878

7979

0 commit comments

Comments
 (0)