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
Using block-scopeddeclare 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.
// Invaliddeclareconstfoo:string;
// Invalidexport{}declare global{constfoo:string;}
// Validexport{}declareconstfoo:string;