diff --git a/packages/babel-plugin-transform-typescript/src/index.js b/packages/babel-plugin-transform-typescript/src/index.js index d1fe9e8345..4803e32bc1 100644 --- a/packages/babel-plugin-transform-typescript/src/index.js +++ b/packages/babel-plugin-transform-typescript/src/index.js @@ -205,11 +205,19 @@ export default function() { }, TSImportEqualsDeclaration(path) { - throw path.buildCodeFrameError("`import =` is not supported."); + throw path.buildCodeFrameError( + "`import =` is not supported by @babel/plugin-transform-typescript\n" + + "Please consider using " + + "`import from '';` alongside " + + "Typescript's --allowSyntheticDefaultImports option.", + ); }, TSExportAssignment(path) { - throw path.buildCodeFrameError("`export =` is not supported."); + throw path.buildCodeFrameError( + "`export =` is not supported by @babel/plugin-transform-typescript\n" + + "Please consider using `export ;`.", + ); }, TSTypeAssertion(path) { diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/options.json index c29eb672a9..9ba7cc5c5f 100644 --- a/packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/options.json +++ b/packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/options.json @@ -1,3 +1,3 @@ { - "throws": "`export =` is not supported." + "throws": "`export =` is not supported by @babel/plugin-transform-typescript\nPlease consider using `export ;`." } diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/options.json index 52205fd8d3..596239c2e1 100644 --- a/packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/options.json +++ b/packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/options.json @@ -1,3 +1,3 @@ { - "throws": "`import =` is not supported." + "throws": "`import =` is not supported by @babel/plugin-transform-typescript\nPlease consider using `import from '';` alongside Typescript's --allowSyntheticDefaultImports option." }