Skip to content

Latest commit

 

History

History

plugin-remove-useless-constructor

@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