sonarjs/duplicates-in-character-class
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/duplicates-in-character-class": "error",
},
},
];Character classes in regular expressions should not contain the same character twice
/[0-99]/ // Noncompliant, this won't actually match strings with two digits
/[0-9.-_]/ // Noncompliant, .-_ is a range that already contains 0-9 (as well as various other characters such as capital letters)/[0-9]{1,2}/
/[0-9.\-_]/Examples from the ESLint documentation.
sonarjs/duplicates-in-character-class
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/duplicates-in-character-class": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
DOMPurify configuration should not be bypassable
Templates should not be constructed dynamically
Repeated patterns in regular expressions should not match the empty string
Remote artifacts should not be used without integrity checks
Encryption algorithms should be used with secure mode and padding scheme