[non-nullable-type-assertion-style] triggers on as const
declaration
#2879
Labels
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Uh oh!
There was an error while loading. Please reload this page.
Repro
Expected Result
<anything> as const
declarations shouldn't trigger a "don't do a type cast where!
is sufficient" warning sinceas const
doesn't remove any nullability, just makes everything deep-readonly.Actual Result
The rule thinks
as const
is a typecast removing null from a type:Additional Info
Versions
@typescript-eslint/eslint-plugin
4.10.0
@typescript-eslint/parser
4.10.0
TypeScript
4.1.3
ESLint
7.15.0
node
14.15.1
The text was updated successfully, but these errors were encountered: