@putout/plugin-remove-useless-delete
🐊Putout plugin adds ability to remove useless delete
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-remove-useless-delete 
SYNC missed versions from official npm registry.

@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

Linter Rule Fix
🐊 Putout remove-useless-delete βœ…
⏣ ESLint no-delete-var ❌
πŸ¦• Deno no-delete-var ❌

License

MIT

Current Tags

  • 3.0.0                                ...           latest (9 months ago)

7 Versions

  • 3.0.0                                ...           9 months ago
  • 2.0.0                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE