-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global variables in html file cause spurious eslint messages because eslint globals can not be configured #972
Comments
You can read it explicitly from the You can also force ESLint to ignore any line with |
D'oh. Thanks :)
|
It would be great to have this documented. Would you like to add this to the User Guide? |
Sure. I'll send a PR. |
* Added info on using global variables. See issue #972. * Fixed typo. * Moved new section. * Small tweaks * Syntax highlighting
* Added info on using global variables. See issue facebook#972. * Fixed typo. * Moved new section. * Small tweaks * Syntax highlighting
* Added info on using global variables. See issue facebook#972. * Fixed typo. * Moved new section. * Small tweaks * Syntax highlighting
* Added info on using global variables. See issue facebook#972. * Fixed typo. * Moved new section. * Small tweaks * Syntax highlighting
For reasons I have load a JavaScript file in CRA's index.html which defines a global variable.
CRA's eslint settings have "no-undef" set to error. Any use of the above-mentioned global variable will result in a compile error in the browser, preventing me from working.
Manually editing CRA's eslint settings to have "no-undef" be a warning is only a partial solution: I still get warnings in the console.
Manually editing the globals in CRA's eslint settings solves the problem, but is obviously not very elegant.
Ideally the development server would pick up on a .eslintrc file in the root of the project. (I've tried this, and it didn't work.)
The text was updated successfully, but these errors were encountered: