fix: don't elide jsx pragma import namespaces (#11523)
* fix: don't elide jsx pragma import namespaces * use the correct pragma oops
This commit is contained in:
parent
9a52019019
commit
de8264c8a7
@ -169,6 +169,11 @@ export default declare(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let pragmaImportName = fileJsxPragma || jsxPragma;
|
||||||
|
if (pragmaImportName) {
|
||||||
|
[pragmaImportName] = pragmaImportName.split(".");
|
||||||
|
}
|
||||||
|
|
||||||
// remove type imports
|
// remove type imports
|
||||||
for (let stmt of path.get("body")) {
|
for (let stmt of path.get("body")) {
|
||||||
if (t.isImportDeclaration(stmt)) {
|
if (t.isImportDeclaration(stmt)) {
|
||||||
@ -203,7 +208,7 @@ export default declare(
|
|||||||
isImportTypeOnly({
|
isImportTypeOnly({
|
||||||
binding,
|
binding,
|
||||||
programPath: path,
|
programPath: path,
|
||||||
jsxPragma: fileJsxPragma || jsxPragma,
|
jsxPragma: pragmaImportName,
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
importsToRemove.push(binding.path);
|
importsToRemove.push(binding.path);
|
||||||
|
|||||||
@ -0,0 +1,4 @@
|
|||||||
|
/* @jsx jsx.htm */
|
||||||
|
// Don't elide htm if a JSX element appears somewhere.
|
||||||
|
import * as jsx from "fake-jsx-package";
|
||||||
|
<div></div>;
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"plugins": [["transform-typescript", { "isTSX": true }]]
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
/* @jsx jsx.htm */
|
||||||
|
// Don't elide htm if a JSX element appears somewhere.
|
||||||
|
import * as jsx from "fake-jsx-package";
|
||||||
|
<div></div>;
|
||||||
Loading…
x
Reference in New Issue
Block a user