WIP - add extractor, generate snippet_data
This commit is contained in:
21
node_modules/confusing-browser-globals/LICENSE
generated
vendored
Normal file
21
node_modules/confusing-browser-globals/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013-present, Facebook, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
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
|
||||
69
node_modules/confusing-browser-globals/index.js
generated
vendored
Normal file
69
node_modules/confusing-browser-globals/index.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = [
|
||||
'addEventListener',
|
||||
'blur',
|
||||
'close',
|
||||
'closed',
|
||||
'confirm',
|
||||
'defaultStatus',
|
||||
'defaultstatus',
|
||||
'event',
|
||||
'external',
|
||||
'find',
|
||||
'focus',
|
||||
'frameElement',
|
||||
'frames',
|
||||
'history',
|
||||
'innerHeight',
|
||||
'innerWidth',
|
||||
'length',
|
||||
'location',
|
||||
'locationbar',
|
||||
'menubar',
|
||||
'moveBy',
|
||||
'moveTo',
|
||||
'name',
|
||||
'onblur',
|
||||
'onerror',
|
||||
'onfocus',
|
||||
'onload',
|
||||
'onresize',
|
||||
'onunload',
|
||||
'open',
|
||||
'opener',
|
||||
'opera',
|
||||
'outerHeight',
|
||||
'outerWidth',
|
||||
'pageXOffset',
|
||||
'pageYOffset',
|
||||
'parent',
|
||||
'print',
|
||||
'removeEventListener',
|
||||
'resizeBy',
|
||||
'resizeTo',
|
||||
'screen',
|
||||
'screenLeft',
|
||||
'screenTop',
|
||||
'screenX',
|
||||
'screenY',
|
||||
'scroll',
|
||||
'scrollbars',
|
||||
'scrollBy',
|
||||
'scrollTo',
|
||||
'scrollX',
|
||||
'scrollY',
|
||||
'self',
|
||||
'status',
|
||||
'statusbar',
|
||||
'stop',
|
||||
'toolbar',
|
||||
'top',
|
||||
];
|
||||
55
node_modules/confusing-browser-globals/package.json
generated
vendored
Normal file
55
node_modules/confusing-browser-globals/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"_from": "confusing-browser-globals@^1.0.6",
|
||||
"_id": "confusing-browser-globals@1.0.8",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-lI7asCibVJ6Qd3FGU7mu4sfG4try4LX3+GVS+Gv8UlrEf2AeW57piecapnog2UHZSbcX/P/1UDWVaTsblowlZg==",
|
||||
"_location": "/confusing-browser-globals",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "confusing-browser-globals@^1.0.6",
|
||||
"name": "confusing-browser-globals",
|
||||
"escapedName": "confusing-browser-globals",
|
||||
"rawSpec": "^1.0.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/eslint-config-react-app"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.8.tgz",
|
||||
"_shasum": "93ffec1f82a6e2bf2bc36769cc3a92fa20e502f3",
|
||||
"_spec": "confusing-browser-globals@^1.0.6",
|
||||
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/eslint-config-react-app",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/create-react-app/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "A list of browser globals that are often used by mistake instead of local variables",
|
||||
"devDependencies": {
|
||||
"jest": "24.8.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "a78ff74309430e15cd8b71b5bffe3d383679fee0",
|
||||
"homepage": "https://github.com/facebook/create-react-app#readme",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
"globals"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "confusing-browser-globals",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/create-react-app.git",
|
||||
"directory": "packages/confusing-browser-globals"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"version": "1.0.8"
|
||||
}
|
||||
Reference in New Issue
Block a user