Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't elide jsx pragma import namespaces #11523

Merged
merged 2 commits into from May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/babel-plugin-transform-typescript/src/index.js
Expand Up @@ -169,6 +169,11 @@ export default declare(
}
}

let pragmaImportName = fileJsxPragma || jsxPragma;
if (pragmaImportName) {
[pragmaImportName] = pragmaImportName.split(".");
}

// remove type imports
for (let stmt of path.get("body")) {
if (t.isImportDeclaration(stmt)) {
Expand Down
@@ -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>;