# @1o1w1/confusing-browser-globals

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

Latest version **1.0.7** (published 2019-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @1o1w1/confusing-browser-globals
pnpm add @1o1w1/confusing-browser-globals
yarn add @1o1w1/confusing-browser-globals
bun add @1o1w1/confusing-browser-globals
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-05-05 |
| First published | 2019-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | 1o1w1 |
| Keywords | eslint, globals |

## Links

- npm: https://www.npmjs.com/package/@1o1w1/confusing-browser-globals
- Repository: https://github.com/1o1w1/spa-webpack
- Homepage: https://github.com/1o1w1/spa-webpack#readme
- Issues: https://github.com/1o1w1/spa-webpack/issues
- npm.io page: https://npm.io/package/@1o1w1/confusing-browser-globals

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2019-05-05

## README

# 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:

```js
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

```sh
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:

```js
var restrictedGlobals = require('confusing-browser-globals');

module.exports = {
  rules: {
    'no-restricted-globals': ['error'].concat(restrictedGlobals),
  },
};
```

## License

MIT

---
_Source: https://npm.io/package/@1o1w1/confusing-browser-globals · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
