Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
The language and UX aroundno-unsafe-call (and similar rules) messages indicate "anerror type typed value", which seems unclear and maybe also misleading.
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
constel=/**@type {Element} */({})el.href.includes('abc')
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/<rule-name>":["error", ...<options>],},};
tsconfig
{"compilerOptions": { }}Expected Result
I expected the error message:
Unsafe call of a method on an `any` typed valueDifferences:
- mentions the type
any(which is the only observable type in JSDoc withoutcheckJs: true) - doesn't mention the type
error - less important: mentions "method"
Actual Result
I observed the error message:
Unsafe call of an `error` type typed valueConfusing parts:
- no mention of
any - mentions the type
error, which is unobservable in JSDoc withoutcheckJs: true- also, if I hear "an
errortype typed value", then that could sound like something likeError, so even if this "error" language is kept in some form, maybe it should be disambiguated fromError
- also, if I hear "an
- less important: does not mention "method"
Using this in TypeScript or withcheckJs: true leads to a more understandable experience:
Hovering overhref inel.href shows that TypeScript is reporting an error:
Property 'href' does not exist on type 'Element'.Additional Info
This also affects other rules, since they also create messages the same way.
The type for this seems to be coming from thets-api-utils functionisIntrinsicErrorType

