diff --git a/packages/babel-helper-module-transforms/src/rewrite-live-references.ts b/packages/babel-helper-module-transforms/src/rewrite-live-references.ts index 7563fc8efffa..ca7b3e36e531 100644 --- a/packages/babel-helper-module-transforms/src/rewrite-live-references.ts +++ b/packages/babel-helper-module-transforms/src/rewrite-live-references.ts @@ -245,7 +245,7 @@ const rewriteReferencesVisitor: Visitor = { if (importData) { if (isInType(path)) { throw path.buildCodeFrameError( - `Cannot transform the imported ${localName} binding since it's used in a type annotation. ` + + `Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`, ); } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-deep/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-deep/options.json index 5488d6aa7d65..f67526e40e72 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-deep/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-deep/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-flow"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-type-cast/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-type-cast/options.json index 5488d6aa7d65..f67526e40e72 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-type-cast/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-type-cast/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-flow"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin/options.json index 5488d6aa7d65..f67526e40e72 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-flow"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-deep/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-deep/options.json index 0b34b9f7a291..343fffdf6f9c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-deep/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-deep/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-typescript"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion-legacy/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion-legacy/options.json index 0b34b9f7a291..343fffdf6f9c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion-legacy/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion-legacy/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-typescript"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion/options.json index 0b34b9f7a291..343fffdf6f9c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-type-assertion/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-typescript"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin/options.json index 0b34b9f7a291..343fffdf6f9c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin/options.json @@ -2,5 +2,5 @@ "externalHelpers": true, "sourceType": "module", "plugins": ["transform-modules-commonjs", "syntax-typescript"], - "throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." + "throws": "Cannot transform the imported binding \"A\" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." }