Adds JSXFragment to plugin-transform-typescript check for the presence of jsx (#7996)

This commit is contained in:
Miguel Albernaz
2018-06-12 14:17:25 -03:00
committed by Henry Zhu
parent 0b25e3327c
commit 6d5392554f
4 changed files with 12 additions and 0 deletions

View File

@@ -291,6 +291,9 @@ export default declare((api, { jsxPragma = "React" }) => {
JSXElement() {
sourceFileHasJsx = true;
},
JSXFragment() {
sourceFileHasJsx = true;
},
});
return !sourceFileHasJsx;
}

View File

@@ -0,0 +1,3 @@
// Don't elide React if a JSX fragment appears somewhere.
import * as React from "react";
<></>;

View File

@@ -0,0 +1,3 @@
{
"plugins": ["syntax-jsx", "transform-typescript"]
}

View File

@@ -0,0 +1,3 @@
// Don't elide React if a JSX fragment appears somewhere.
import * as React from "react";
<></>;