sonarjs/no-dead-store
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-dead-store": "error",
},
},
];i = a + b; // Noncompliant; calculation result not used before value is overwritten
i = compute();i = a + b;
i += compute();Examples from the ESLint documentation.
sonarjs/no-dead-store
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-dead-store": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Regular expressions should not contain control characters
Lodash and Underscore.js debounced or throttled functions should not be recreated on every React render
Collection size and array length comparisons should make sense
UI test debug commands should not be committed to version control
Tests should not execute any code after "done()" is called
Default imports from modular utility libraries should not be used