Skip to content

Commit

Permalink
Enable regexp/no-useless-non-capturing-group rule (prettier#13787)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored and medikoo committed Feb 5, 2024
1 parent 5882b9a commit 717db84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ module.exports = {
},
],
"regexp/no-useless-lazy": "error",
"regexp/no-useless-non-capturing-group": "error",

// eslint-plugin-unicorn
"unicorn/better-regex": "error",
Expand Down
4 changes: 2 additions & 2 deletions src/language-js/print/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,11 +777,11 @@ const containsNonJsxWhitespaceRegex = new RegExp(
const trimJsxWhitespace = (text) =>
text.replace(
new RegExp(
"(?:^" +
"^" +
matchJsxWhitespaceRegex.source +
"|" +
matchJsxWhitespaceRegex.source +
"$)"
"$"
),
""
);
Expand Down

0 comments on commit 717db84

Please sign in to comment.