$ cnpm install @putout/plugin-convert-any-to-primitive
putout plugin adds ability to convert generic to shorthand (https://stackoverflow.com/a/36843084/4536327).
npm i @putout/plugin-convert-any-to-primitive -D
Rule convert-any-to-primitive is enabled by default for ts and tsx files, to disable add to .putout.json:
{
"rules": {
"convert-any-to-primitive": "off"
}
}
const x: any = 5;
const x: number = 5;
MIT
Copyright 2013 - present © cnpmjs.org | Home |