Skip to content

Commit

Permalink
[eslint-config] [base] no-restricted-globals: add better messages
Browse files Browse the repository at this point in the history
  • Loading branch information
samsch authored and ljharb committed Oct 24, 2020
1 parent 2c5c88d commit b30b0e4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/eslint-config-airbnb-base/rules/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ module.exports = {
'no-label-var': 'error',

// disallow specific globals
'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(confusingBrowserGlobals),
'no-restricted-globals': [
'error',
{
name: 'isFinite',
message:
'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
},
{
name: 'isNaN',
message:
'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
},
].concat(confusingBrowserGlobals),

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

0 comments on commit b30b0e4

Please sign in to comment.