mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-13 19:56:05 +09:00
remove timer and simon
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
# eslint-restricted-globals [](https://www.npmjs.com/package/eslint-restricted-globals) [](https://www.npmjs.com/package/eslint-restricted-globals)
|
||||
|
||||
> A list of confusing globals that should be restricted to be used as globals
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save eslint-restricted-globals
|
||||
```
|
||||
|
||||
Some global variables in browser are likely to be used by people without the intent of using them as globals, such as `status`, `name` etc.
|
||||
And because eslint thinks of them as valid global variables, it does not warn in case of bugs.
|
||||
|
||||
For eg:
|
||||
```js
|
||||
function foo(nama) {
|
||||
if (nama) {
|
||||
console.log(name)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Here we try to log variable `nama` if it is truthy, but by mistake we are logging `name` and as `name` is a valid global, no eslint warning is shown.
|
||||
|
||||
To avoid this, we blacklist such confusing globals which are exported from this package. It contains the list of variables that we think should not be used without `window.` qualifier. But as this is just a javascript array you can add, remove variables or even make your own list of variables.
|
||||
|
||||
## Usage
|
||||
|
||||
Add this in your eslint config in rules property:
|
||||
|
||||
```js
|
||||
var restrictedGlobals = require('eslint-restricted-globals')
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
'no-restricted-globals': ['error'].concat(restrictedGlobals),
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
module.exports = [
|
||||
'addEventListener',
|
||||
'blur',
|
||||
'close',
|
||||
'closed',
|
||||
'confirm',
|
||||
'defaultStatus',
|
||||
'event',
|
||||
'external',
|
||||
'defaultstatus',
|
||||
'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',
|
||||
]
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"_from": "eslint-restricted-globals@^0.1.1",
|
||||
"_id": "eslint-restricted-globals@0.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=",
|
||||
"_location": "/eslint-restricted-globals",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "eslint-restricted-globals@^0.1.1",
|
||||
"name": "eslint-restricted-globals",
|
||||
"escapedName": "eslint-restricted-globals",
|
||||
"rawSpec": "^0.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^0.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/eslint-config-airbnb-base"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz",
|
||||
"_shasum": "35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7",
|
||||
"_spec": "eslint-restricted-globals@^0.1.1",
|
||||
"_where": "/Users/cloyd/coderrr/odin/javascript-exercises/node_modules/eslint-config-airbnb-base",
|
||||
"author": {
|
||||
"name": "Siddharth Doshi",
|
||||
"email": "sidoshi@mail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/doshisid/eslint-restricted-globals/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "A list of confusing globals that should be restricted to be used as globals",
|
||||
"devDependencies": {
|
||||
"mocha": "^3.4.1"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/doshisid/eslint-restricted-globals#readme",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
"globals"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "eslint-restricted-globals",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/doshisid/eslint-restricted-globals.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "0.1.1"
|
||||
}
|
||||
Reference in New Issue
Block a user