Bug: [no-unsafe-assignment] Differentiate a types-error any from a "true" any #8231
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.3.3&fileType=.ts&code=DYUwLgBAbghsCuIBcEB28C2AjEAnA3AFCGwIgQC8EAzgA4D29A1gJ75A&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tieQEMAZolp9kySgHMmAW0Qt0URNGgdokcGAC%2BITUA&tsconfig=&tokens=false
Repro Code
ESLint Config
tsconfig
No response
Expected Result
Users should be told that the type is an "error" variant of
any
. It's confusing to have the same report show up for both a "real"any
and an error in type checking.Actual Result
The same error as if we'd added a
declare const spooky: any;
:Additional Info
Although the type's
typeToString()
returns"any"
, its intrinsic name is"error"
. See the Types panel of the linked playground.Error types in type checking are often a symptom of misconfiguration around TypeScript and/or typescript-eslint. Example StackOverflow question around an
any
in a lint rule.The text was updated successfully, but these errors were encountered: