1.0.4 β€’ Published 10 months ago

@putout/plugin-remove-useless-delete v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@putout/plugin-remove-useless-delete NPM version

The delete operator removes a property from an object. If the property's value is an object and there are no more references to the object, the object held by that property is 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

Install

npm i @putout/plugin-remove-useless-delete

Rule

{
    "rules": {
        "remove-useless-assign": "on"
    }
}

❌ Example of incorrect code

delete x;
delete x.x;
delete x[1];

βœ… Example of correct code

delete x.x;
delete x[1];

Comparison

LinterRuleFix
🐊 Putoutremove-useless-deleteβœ…
⏣ ESLintno-delete-var❌
πŸ¦• Denono-delete-var❌

License

MIT

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago