eslint-import-resolver-webpack - leads ESLint integration of PHPStorm to throw errors on every import

Hello. 

We use webpack + ESLint in our frontend pipeline. 

To be able to use the external recaptcha script we do use the the following in the webpack config: 

externals: { grecaptcha: 'grecaptcha' },

To make the ESLint aware of it we installed eslint-import-resolver-webpack and set it up in the ESLint config via

settings: { 'import/resolver': 'webpack' },

This does work for our pipeline and ESLint does run through fine. 

But the ESLint integration of PHPStorm can't find any import as soon as I add the settings configuration to the eslintrc. Does someone have an idea on how to fix it? 

Thank you very much!

0
1 comment

Works fine for me using similar setup:

As you can see from screenshot, ESLint import/no-unresolved error is not reported for JQuery that is set up as external in webpack config:

externals: {
jquery: 'jQuery'
}

Could you share a sample project the issue can be repeated with?

0

Please sign in to leave a comment.