sonarjs/no-regex-spaces
eslint-plugin-sonarjs
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-regex-spaces": "error",
},
},
];Regular expressions should not contain multiple spaces
const pattern = /Hello, world!/;const pattern = /Hello, {3}world!/;Examples from the ESLint documentation.
sonarjs/no-regex-spaces
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-regex-spaces": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow multiple spaces in regular expressions
HTTP Referrer-Policy should not be set to an unsafe value
Assertions should not be given twice the same argument
Optional properties should not redundantly include 'undefined'