Closed laurence-hudson-tessella closed 7 years ago
If your content with this I'd appreciate an npm release with it in.
Hi @laurence-hudson-tessella,
As explained in https://github.com/tleunen/eslint-import-resolver-babel-module/issues/43#issuecomment-288358920, we should resolve the string into the proper directory. I wonder how skipping the babelrc value can work, unless your babelrc file is at the root of the project, which will work indeed because the default cwd in the project root.
Yes, that is correct. As this PR stands it only covers cases where the babelrc file is at the project root, but that's still an improvement over the current behavior, which never works when cwd === "babelrc"
.
This should be resolved with the 4.0.0-beta.0
version, alongside the babel-plugin-module-resolver 3.0.0-beta.0
.
Could you confirm please? Will reopen if not.
Doesn't look promising:
$ npm outdated
Package Current Wanted Latest
babel-plugin-module-resolver 3.0.0-beta.0 3.0.0-beta.0 2.7.0
eslint-import-resolver-babel-module 4.0.0-beta.0 4.0.0-beta.0 3.0.0
with
{
"plugins": [
["module-resolver", {
"cwd": "babelrc",
"alias": {
"~shared": "./src/shared"
}
}]
]
}
results in a linting failure for every use of the alias.
Let me know if I missed something, or if there is more debugging info I can provide.
So you're right, there's still an issue with it. Reopening the ticket.
Will investigate further and see if there's a better fix because I'm not convinced we have to skip the value
Merging #45 into master will not change coverage. The diff coverage is
100%
.
Impacted Files | Coverage Δ | |
---|---|---|
src/index.js | 100% <100%> (ø) |
:arrow_up: |
see #55
Not sure this will fix tleunen/eslint-import-resolver-babel-module#43 in all contexts, but it does for me.