A list of browser globals that are often used by mistake instead of local variables


911.0.5013 years ago4 years agoMinified + gzip package size for @bradfordlemley/confusing-browser-globals in KB



A curated list of browser globals that commonly cause confusion and are not recommended to use without an explicit window. qualifier.


Some global variables in browser are likely to be used by people without the intent of using them as globals, such as status, name, event, etc.

For example:

handleClick() { // missing `event` argument
      text: event.target.value // uses the `event` global: oops!

This package exports a list of globals that are often used by mistake. You can feed this list to a static analysis tool like ESLint to prevent their usage without an explicit window. qualifier.


npm install --save confusing-browser-globals


If you use Create React App, you don't need to configure anything, as this rule is already included in the default eslint-config-react-app preset.

If you maintain your own ESLint configuration, you can do this:

var restrictedGlobals = require('confusing-browser-globals');

module.exports = {
  rules: {
    'no-restricted-globals': ['error'].concat(restrictedGlobals),



If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.