Dremora / eslint-plugin-no-type-assertion

Disallow type assertions in TypeScript code
MIT License
29 stars 1 forks source link

Feature: allow whitelist of types to allow #4

Open a7madgamal opened 1 year ago

a7madgamal commented 1 year ago

to avoid reporting many warnings or errors I want to try using a custom type like SAFE_ANY that the rule should ignore if used like as SAFE_ANY I have some experience with eslint so I'm happy to open a PR if you are ok with the concept

config could look like this:

'no-type-assertion/no-type-assertion': ['error', { whitelist:['SAFE_ANY', 'Whatever'] }],
Dremora commented 1 year ago

I was quite sceptical about this approach, one similar issue was reported yesterday, however, upon further consideration, I can see now that it can be beneficial in some cases. If you submit a PR I'll merge it, let's call the property ignoreTypes.