mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
JS: test case for transform-react-jsx plugin
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
["transform-react-jsx", { "pragma": "h" }]
|
||||
]
|
||||
}
|
||||
@@ -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>);
|
||||
@@ -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. |
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import { h } from 'preact'; // NOT OK - not in scope of .babelrc file
|
||||
|
||||
export default (<div>Hello</div>);
|
||||
Reference in New Issue
Block a user