tleunen / eslint-import-resolver-babel-module

Custom eslint resolve for babel-plugin-module-resolver
https://github.com/tleunen/babel-plugin-module-resolver
MIT License
248 stars 31 forks source link

Add support for passing `babelOptions` to `OptionsManager#init` #113

Closed TuckerWhitehouse closed 3 years ago

TuckerWhitehouse commented 3 years ago

Taking the minimal approach to option 4 here https://github.com/tleunen/eslint-import-resolver-babel-module/issues/89#issuecomment-541482240

My specific use case is to support passing rootMode: 'upward-optional'.

tleunen commented 3 years ago

Thank you @TuckerWhitehouse. I always appreciate contributions :) It seems there are very small linting issues, but otherwise the changes look ok. I'm not always happy with adding new options, but if it helps some users, why not. But I wonder if that could be taken from the babel config instead of having to redefine something here? Or maybe I don't fully understand the usecase here

TuckerWhitehouse commented 3 years ago

Hey @tleunen - So by default, babel will the current working directory as the root, but this setting instructs babel to search upward for a babel.config.js file which is useful in monorepos. The babel docs probably do a better job explaining it than I can :D https://babeljs.io/docs/en/options#rootmode

codecov[bot] commented 3 years ago

Codecov Report

Merging #113 into master will increase coverage by 0.09%. The diff coverage is 100.00%.

Impacted Files Coverage Δ
src/index.js 94.73% <100.00%> (+0.09%) :arrow_up:
tleunen commented 3 years ago

All good, thank you @TuckerWhitehouse :)

jcole356 commented 3 years ago

Looks like this has not been released? Any plans for a new release with this change?

tleunen commented 3 years ago

Oh I thought I had did one. Sorry. Will do now