Closed HsuTing closed 6 years ago
Oh, my fault.
I found the problem. I had a filename eslint.js
.
Sorry to disturb you.
I still get [eslint-import-resolver-babel-module] TypeError: Cannot read property 'find' of undefined
, when import/no-unresolved
is detected.
[eslint-import-resolver-babel-module] TypeError: Cannot read property 'find' of undefined
at result.plugins.filter.plugin (**/node_modules/eslint-import-resolver-babel-module/lib/index.js:20:50)
eslint
does work, but I think this error should not be shown.
@HsuTing Found a workaround from #67. The latest version of this library is 5.0.0-beta.0. If you update this library to that version this issue is resolved.
I'm not sure why the default version in npm is 4.0.0. Probably because v5 is marked as beta.
Oh! Sorry, I found the solution. If using eslint-import-resolver-babel-module
with eslint-plugin-import
, we should set like this:
module.exports = {
...
settings: {
'import/resolver': {
node: {}, // need to add this
'babel-module': alias,
},
},
...
};
@jasonleibowitz Thank for your answer!
I try to use
eslint-plugin-import
witheslint-import-resolver-babel-module
. This can not work.eslint-import-resolver-babel-module
: ^4.0.0 | ^5.0.0-beta.0eslint-plugin-import
: ^2.11.0babel-core
: ^7.0.0-0When I use
eslint
, and.eslintcache
does not exit. It show:I found the problem is here.