-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do this
Milestone
Description
https://twitter.com/rauschma/status/1181852019264503808
We should give a more helpful message when missing "lib": ["dom"]
.
If accessing a property on a type that was
- empty and
- declared in the global scope and
- named after a pattern that matches
/^HTML\w+Element$/
it is likely a forward declaration for DOM environments, and we should provide an error message like:
Property '{0}' does not exist on type '{1}'. Did you forget to include "dom" in your "lib" setting?
Bonus: would be awesome if we could provide related spans in a tsconfig.json
/jsconfig.json
to say
The 'lib' option was specified here.
fent, kyeb and JoshuaKGoldberg
Metadata
Metadata
Assignees
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do this