A list of confusing globals that should be restricted to be used as globals
$ npm install --save eslint-restricted-globals
Some global variables in browser are likely to be used by people without the intent of using them as globals, such as
And because eslint thinks of them as valid global variables, it does not warn in case of bugs.
Here we try to log variable
nama if it is truthy, but by mistake we are logging
name and as
name is a valid global, no eslint warning is shown.
To avoid this, we blacklist such confusing globals which are exported from this package. It contains the list of variables that we think should not be used without
Add this in your eslint config in rules property:
var restrictedGlobals =moduleexports =rules:'no-restricted-globals': 'error'