-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rule to disallow referencing DOM globals #181
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a common mistake to reference DOM globals declared in
lib.dom.d.ts
:lib.dom.d.ts
new Event(...)
,Event.AT_TARGET
ande instanceof Event
document
,window
,navigator
alert
,confirm
,prompt
(should be banned by another rule)(set|clear)(Timeout|Interval|Immediate)
atob
andbtoa
console
(session|local)Storage
indexedDB
(request|cancel)AnimationFrame
URL
,CSS
print
window.
, but is this really desired? The code will work the same but the lint failure is gone afterwards ...lib.dom.d.ts
is included in the programts.SymbolFlags.Variable
orts.SymbolFlags.Function
declare var
anddeclare function
)Rule name:
no-restricted-dom-globals
?Ref: palantir/tslint#3824 which imposes the burden on the user to configure every possible global variable.
The text was updated successfully, but these errors were encountered: