Dremora / eslint-plugin-no-type-assertion

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

[question] Differences to `@typescript-eslint/consistent-type-assertions` and `@typescript-eslint/no-non-null-assertion` #5

Closed mikew closed 1 year ago

mikew commented 1 year ago

I'm looking to add this rule to my teams linter, and am brushing up on potential other rules to add from @typescript-eslint, and noticed it has:

'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }]

which disallows type assertions, and:

'@typescript-eslint/no-non-null-assertion': ['error']

which disallows non-null assertions.

Is the special handling of unknown the big differentiator with the rule in this repo?

Dremora commented 1 year ago

Pretty much. See also the thread here.