Eslint-plugin-import: import/no-unresolved

Created on 13 Oct 2017  ยท  10Comments  ยท  Source: benmosher/eslint-plugin-import

I am using the vscode editor and am having problems with eslint validation of false-positive type. My operating system mac os (high sierra).

More details:

Error:

[eslint] Casing of [relative path] does not match the underlying filesystem. (import / no-unresolved)
module "[module path]"

captura de tela 2017-10-13 as 12 34 17

captura de tela 2017-10-13 as 12 34 22

captura de tela 2017-10-13 as 12 34 27

pajzvoej82

"eslint": "^4.8.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jest": "^21.2.0",
"eslint-plugin-jsx-a11y": "^6.0.2",

Most helpful comment

I am seeing this when via command line when running it through a setup similar to how create-react-app works.
We have a project that houses our webpack build alongside our application boilerplate. I was seeing the error in this app as well until I upgraded all eslint dependencies and it has now disappeared.

After creating a new app using the boilerplate (which is CRA compatible), the new application suffers this problem. This occurs when running eslint via the build script (which uses eslint-loader inside of webpack) and also when running via command line (npx eslint src). The plugin inside of Atom is not affected by this issue for some reason.

EDIT: I have realised that it is actually an occurrence of #720 as my current working directory in Git Bash did not match the casing of the folder structure on disk. As far as I can tell, #720 should be fixed and is in v2.8.0 but I am still seeing it.

All 10 comments

I guess this is related with #720, @benmosher when is 2.8.0 release scheduled for?

+1

@xereda Are you opening VS Code from the command line? I've seen this error come up in Atom when I opened a project using by cd'ing using the wrong casing. ea: desktop/projectname vs Desktop/projectname

@Sage911 I open the project from within the vscode.

I'm having the exact same issue with Atom.

Getting the same problem. ./node_modules/.bin/eslint . works fine from command line, but does not work in the terminal in Visual Studio Code. Does not work with the ESLint plugin either - all imports in code files are marked with this error.

I'm on Windows 10 and Visual Studio Code 1.18.1.

$ yarn list | grep eslint
โ”œโ”€ [email protected]
โ”‚  โ””โ”€ eslint-restricted-globals@^0.1.1
โ”œโ”€ [email protected]
โ”‚  โ””โ”€ eslint-config-airbnb-base@^11.1.0
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”‚  โ”œโ”€ eslint-import-resolver-node@^0.3.1
โ”‚  โ”œโ”€ eslint-module-utils@^2.1.1
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]

@pcguru That seems like an issue with VSCode. The only thing that matters is that it works on the command line; anything else is an editor issue.

I'm going to close this; there doesn't seem to be any issue here that's specific to this plugin.

I am seeing this when via command line when running it through a setup similar to how create-react-app works.
We have a project that houses our webpack build alongside our application boilerplate. I was seeing the error in this app as well until I upgraded all eslint dependencies and it has now disappeared.

After creating a new app using the boilerplate (which is CRA compatible), the new application suffers this problem. This occurs when running eslint via the build script (which uses eslint-loader inside of webpack) and also when running via command line (npx eslint src). The plugin inside of Atom is not affected by this issue for some reason.

EDIT: I have realised that it is actually an occurrence of #720 as my current working directory in Git Bash did not match the casing of the folder structure on disk. As far as I can tell, #720 should be fixed and is in v2.8.0 but I am still seeing it.

It report error โœ–๏ธ:
Casing of ./FormCreate does not match the underlying filesystem import/no-unresolved

/* eslint-disable import/prefer-default-export */
import FormCreate from './FormCreate';

export { FormCreate };

It does not report error โ˜‘๏ธ:

/* eslint-disable import/prefer-default-export */
+
import FormCreate from './FormCreate';

export { FormCreate };

@yoyo837 please file a new issue.

Was this page helpful?
0 / 5 - 0 ratings