$ cnpm install @putout/plugin-remove-useless-delete
The
deleteoperator removes apropertyfrom anobject. If theproperty's value is anobjectand there are no more references to theobject, theobjectheld by thatpropertyis eventually released automatically.(c) MDN
????Putout plugin adds ability to remove useless delete.
Check it out in ????Putout Editor.
Fixes syntax error:
SyntaxError: Delete of an unqualified identifier in strict mode.(c) MDN
npm i @putout/plugin-remove-useless-delete
{
"rules": {
"remove-useless-assign": "on"
}
}
delete x;
delete x.x;
delete x[1];
delete x.x;
delete x[1];
| Linter | Rule | Fix |
|---|---|---|
| ???? Putout | remove-useless-delete |
✅ |
| ⏣ ESLint | no-delete-var |
❌ |
| ???? Deno | no-delete-var |
❌ |
MIT
Copyright 2013 - present © cnpmjs.org | Home |