@putout/plugin-remove-useless-constructor

1.0.0 • Public • Published

@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

Package Sidebar

Install

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

Weekly Downloads

4,468

Version

1.0.0

License

MIT

Unpacked Size

4.23 kB

Total Files

4

Last publish

Collaborators

  • coderaiser