JS: support require in isReactImportForJSX

This commit is contained in:
Esben Sparre Andreasen
2018-11-28 09:44:38 +01:00
parent 737a816e6f
commit 54e2215db4
5 changed files with 11 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
| importWithoutPragma.jsx:1:1:1:27 | import ... react'; | Unused import h. |
| multi-imports.js:1:1:1:29 | import ... om 'x'; | Unused imports a, b, d. |
| multi-imports.js:2:1:2:42 | import ... om 'x'; | Unused imports alphabetically, ordered. |
| require-react-3.js:1:7:1:11 | React | Unused variable React. |
| typeoftype.ts:9:7:9:7 | y | Unused variable y. |
| unusedShadowed.ts:1:1:1:26 | import ... where'; | Unused import T. |
| unusedShadowed.ts:2:1:2:31 | import ... where'; | Unused import object. |

View File

@@ -0,0 +1,2 @@
var React = require("probably-react"); // OK
(<e/>);

View File

@@ -0,0 +1,2 @@
var { React } = { React: require("probably-react") }; // OK
(<e/>);

View File

@@ -0,0 +1,2 @@
var { React } = require("probably-react"); // OK, but not yet supported
(<e/>);