There are a lot of globals in JS land:
Many of these globals have verbose / unusual names meaning you won’t enounter them when writing your application code.
But there are a handful of sneaky ones.
() => void
fits nicely into React components as an event handler
if your using a union of string literals with name
status, comparisions in code will still be valid against
neveris compatible with every type
Event | undefined
not too big of an issue in React land because
the fix: eslint
"no-restricted-globals": [ "error", "close", "closed", "status", "name", "length", "origin", "event", ],
What if I want to use one of those globals?
Don’t worry, you can access the property from
window and the lint rule won’t complain. e.g.