@putout/plugin-remove-unused-private-fields
🐊Putout plugin adds ability to remove unused private fields
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-remove-unused-private-fields 
SYNC missed versions from official npm registry.

@putout/plugin-remove-unused-private-fields NPM version

Class fields are public by default, but private class members can be created by using a hash # prefix. The privacy encapsulation of these class features is enforced by JavaScript itself.

(c) MDN

????Putout plugin adds ability to remove unused private fields.

Install

npm i @putout/plugin-remove-unused-private-fields

Rule

{
    "rules": {
        "remove-unused-private-fields": "on"
    }
}

❌ Incorrect code example

class Hello {
    #a = 5;
    #b = 3;
    get() {
        return this.#a;
    }
}

✅ Correct code Example

class Hello {
    #a = 5;
    get() {
        return this.#a;
    }
}

Comparison

Linter Rule Fix
???? Putout remove-unused-private-fields
ESLint no-unused-private-class-members

License

MIT

Current Tags

  • 4.0.0                                ...           latest (a year ago)

9 Versions

  • 4.0.0                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |