olalonde / eslint-import-resolver-babel-root-import

A babel-root-import resolver for eslint-plugin-import
MIT License
23 stars 33 forks source link

first-party support for babel plugins? #1

Open benmosher opened 8 years ago

benmosher commented 8 years ago

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 commented 8 years ago

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 commented 7 years ago

@benmosher any update on this?