Skip to content

putout v20.9.0

Choose a tag to compare

@coderaiser coderaiser released this 03 Oct 14:02
· 13227 commits to master since this release

New rule remove-useless-constructor added 🎉

image

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

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