Skip to content

Commit b30b0e4

Browse files
samschljharb
authored andcommitted
[eslint-config] [base] no-restricted-globals: add better messages
1 parent 2c5c88d commit b30b0e4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ module.exports = {
1616
'no-label-var': 'error',
1717

1818
// disallow specific globals
19-
'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(confusingBrowserGlobals),
19+
'no-restricted-globals': [
20+
'error',
21+
{
22+
name: 'isFinite',
23+
message:
24+
'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
25+
},
26+
{
27+
name: 'isNaN',
28+
message:
29+
'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
30+
},
31+
].concat(confusingBrowserGlobals),
2032

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

0 commit comments

Comments
 (0)