putout v20.9.0
New rule remove-useless-constructor added 🎉
Wrapper classes have surprising behaviour, such as
new Boolean(false)evaluating totrue.https://google.github.io/styleguide/tsguide.html#primitive-types-wrapper-classes
New putout plugin adds ability to remove useless constructors. Use it with remove-useless-new to get event more benefit 🔥.
❌ Incorrect code example
const s = String('hello');
const b = Boolean(false);
const n = Number(5);✅ Correct code Example
const s = 'hello';
const b = false;
const n = 5;🔥 feature
- (@putout/plugin-putout) check-replace-code: add support of top level comparison __a, "hello"
- (@putout/compare) add support of top level comparison __a === "hello world"
- (@putout/plugin-remove-useless-constructor) add
