mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-24 13:01:24 +01:00
merge completed... now to fix all the bugs...
This commit is contained in:
commit
87c4d80fbc
3472 changed files with 466748 additions and 6517 deletions
45
node_modules/confusing-browser-globals/README.md
generated
vendored
Normal file
45
node_modules/confusing-browser-globals/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue