I define some global variables in my project's .eslintrc
, and this config file is detected correctly by ESLint when I run ESLint as a script.
Now, I would like to configure IntelliJ IDEA so that its JavaScript inspector notices that I have defined these global variables in .eslintrc
, and doesn't bother me with "Missing import statement" warnings for these variables.
For example, both ReactDOM
and React
are global variables defined in my .eslintrc
, so I would like the warnings in this screenshot to disappear:
FYI, the JavaScript language version selected in the project settings is "React JSX (JSX in ECMAScript 6)".
As far as I know, ESlint is configured correctly in the settings:
What am I missing?
(I am using the currently latest version of IntelliJ IDEA: 2016.3.4)
ESLint configuration doesn't affect IDEA own inspections; you need to suppress 'Missing Import statement' inspection using Alt+Enter
, Right
, 'Suppress for statement'
;
there is a feature request to respect env
and globals
from .eslintrc
- see https://youtrack.jetbrains.com/issue/WEB-21957
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With