confusing-browser-globals
A list of browser globals that are often used by mistake instead of local variables
Last updated 7 years ago by timer .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install confusing-browser-globals 
SYNC missed versions from official npm registry.

confusing-browser-globals

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

Motivation

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
  this.setState({
  	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.

Installation

npm install --save confusing-browser-globals

Usage

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),
  }
};

License

MIT

Current Tags

  • 1.1.0-next.61                                ...           canary (5 years ago)
  • 1.0.11                                ...           latest (3 years ago)
  • 1.1.0-next.14                                ...           next (3 years ago)

45 Versions

  • 1.1.0-next.14                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 2.0.0-next.104                                ...           3 years ago
  • 2.0.0-next.103                                ...           3 years ago
  • 2.0.0-next.102                                ...           3 years ago
  • 2.0.0-next.101                                ...           3 years ago
  • 2.0.0-next.91                                ...           3 years ago
  • 2.0.0-next.81                                ...           3 years ago
  • 2.0.0-next.75                                ...           3 years ago
  • 1.0.10                                ...           4 years ago
  • 2.0.0-next.300                                ...           4 years ago
  • 2.0.0-next.299                                ...           4 years ago
  • 2.0.0-next.281                                ...           4 years ago
  • 2.0.0-next.279                                ...           4 years ago
  • 2.0.0-next.260                                ...           4 years ago
  • 2.0.0-next.247                                ...           4 years ago
  • 1.1.0-next.103                                ...           5 years ago
  • 1.1.0-next.85                                ...           5 years ago
  • 1.1.0-next.62                                ...           5 years ago
  • 1.1.0-next.61                                ...           5 years ago
  • 1.0.9                                ...           5 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.7                                ...           6 years ago
  • 2.0.0-next.74                                ...           6 years ago
  • 2.0.0-next.b0cbf2ca                                ...           6 years ago
  • 1.0.6                                ...           6 years ago
  • 1.0.6-next.6a95aae9                                ...           6 years ago
  • 1.0.5                                ...           6 years ago
  • 1.0.5-next.c662dfb0                                ...           6 years ago
  • 1.0.5-next.9b4009d7                                ...           6 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 2.0.0-next.fb6e6f70                                ...           6 years ago
  • 2.0.0-next.2150693d                                ...           6 years ago
  • 2.0.0-next.a671462c                                ...           6 years ago
  • 2.0.0-next.3e165448                                ...           7 years ago
  • 2.0.0-next.66cc7a90                                ...           7 years ago
  • 2.0.0-next.b2fd8db8                                ...           7 years ago
  • 2.0.0-next.47d2d941                                ...           7 years ago
  • 2.0.0-next.03604a46                                ...           7 years ago
  • 2.0.0-next.9754a231                                ...           7 years ago
  • 2.0.0-next.096703ab                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (3)
Downloads
Total 8
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (0)
None
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE