diff --git a/docs/plugin-transform-typescript.md b/docs/plugin-transform-typescript.md index 042d75f7ad..b891eee670 100644 --- a/docs/plugin-transform-typescript.md +++ b/docs/plugin-transform-typescript.md @@ -130,6 +130,10 @@ Replace the function used when compiling JSX fragment expressions. This is so th `boolean`, defaults to `false` +:::caution Pending defaults change +The default value will be `true` in Babel 9.0. +::: + Added in: `v7.9.0` When set to `true`, the transform will only remove [type-only imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-exports) (introduced in TypeScript 3.8). This should only be used if you are using TypeScript >= 3.8. diff --git a/docs/preset-typescript.md b/docs/preset-typescript.md index 5aeae9fa9b..b168e5d06e 100644 --- a/docs/preset-typescript.md +++ b/docs/preset-typescript.md @@ -131,9 +131,17 @@ When it is set to `true`, Babel will provide a general TS plugin. If you want to ### `onlyRemoveTypeImports` -`boolean`, defaults to `false` +`boolean`, defaults to `true` + +
+ History + +| Version | Changes | +| --- | --- | +| `v7.9.0` | Added `onlyRemoveTypeImports`, defaults to `false` | +| `v8.0.0` | defaults to `true` | -Added in: `v7.9.0` +
When set to `true`, the transform will only remove [type-only imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-exports) (introduced in TypeScript 3.8). This should only be used if you are using TypeScript >= 3.8. diff --git a/docs/v8-migration.md b/docs/v8-migration.md index 66f001f8ce..55dcf2a7ed 100644 --- a/docs/v8-migration.md +++ b/docs/v8-migration.md @@ -574,6 +574,10 @@ Make sure to also check the [@babel/plugin-transform-typescript](#babel-plugin-t **Migration**: The preset will also report invalid option names. Refer to the [docs](./preset-typescript.md#options) and ensure valid usage. For example, `runtime` is not a valid `preset-typescript` option and thus should be removed. +- `onlyRemoveTypeImports` defaults to `true` ([#12460](https://github.com/babel/babel/pull/12460)) + + **Migration**: If you use TypeScript < 3.8 or don't have `verbatimModuleSyntax` set to `true` in your TSConfig, specify `onlyRemoveTypeImports: false`. + ### `@babel/plugin-transform-typescript` {#babel-plugin-transform-typescript} ![high](https://img.shields.io/badge/risk%20of%20breakage%3F-high-red.svg)