@babel/plugin-transform-typescript
Advanced tools
Comparing version 7.4.0 to 7.4.4
@@ -56,2 +56,3 @@ "use strict"; | ||
const PARSED_PARAMS = new WeakSet(); | ||
const PRAGMA_KEY = "@babel/plugin-transform-typescript/jsxPragma"; | ||
@@ -82,3 +83,3 @@ var _default = (0, _helperPluginUtils().declare)((api, { | ||
if (jsxMatches) { | ||
jsxPragma = jsxMatches[1]; | ||
file.set(PRAGMA_KEY, jsxMatches[1]); | ||
} | ||
@@ -100,3 +101,3 @@ } | ||
if (binding && isImportTypeOnly(binding, state.programPath)) { | ||
if (binding && isImportTypeOnly(file, binding, state.programPath)) { | ||
importsToRemove.push(binding.path); | ||
@@ -319,3 +320,3 @@ } else { | ||
function isImportTypeOnly(binding, programPath) { | ||
function isImportTypeOnly(file, binding, programPath) { | ||
for (const path of binding.referencePaths) { | ||
@@ -327,3 +328,5 @@ if (!isInType(path)) { | ||
if (binding.identifier.name !== jsxPragma) { | ||
const fileJsxPragma = file.get(PRAGMA_KEY) || jsxPragma; | ||
if (binding.identifier.name !== fileJsxPragma) { | ||
return true; | ||
@@ -330,0 +333,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-typescript", | ||
"version": "7.4.0", | ||
"version": "7.4.4", | ||
"description": "Transform TypeScript into ES.next", | ||
@@ -23,6 +23,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", | ||
"devDependencies": { | ||
"@babel/core": "^7.4.0", | ||
"@babel/core": "^7.4.4", | ||
"@babel/helper-plugin-test-runner": "^7.0.0" | ||
}, | ||
"gitHead": "f1328fb913b5a93d54dfc6e3728b1f56c8f4a804" | ||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba" | ||
} |
16642
473