Skip to content

Do not load root .babelrc#61

Merged
kentcdodds merged 3 commits into
kentcdodds:masterfrom
ykzts:do-not-load-root-babelrc
Sep 12, 2018
Merged

Do not load root .babelrc#61
kentcdodds merged 3 commits into
kentcdodds:masterfrom
ykzts:do-not-load-root-babelrc

Conversation

@ykzts

@ykzts ykzts commented Sep 11, 2018

Copy link
Copy Markdown
Contributor

What: Do not load root .babelrc and babel.config.js in the run of transformFromAST in Babel v7.

Why: Without this change the Babel plugin will be loaded twice. (ref babel/babel#7911)

How: Set babelrc: false and configFile: false.

@ykzts

ykzts commented Sep 11, 2018

Copy link
Copy Markdown
Contributor Author

Jest: "global" coverage threshold for branches (100%) not met: 98.15%

🤔

@kentcdodds

Copy link
Copy Markdown
Owner

Thanks @ykzts! What if we didn't add the conditional logic and just made this code apply for any version of babel?

The reason that the code coverage isn't getting to 100% is because there's no test that runs both the Babel 6 and Babel 7 version of this code. I'm thinking that if we can just remove the condition and apply this to both then the code will be simpler and we wont have the coverage issue.

@ykzts

ykzts commented Sep 11, 2018

Copy link
Copy Markdown
Contributor Author

Babel v6 can not specify configFile in config, resulting in validation error. Therefore, conditional branching by version is necessary.

@ykzts

ykzts commented Sep 12, 2018

Copy link
Copy Markdown
Contributor Author

@kentcdodds nice!

@kentcdodds
kentcdodds merged commit a3cd086 into kentcdodds:master Sep 12, 2018
@kentcdodds

Copy link
Copy Markdown
Owner

Thanks for the ping @ykzts! I thought I'd merged this 😅

@ykzts
ykzts deleted the do-not-load-root-babelrc branch September 12, 2018 08:55
@kentcdodds

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 3.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants