Skip to content

Commit

Permalink
Enable regexp/no-useless-non-capturing-group rule (#13787)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Nov 4, 2022
1 parent cccedf4 commit 8ae1fb6
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 @@ -770,11 +770,11 @@ const containsNonJsxWhitespaceRegex = new RegExp(
const trimJsxWhitespace = (text) =>
text.replace(
new RegExp(
"(?:^" +
"^" +
matchJsxWhitespaceRegex.source +
"|" +
matchJsxWhitespaceRegex.source +
"$)"
"$"
),
""
);
Expand Down

0 comments on commit 8ae1fb6

Please sign in to comment.