Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tough-planes-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-regexp": patch
---

fix(regexp/no-useless-dollar-replacements): Correct capturing group not found grammar
4 changes: 2 additions & 2 deletions lib/rules/no-useless-dollar-replacements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export default createRule("no-useless-dollar-replacements", {
numberRef:
"'${{ refText }}' replacement will insert '${{ refText }}' because there are less than {{ num }} capturing groups. Use '$$' if you want to escape '$'.",
numberRefCapturingNotFound:
"'${{ refText }}' replacement will insert '${{ refText }}' because capturing group does not found. Use '$$' if you want to escape '$'.",
"'${{ refText }}' replacement will insert '${{ refText }}' because capturing group is not found. Use '$$' if you want to escape '$'.",
namedRef:
"'$<{{ refText }}>' replacement will be ignored because the named capturing group is not found. Use '$$' if you want to escape '$'.",
namedRefNamedCapturingNotFound:
"'$<{{ refText }}>' replacement will insert '$<{{ refText }}>' because named capturing group does not found. Use '$$' if you want to escape '$'.",
"'$<{{ refText }}>' replacement will insert '$<{{ refText }}>' because named capturing group is not found. Use '$$' if you want to escape '$'.",
},
type: "suggestion", // "problem",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Code:
| ^~ [1]
4 |

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


Expand All @@ -73,7 +73,7 @@ Code:
| ^~~~ [1]
3 |

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


Expand Down