-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom resolver path #314
Custom resolver path #314
Conversation
Hi, this is similiar to my #312 and does alot more. But it doesn't allow a project relative path which I needed (absolute paths are useless for shared projects) |
ah sorry I understand - the user can calculate the absolute path in the config and pass that. I guess its because we don't know the path of the |
@lukeapage What do you mean? See |
@lukeapage I saw your PR. I don't think it works at all, to be honest :/. On this line: https://github.com/benmosher/eslint-plugin-import/pull/312/files#diff-2bd490f6c0bd766af6e36e61189196c8R148 you check if the path is absolute(which would be for example I decided to go another way with this PR and add some more options(my requirement is to also allow local resolvers and private resolver packages). |
Ah i see how (2) works sorry, i replied first thing in the morning, must have still been asleep. Yes your pr is superior, had just missed (2). |
Sweet! I pulled requireResolver out to a function with exactly this in mind. 😁 Hadn't gotten around to it. I will look more closely when I get a chance to understand why tests are failing, |
@benmosher The problem with failing tests seems to be within this function, that doesn't return |
That must mean some test is failing to load a resolver and it's trying to report it in the catch handler. |
@benmosher It was my fault. It's fixed now, but one test still doesn't pass on Node 0.12. I can't reproduce it on my machine with Node 0.12. If you have an idea on how to fix it, i'll gladly do it. |
Agh, no worries, it's not you, it's Travis. I need to bump up the timeouts or something. I will double-check before I merge, but it's probably good to go. 😎 |
Ok, thanks! After you check this, tell me if you need me to squash it and I'll do it. |
Is there anything I can do to get this PR merged? |
+1 am waiting for a release with this in before I can use this plugin. |
Sorry, got this confused with #320 and had parked it mentally. I think it's good, would be better if it had tests but the code looks good. Can you
Also, if you could
that would be ideal as |
@benmosher done! |
…mport into custom-resolver-path
@benmosher any chance of getting this merged soon now your todo's are done? |
Yeah, should be good. I need to make another run through the changes but I think it will be good. |
if (path === undefined) return { found: false } | ||
return { found: true, path } | ||
if (path === undefined) return { found: false, path: null } | ||
return { found: true, path: null } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@le0nik what motivated this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As i remember, it was due to this failing test after merge of master
.
Ah, i see what you mean. My mistake. The test affected just the line above, not this one. I shouldn't have changed this.
With this PR users will be able to require resolvers:
/Volumes/...
, user can include them as computed property in.eslintrc.js
config)./eslint-plugins/webpack-resolver
)@myorg/webpack-resolver
)webpack
->eslint-import-resolver-webpack
)