-
Notifications
You must be signed in to change notification settings - Fork 31
Resolving aliases #33
Comments
I also tried a different approach ... using a glob for "root", but I can not get the same on ESLint ... then I added some "paths" to obtain a similar result. BUT, I would prefer to have also a glob there to avoid overhead maintaining this config. Is it possible? or some idea? .babelrc
.eslintrc
|
Looks like I missed your first message, my bad :( Setuping the paths shouldn't be required in the eslint plugin. It should reuse the ones from the babel plugin. By any chance, would you have a repo where you have the issue? Also, in your first message, is the issue with the root configuration or the alias? If you don't specify the extensions also in the eslint config, does it solve the issue? Because your config looks ok |
Tks ... babel-plugin works perfect using a glob for For me babel-plugin with I am trying to get rid of relative paths in a project with: Babel + Jest + ESLint + Webpack , and your plugins are the best option because even if it is possible to do something on webpack, then you need to duplicate code on Jest for using CLI and still you need something on Babel to build with the CLI. I will prepare a repo. Tks a lot for your feedback and your great job! |
This could actually be an issue if you have another components directory somewhere else, right? The only thing I see is the glob then, it must be an issue with that. I'll make some tests |
Please take a look to this repo: https://github.com/artola/plugin |
So I've been investigating on my side and your repo also confirmed what I found. Thanks @artola. So even though the babel plugin supports a glob configuration, the eslint import plugin doesn't. I'll make sure to add glob support here. In the meantime, you can use this babel configuration:
And the eslint config can stay empty:
|
Thanks a lot @tleunen I do believe that these plugins are the best way in the moment to deal with relative path, because Babel glue all the parts, and having the config in only one place make sense. |
@tleunen I did the changes that you advised, it works OK for ".js" files ... as soon as I rename some as ".jsx" it is not resolving properly.
|
And I believe you're also right, the eslint plugin doesn't reuse the extensions from the babel plugin. This should be added :) Will make all these fixes when I get some time this week (Probably tomorrow). Thanks again. |
What's about |
Released a 3.0.0 with a fix for the extensions. |
I have problems to map a folder,
babel-plugin-module-resolver
works fine, while with ESLint I can not find the way to tweakeslint-import-resolver-babel-module
and get rid of error messages.node --version
v7.2.0
"babel-eslint": "7.1.1"
"eslint": "3.12.0"
"babel-plugin-module-resolver": "^2.4.0"
.babelrc
"eslint-import-resolver-babel-module": "^2.2.1"
.eslintrc
The text was updated successfully, but these errors were encountered: