UNPKG

@putout/plugin-remove-useless-types

Version:
52 lines (36 loc) • 930 B
# @putout/plugin-remove-useless-types [![NPM version][NPMIMGURL]][NPMURL] [NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-types.svg?style=flat&longCache=true [NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-types "npm" 🐊[`Putout`](https://github.com/coderaiser/putout) plugin adds ability to find and remove `useless types`. Moved to [`@putout/plugin-typescript`](https://github.com/coderaiser/putout/tree/v24.0.2/packages/plugin-typescript#remove-useless-types). ## Install ``` npm i @putout/plugin-remove-useless-types -D ``` ## Rule ```json { "rules": { "remove-useless-types": "on" } } ``` ## āŒ Incorrect code example ```ts type oldType = { a: number, b: string, }; type newType = oldType; const x: newType = 5; ``` ## āœ… Correct code Example ```ts type oldType = { a: number, b: string, }; const x: oldType = 5; ``` ## License MIT