@putout/plugin-remove-useless-types-from-constants

putout plugin adds ability to convert any to primitive type

Usage no npm install needed!

<script type="module">
  import putoutPluginRemoveUselessTypesFromConstants from 'https://cdn.skypack.dev/@putout/plugin-remove-useless-types-from-constants';
</script>

README

@putout/plugin-remove-useless-types-from-constants NPM version

🐊Putout plugin adds ability to remove useless types from constants. Moved to @putout/plugin-typescript.

Install

npm i @putout/plugin-remove-useless-types-from-constants -D

Rule

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"
    }
}

❌ Incorrect code example

const x: any = 5;

✅ Correct code Example

const x = 5;

License

MIT