@putout/plugin-remove-unused-private-fields
v2.1.0
Published
šPutout plugin adds ability to remove unused private fields
Downloads
59,456
Maintainers
Readme
@putout/plugin-remove-unused-private-fields
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;
}
}
License
MIT