-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Using block-scoped declare const and declare let in global context has a potentially unwanted effect - they can be accessed using unqualified access, but not using globalThis. When this behavior have been implemented in TypeScript (microsoft/TypeScript#30510) all declarations in standard lib files have been changed to declare var, so I believe it's something that generally can be recommended for external declarations too.
// Invalid
declare const foo: string;// Invalid
export {}
declare global {
const foo: string;
}// Valid
export {}
declare const foo: string;kirkwaiblinger, kripod and remcohaszingkirkwaiblinger
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin