Skip to content

Commit

Permalink
[eslint config] [base] [deps] Switch to confusing-browser-globals
Browse files Browse the repository at this point in the history
The `eslint-restricted-globals` package author created an equivalent
package `confusing-browser-globals` that now resides within the
create-react-app monorepo. In sidoshi/eslint-restricted-globals#2
@sidoshi suggested that we change eslint-config-airbnb-base to depend
on the CRA package instead, in an effort to consolidate the two.

Currently the two global lists are identical, so this does not change
the generated eslint config:
https://unpkg.com/eslint-restricted-globals@0.2.0/index.js
https://unpkg.com/confusing-browser-globals@1.0.5/index.js
  • Loading branch information
edmorley authored and ljharb committed Nov 20, 2018
1 parent 74deb81 commit 21b65e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-config-airbnb-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"node": ">= 4"
},
"dependencies": {
"eslint-restricted-globals": "^0.1.1",
"confusing-browser-globals": "^1.0.5",
"object.assign": "^4.1.0",
"object.entries": "^1.0.4"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-airbnb-base/rules/variables.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const restrictedGlobals = require('eslint-restricted-globals');
const confusingBrowserGlobals = require('confusing-browser-globals');

module.exports = {
rules: {
Expand All @@ -16,7 +16,7 @@ module.exports = {
'no-label-var': 'error',

// disallow specific globals
'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(restrictedGlobals),
'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(confusingBrowserGlobals),

// disallow declaration of variables already declared in the outer scope
'no-shadow': 'error',
Expand Down

0 comments on commit 21b65e9

Please sign in to comment.