sonarjs/no-delete-var
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-delete-var": "error",
},
},
];var x = 1;
delete x; // Noncompliant
function foo(){
..
}
delete foo; // Noncompliantvar obj = {
x:1,
foo: function(){
...
}
};
delete obj.x;
delete obj.foo;Examples from the ESLint documentation.
sonarjs/no-delete-var
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-delete-var": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Default imports from modular utility libraries should not be used
Union and intersection types should not include duplicated constituents
UI test debug commands should not be committed to version control
Parameterized tests should not contain duplicate test cases
Lodash and Underscore.js debounced or throttled functions should not be recreated on every React render