Skip to content
Advertisement

How to remove ESlint error no-unresolved from importing ‘react’

no-unresolved https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md

enter image description here

After installing eslint-import-resolver-webpack enter image description here

My .eslintrc config

JavaScript

My package.json

JavaScript

Webpack

JavaScript

Advertisement

Answer

You can add an option to ignore case:

JavaScript

This thread at github also describes how the linter was checking case for parts of the path which come before the folder containing package.json. If you for example have the path: C:/Workspace/app and you navigate to it using cd C:/workspace/app (lowercase workspace), the linter would also give an error on the imports. Looks like it should now be fixed, but perhaps you are still using an older version.

Advertisement