Disallow the usage of one or few type assertion in your typescript code
npm install eslint-plugin-no-specific-type-assertionEslint plugin that disallow the usage of a type assertion in your typescript code.
You might need to prevent your team from adding unwanted type assertion that can be harmful on the long run,
you can use this plugin to specify the type assertion you want to disallow.
```
yarn add -D eslint-plugin-no-specific-type-assertion
Using the new Eslint Flat Config
`javascript
import NoTypeAssertionEslint from 'eslint-plugin-no-specific-type-assertion';
export default [{
plugins: {
'no-specific-type-assertion': NoTypeAssertionEslint,
},
'no-specific-type-assertion/no-specific-type-assertion': [
'error',
{
disallowedTypes: ['FormatIntlKeys'],
},
],
}]
`
Will disallow the usage of the specified type assertion.
Example that will trigger error for this rule:
`jsx``