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