sonarjs/single-char-in-character-classes
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/single-char-in-character-classes": "error",
},
},
];Character classes in regular expressions should not contain only one character
/a[b]c/
/[\^]//abc/
/\^/
/a[*]c/ // Compliant, see ExceptionsExamples from the ESLint documentation.
sonarjs/single-char-in-character-classes
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/single-char-in-character-classes": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
A new session should be created during user authentication
Single-character alternations in regular expressions should be replaced with character classes
Wallet phrases should not be hard-coded
Regular expressions should not cause catastrophic backtracking
Regular expressions should not be too complicated