You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding lib: ['DOM'] introduces 790 global variables. Many of these are deprecated and useless. Many of them have short names that can hide mistakes like a missing var or let. Some obvious offenders that absolutely result in regular bugs:
event
closed
parent
screen
status
toolbar
top
length
self
history
location
origin
For this reason I have so far refrained from using lib: ['DOM'] in my projects and prefer to access all globals via window.foo instead for clarity and safety.
However, this means that TS doesn't know about any of these types. Please can we make these types available so that we can at least access and use the type information without polluting the global scope with all these variables.
I'd be happy with one that just declares document and window globals, or a types-only version that leave all globals up to us, either way I don't mind, just anything that makes the types available without all these junk globals.
The text was updated successfully, but these errors were encountered:
If eslint had a way to whitelist only a specific set of acceptable globals that would be ok but having to blacklisting them all with no-restricted-globals is madness.
Adding
lib: ['DOM']
introduces 790 global variables. Many of these are deprecated and useless. Many of them have short names that can hide mistakes like a missingvar
orlet
. Some obvious offenders that absolutely result in regular bugs:event
closed
parent
screen
status
toolbar
top
length
self
history
location
origin
For this reason I have so far refrained from using
lib: ['DOM']
in my projects and prefer to access all globals viawindow.foo
instead for clarity and safety.However, this means that TS doesn't know about any of these types. Please can we make these types available so that we can at least access and use the type information without polluting the global scope with all these variables.
I'd be happy with one that just declares
document
andwindow
globals, or a types-only version that leave all globals up to us, either way I don't mind, just anything that makes the types available without all these junk globals.The text was updated successfully, but these errors were encountered: