1.0.2 ā€¢ Published 2 years ago

@putout/plugin-convert-any-to-primitive v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@putout/plugin-convert-any-to-primitive NPM version

šŸŠPutout plugin adds ability to convert any to primitive. Moved to @putout/plugin-typescript.

Install

npm i @putout/plugin-convert-any-to-primitive -D

Rule

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

āŒ Incorrect code example

const x: any = 5;

āœ… Correct code Example

const x: number = 5;

License

MIT