-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Labels
A-linterArea - LinterArea - Lintergood first issueExperience Level - Good for newcomersExperience Level - Good for newcomers
Description
Given the following TypeScript code, it throws an error:
⚠ eslint(no-undef): Disallow the use of undeclared variables
function resolve<T>(path: string): T {
return { path } as T; ─
}
help: 'T' is not defined.I understand this may just be a conflict between enabled rules; if so, maybe just adding a note in doc about recommended TS settings?
Also as a similar-but-slightly-different error, what’s the recommended way to handle builtin libraries?
⚠ eslint(no-undef): Disallow the use of undeclared variables
const root = new URL("../", import.meta.url);
───
help: 'URL' is not defined.I understand throwing an error for “magically-loaded” globals like test runner expect() calls. But for built-in DOM libraries, is there a recommended setup to allow this?
For both, I realize it may just require documentation, but wanted to ask for my own understanding. Thanks for such an amazing project!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Lintergood first issueExperience Level - Good for newcomersExperience Level - Good for newcomers
Type
Fields
Give feedbackPriority
None yet