no-delete-var
eslint
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"no-delete-var": "error",
},
},
];let x;
delete x;The documentation shows no correct example for this rule.
Examples from the ESLint documentation.
no-delete-var
eslint
export default [
{
rules: {
"no-delete-var": "error",
},
},
];no-delete-var
eslint plugin · correctness
{
"rules": {
"no-delete-var": "error"
}
}performance/noDelete
performance · since 1.0.0
{
"linter": {
"rules": {
"performance": {
"noDelete": "error"
}
}
}
}"delete" should be used only with object properties
Disallow invalid regular expression strings in RegExp constructors
Disallow expressions where the operation doesn't affect the value
Disallow empty static blocks
Disallow let or var variables that are read but never assigned
Disallow fallthrough of case statements