Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

first-party support for babel plugins? #1

Open
benmosher opened this issue Jun 27, 2016 · 2 comments
Open

first-party support for babel plugins? #1

benmosher opened this issue Jun 27, 2016 · 2 comments

Comments

@benmosher
Copy link

I've been thinking about attempting to support Babel plugins as first-class citizens in eslint-plugin-import.

Basically, the idea would be to allow explicit configuration of a list of Babel plugins that would be run against import+export declarations.

As cool as it is to see these Babel plugin resolvers pop up, it seems like a lot of work, and while it's possible to configure multiple resolvers, you can't actually chain them. The first one to find a file wins.

What do you think? I looked through the code of babel-root-import and I think it would be pretty straightforward. I don't mean to crash your project, for sure. Just curious if you think this would make sense, as a community resolver maintainer.

Thanks! 😎

@olalonde
Copy link
Owner

olalonde commented Jun 29, 2016

Oh sure... I just wrote this to scratch my own itch, I'd be more than happy to RIP this project if a better solution comes along :) Having to re-write resolvers for all possible plugins certainly isn't very DRY.

This resolver actually falls back on the node resolver as a last step: https://github.com/olalonde/eslint-import-resolver-babel-root-import/blob/master/src/index.js#L80

But it's "hard coded" that way and this kind of fallback probably shouldn't be the responsibility of individual resolvers.

@olalonde
Copy link
Owner

@benmosher any update on this?

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

No branches or pull requests

2 participants