Reputation: 21440
With eslint, I can do this:
.eslintrc.js
packages/
foo/
.eslintrc.js
bar/
.eslintrc.js
Where the child .eslintrc.js
looks like this:
{
"extends": ["react-app", "../../.eslintrc.js"]
}
Can I do this with babel configuration files? I know about --root-mode=upward
, but I don't think that helps here.
Upvotes: 1
Views: 4016
Reputation: 21440
I figured it out thanks to this article: So What's New in Babel 7.
Since v7, you can add overrides to your configuration file:
//babel.config.js
module.exports = {
presets: [ ... ],
overrides: [
{
test: ["./packages/bar"],
presets: ["@babel/preset-react"],
},
],
}
Where:
Upvotes: 2