1.0.0 • Published 3 years ago

@putout/plugin-remove-useless-constructor v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@putout/plugin-remove-useless-constructors NPM version Dependency Status

Wrapper classes have surprising behaviour, such as new Boolean(false) evaluating to true.

https://google.github.io/styleguide/tsguide.html#primitive-types-wrapper-classes

putout plugin adds ability to remove useless constructors. Use with remove-useless-new.

Install

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

Rule

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

❌ Incorrect code example

const s = 'hello';
const b = false;
const n = 5;

✅ Correct code Example

const s = 'hello';
const b = false;
const n = 5;

License

MIT