confusing-browser-globals
A list of browser globals that are often used by mistake instead of local variables
Last updated a month ago by iansu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (a year ago)
  • 1.0.10                                ...           latest (a month ago)
  • 2.0.0-next.300                                ...           next (a month ago)

36 Versions

  • 1.0.10                                ...           a month ago
  • 2.0.0-next.300                                ...           a month ago
  • 2.0.0-next.299                                ...           a month ago
  • 2.0.0-next.281                                ...           2 months ago
  • 2.0.0-next.279                                ...           2 months ago
  • 2.0.0-next.260                                ...           4 months ago
  • 2.0.0-next.247                                ...           4 months ago
  • 1.1.0-next.103                                ...           a year ago
  • 1.1.0-next.85                                ...           a year ago
  • 1.1.0-next.62                                ...           a year ago
  • 1.1.0-next.61                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           2 years ago
  • 2.0.0-next.74                                ...           2 years ago
  • 2.0.0-next.b0cbf2ca                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.6-next.6a95aae9                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.5-next.c662dfb0                                ...           2 years ago
  • 1.0.5-next.9b4009d7                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 2.0.0-next.fb6e6f70                                ...           2 years ago
  • 2.0.0-next.2150693d                                ...           2 years ago
  • 2.0.0-next.a671462c                                ...           2 years ago
  • 2.0.0-next.3e165448                                ...           2 years ago
  • 2.0.0-next.66cc7a90                                ...           3 years ago
  • 2.0.0-next.b2fd8db8                                ...           3 years ago
  • 2.0.0-next.47d2d941                                ...           3 years ago
  • 2.0.0-next.03604a46                                ...           3 years ago
  • 2.0.0-next.9754a231                                ...           3 years ago
  • 2.0.0-next.096703ab                                ...           3 years ago
  • 0.0.0                                ...           3 years ago
Downloads
Today 139
This Week 8,980
This Month 139
Last Day 8,841
Last Week 50,783
Last Month 221,369
Dependencies (0)
None
Dev Dependencies (1)
Dependents (375)

Copyright 2014 - 2016 © taobao.org |