Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

False error by eslint-plugin-import for webpack aliases

I am using webpack's aliases in my project. Everything works fine in my original project, but when I clone the project, I get error from import/no-unresolved for my webpack aliases:

Casing of $js/Controller does not match the underlying filesystem import/no-unresolved

what makes it more interesting is that my project works fine. import/no-unresolved seems to send show false error.

For more details, I am adding few links: .eslintrc.js, webpack.config.babel.js, Link to my Repo

please let me know if you need anything else.

like image 816
Bharat Soni Avatar asked Jun 11 '17 09:06

Bharat Soni


People also ask

What are webpack aliases?

Aliasing is webpack's handy way to shave time and keystrokes off importing frequently used modules. You will need the path module, included with node. js, as it is how you will tell webpack where to look for those specific files. Using the resolve. alias property, you can define aliases for frequently imported modules.

What does Eslint plugin Import do?

This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor.


1 Answers

I found the solution. I installed eslint-import-resolver-webpack in order to make Webpack aliases work with eslint resolver. Here is the command to install the plugin:

npm install eslint-import-resolver-webpack --save-dev

Here is the link to the repo

like image 141
Bharat Soni Avatar answered Oct 02 '22 14:10

Bharat Soni