1.0.0 • Published 3 years ago
@putout/plugin-remove-useless-constructor v1.0.0
@putout/plugin-remove-useless-constructors
Wrapper classes have surprising behaviour, such as
new Boolean(false)
evaluating totrue
.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
1.0.0
3 years ago