Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Use Babel to resolve project root & aliases #1413

Merged
merged 3 commits into from
Feb 13, 2019
Merged

Conversation

suzubara
Copy link
Contributor

@suzubara suzubara commented Feb 8, 2019

  • Adds babel-plugin-module-resolver and configures the root path & sets up aliases in .babelrc
  • Adds eslint-import-resolver-babel-module so eslint can resolve aliases
  • Use alias imports in a few existing files to make sure it works
  • Fixes Use Babel to resolve project root & aliases #1424

@@ -27,4 +27,17 @@ rules:
- error
- skipUndeclared: true
settings:
import/resolver: webpack
import/resolver:
Copy link
Contributor Author

@suzubara suzubara Feb 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicating the config here seems to be a necessary evil due to tleunen/eslint-import-resolver-babel-module#95 (in order for eslint to properly resolve the modules). This is fixed on 5.0.0 of eslint-import-resolver-babel-module, but we're locked to ^4.0.0 because 5 requires Babel 7, and updating Babel feels outside the scope of this work.

@gidjin
Copy link
Contributor

gidjin commented Feb 11, 2019

Changes look good, We are going to hold off merging this until after the sprint ends to give us more time with it locally before it goes out.

Copy link
Contributor

@gidjin gidjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I resolved the conflict with the other .babelrc changes. We should update the imports as we touch them in future PRs

@gidjin gidjin merged commit 1df5533 into develop Feb 13, 2019
@ryanhofdotgov ryanhofdotgov deleted the sr-webpack-resolve-aliases branch March 13, 2019 04:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Babel to resolve project root & aliases
3 participants