Created by: sidoshi
All the properties of window object such as name
, self
, and status
are considered to be global variables because of having browser
env in eslint config.
As a result this variables are ignored by eslint for errors such as no-unused-vars
when someone uses this variables in their code without the intent of using them as a global variable.
To solve this we'd have to remove browser
env from eslint config and add a list of global variables that are more commonly used. Other window properties are not considered global and requires window.
qualifier.
I have added a list of all variables that I think are commonly used as globals in browser env. Please guide if I have missed something.
How did I test this?
I created a new app with
npm run create-react-app test-app
npm start
Added console.log(status)
to index.js file
And it showed error in terminal that status
is not defined. (As expected)
But text-editors (Atom) won't show this as it requires eslint-config-react-app
to be installed globally and hence it becomes necessary to update that package globally for this to work.
closes #1834 (closed)