Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Mar 29, 2023
1 parent bd2a7aa commit fc6e4a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/babel-core/src/config/files/module-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function loadCtsDefault(filepath: string) {
onlyRemoveTypeImports: true,
optimizeConstEnums: true,
...(process.env.BABEL_8_BREAKING
? { ignoreExtension: true }
? { ignoreExtensions: true }
: { allExtensions: true, allowDeclareFields: true }),
},
],
Expand Down
15 changes: 11 additions & 4 deletions packages/babel-preset-typescript/src/normalize-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,17 @@ export default function normalizeOptions(options: Options = {}) {
false,
);
if (disallowAmbiguousJSXLike) {
v.invariant(
allExtensions,
"disallowAmbiguousJSXLike:true requires allExtensions:true",
);
if (process.env.BABEL_8_BREAKING) {
v.invariant(
ignoreExtensions,
"disallowAmbiguousJSXLike:true requires ignoreExtensions:true",
);
} else {
v.invariant(
allExtensions,
"disallowAmbiguousJSXLike:true requires allExtensions:true",
);
}
}

const optimizeConstEnums = v.validateBooleanOption(
Expand Down

0 comments on commit fc6e4a3

Please sign in to comment.