sonarjs/constructor-for-side-effects
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/constructor-for-side-effects": "error",
},
},
];Objects should not be created to be dropped immediately without being used
new MyConstructor(); // Non-Compliantvar something = new MyConstructor(); // CompliantExamples from the ESLint documentation.
sonarjs/constructor-for-side-effects
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/constructor-for-side-effects": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Regular expression quantifiers and character classes should be used concisely
Comma and logical OR operators should not be used in switch cases
Content security policy fetch directives should not be disabled
Dynamic code execution should not use user-controlled data