Skip to content

Commit

Permalink
[eslint-config] Add a message for confusing-browser-globals
Browse files Browse the repository at this point in the history
[eslint-config] Add a message for confusing-browser-globals
  • Loading branch information
vmohir authored Aug 21, 2023
2 parents 46ae3e2 + 25799ba commit 55f262f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/eslint-config-airbnb-base/rules/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ module.exports = {
message:
'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
},
].concat(confusingBrowserGlobals),
].concat(confusingBrowserGlobals.map(function (g) {
return {
name: g,
message:
"Use window." +
g +
" instead. https://github.com/facebook/create-react-app/blob/main/packages/confusing-browser-globals/README.md",
};
})),

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

0 comments on commit 55f262f

Please sign in to comment.