🐊Putout plugin adds ability to remove unused private fields
npm install @putout/plugin-remove-unused-private-fields[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-unused-private-fields.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-unused-private-fields"npm"
> 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.
```
npm i @putout/plugin-remove-unused-private-fields
`json`
{
"rules": {
"remove-unused-private-fields": "on"
}
}
`js`
class Hello {
#a = 5;
#b = 3;
get() {
return this.#a;
}
}
`js`
class Hello {
#a = 5;
get() {
return this.#a;
}
}
Linter | Rule | Fix
--------|-------|------------|
🐊 Putout | remove-unused-private-fields | ✅
⏣ ESLint | no-unused-private-class-members` | ❌
MIT