Skip to content
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

Expose the resolve function to other plugins #233

Closed
arcanis opened this issue Mar 26, 2016 · 6 comments · Fixed by #408
Closed

Expose the resolve function to other plugins #233

arcanis opened this issue Mar 26, 2016 · 6 comments · Fixed by #408
Milestone

Comments

@arcanis
Copy link
Contributor

arcanis commented Mar 26, 2016

Hi,

I'm writing an eslint plugin that should check a few things with the modules, and I feel like it would be interesting to use the eslint-plugin-import resolver instead of rolling my own (especially since I use eslint-plugin-import too). I could copy/paste your code, but I feel like it would be much better to simply use the "standard implementation" right at the source (it would allow me to have a perfect compatibility with your module as far as the configuration goes). It would be as simple as this:

var resolve = require('eslint-plugin-import').resolve;

module.exports = function (context) {
    resolve('some-module', context);
};

Would you mind consider exposing the resolve function to the world?

(Worth noting that I have seen that the resolvers are available as standalone packages - my point is mainly about exposing the eslint configuration parser rather than the resolvers themselves)

@arcanis arcanis changed the title Expose the resolver Expose the resolve function to other plugins Mar 26, 2016
@benmosher
Copy link
Member

Ah, neat! Yeah, I would be up for packaging it separately. I'll take a look tomorrow.

I can imagine basically breaking the whole core folder out into a package.

Is Node 0.x support important to you? Or is Node 4+ okay?

@arcanis
Copy link
Contributor Author

arcanis commented Mar 27, 2016

Node 4+ is fine ! 😄

@benmosher benmosher mentioned this issue Mar 28, 2016
9 tasks
@benmosher
Copy link
Member

Published v0.1.0 of eslint-module-utils to npm this morning. Can't guarantee the signatures and I haven't migrated the tests yet, but the fundamental functionality should remain fairly constant.

I'm going to try to prove it out and document everything over the next week or two. Let me know how it goes leveraging it for what you're doing.

I think I am going to pull some of the traversals out as well, like the stuff from no-unresolved that finds ES, CommonJS, and AMD module references and maybe the stuff that walks namespace MemberExpressions. So BOLO. 😄

@benmosher
Copy link
Member

FYI: planning to roll back some things and support Node 0.10 and 0.12 until ESLint doesn't.

@arcanis
Copy link
Contributor Author

arcanis commented Apr 13, 2016

Thanks for the heads up !

@benmosher benmosher added this to the 2.0.0 milestone Jul 1, 2016
@benmosher benmosher mentioned this issue Jul 2, 2016
4 tasks
@benmosher
Copy link
Member

Well, never got around to making it support 0.10 and 0.12, so moving forward with it as-is. Watch #408 for progress!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants