Rule proposal: prefer declare var
for global declarations
#2594
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement: new plugin rule
New rule request for eslint-plugin
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Using block-scoped
declare const
anddeclare let
in global context has a potentially unwanted effect - they can be accessed using unqualified access, but not usingglobalThis
. When this behavior have been implemented in TypeScript (microsoft/TypeScript#30510) all declarations in standard lib files have been changed todeclare var
, so I believe it's something that generally can be recommended for external declarations too.The text was updated successfully, but these errors were encountered: