# confusing-browser-globals

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

Latest version **1.0.11** (published 2021-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install confusing-browser-globals
pnpm add confusing-browser-globals
yarn add confusing-browser-globals
bun add confusing-browser-globals
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-12-14 |
| First published | 2018-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/confusing-browser-globals) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 103251 |
| Maintainers | gaearon, fb, timer, iansu, ianschmitz |
| Keywords | eslint, globals |

## Links

- npm: https://www.npmjs.com/package/confusing-browser-globals
- Repository: https://github.com/facebook/create-react-app
- Homepage: https://github.com/facebook/create-react-app#readme
- Issues: https://github.com/facebook/create-react-app/issues
- npm.io page: https://npm.io/package/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
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2021-12-14
- 1.1.0-next.14 (next) — 2022-04-12
- 1.1.0-next.61 (canary) — 2019-10-24
- 2.0.0-next.104 — 2021-12-14
- 2.0.0-next.103 — 2021-12-14
- 2.0.0-next.102 — 2021-12-08
- 2.0.0-next.101 — 2021-12-08
- 2.0.0-next.91 — 2021-10-04
- 2.0.0-next.81 — 2021-09-01
- 2.0.0-next.75 — 2021-08-04
- 1.0.10 — 2020-10-23
- 2.0.0-next.300 — 2020-10-23
- 2.0.0-next.299 — 2020-10-23
- 2.0.0-next.281 — 2020-09-16
- 2.0.0-next.279 — 2020-09-16
- … 30 more at https://npm.io/package/confusing-browser-globals/versions

## 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
const restrictedGlobals = require('confusing-browser-globals');

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

## License

MIT

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