Skip to content

Commit 0dd3dbd

Browse files
sidoshiljharb
authored andcommitted
[eslint config] [base] [breaking] Blacklist confusing globals
1 parent 324bf9c commit 0dd3dbd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/eslint-config-airbnb-base/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@
6262
},
6363
"engines": {
6464
"node": ">= 4"
65+
},
66+
"dependencies": {
67+
"eslint-restricted-globals": "^0.1.1"
6568
}
6669
}

packages/eslint-config-airbnb-base/rules/variables.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const restrictedGlobals = require('eslint-restricted-globals');
2+
13
module.exports = {
24
rules: {
35
// enforce or disallow variable initializations at definition
@@ -14,7 +16,7 @@ module.exports = {
1416
'no-label-var': 'error',
1517

1618
// disallow specific globals
17-
'no-restricted-globals': 'off',
19+
'no-restricted-globals': ['error'].concat(restrictedGlobals),
1820

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

0 commit comments

Comments
 (0)