JS: test case for transform-react-jsx plugin

This commit is contained in:
Asger F
2018-10-26 12:06:18 +01:00
parent fa55e31f7a
commit d7eb4ef40e
4 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{
"plugins": [
["transform-react-jsx", { "pragma": "h" }]
]
}

View File

@@ -0,0 +1,4 @@
import { h } from 'preact'; // OK - JSX element uses 'h' after babel compilation
import { q } from 'preact'; // NOT OK - not used
export default (<div>Hello</div>);

View File

@@ -1,6 +1,9 @@
| Babelrc/importPragma.jsx:1:1:1:27 | import ... react'; | Unused import h. |
| Babelrc/importPragma.jsx:2:1:2:27 | import ... react'; | Unused import q. |
| decorated.ts:1:1:1:126 | import ... where'; | Unused import actionHandler. |
| decorated.ts:4:10:4:12 | fun | Unused function fun. |
| externs.js:6:5:6:13 | iAmUnused | Unused variable iAmUnused. |
| 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. |
| typeoftype.ts:9:7:9:7 | y | Unused variable y. |

View File

@@ -0,0 +1,3 @@
import { h } from 'preact'; // NOT OK - not in scope of .babelrc file
export default (<div>Hello</div>);