javascript undefined global: inspection versus eslint - how to quiet?

I have a global variable injected from my webpack, and wanted to quiet warnings about it.

First step after searching a bit was to add it to the eslintrc globals section.

I still got a warning from Webstorm inspection.

I think Webstorm is finding the eslintrc.js file ok - when it runs eslint it reflects most updates to that config file.

But perhaps not this setting in particular.  After searching a bit more I found some posts to add the global comment.

Now with both the global comment and the eslintrc global setting, I get 2 warnings!  😅

0

I renamed the eslint config file to `.eslintrc.js` and then "Invalidate Caches / Restart", looks like that didn't clear it up

0

Unresolved variable warning comes from IDE own inspections, not from ESLint. To quiet it, you have to suppress the inspection with a comment

// noinspection JSUnresolvedVariable
APP_NAME

See https://www.jetbrains.com/help/idea/2020.1/disabling-and-enabling-inspections.html#suppress-in-editor

0

Adding individual comments for every undefined variable in each source file is tedious.

Would be great to have an option directing WebStorm to read globals from the ESLint config file.

0

请先登录再写评论。