npm.io
3.0.0 • Published 1 year ago

@putout/plugin-remove-useless-constructor

Licence
MIT
Version
3.0.0
Deps
0
Vulns
0
Weekly
0
Stars
804

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

The constructor method is a special method of a class for creating and initializing an object instance of that class.

(c) MDN

Putout plugin adds ability to remove useless constructor. Check out in Putout Editor.

Install

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

Rule

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

Example of incorrect code

class A extends B() {
    constructor(...args) {
        super(...args);
    }
}

Example of correct code

class A extends B() {}

License

MIT

Keywords