sonarjs/concise-regex
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/concise-regex": "error",
},
},
];Regular expression quantifiers and character classes should be used concisely
/a{1,}/; // Noncompliant, '{1,}' quantifier is the same as '+'
/[A-Za-z0-9_]/; // Noncompliant, '\w' is equivalent/a+/;
/\w/;Examples from the ESLint documentation.
sonarjs/concise-regex
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/concise-regex": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Comma and logical OR operators should not be used in switch cases
Objects should not be created to be dropped immediately without being used
Dynamic code execution should not use user-controlled data
Content security policy fetch directives should not be disabled