Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@putout/plugin-apply-as-type-assertions NPM version Dependency Status

putout plugin adds ability to apply as type asssertion according to best practices

Install

npm i @putout/plugin-apply-as-type-assertions

Rule

Rule apply-as-type-assertions is not bundled by default, to enable add to .putout.json:

Rule

{
    "rules": {
        "apply-as-type-assertions": "on"
    }
}

❌ Incorrect code example

const boundaryElement = <HTMLElement>e.target;

✅ Correct code Example

const boundaryElement1 = e.target as HTMLElement;

License

MIT