Merge pull request #4419 from erik-krogh/jsxFactory

Approved by asgerf
This commit is contained in:
CodeQL CI
2020-10-06 06:13:21 -07:00
committed by GitHub
3 changed files with 21 additions and 0 deletions

View File

@@ -58,6 +58,16 @@ predicate isReactForJSX(UnusedLocal v) {
plugin.getJsxFactoryVariableName() = v.getName()
)
)
or
exists(JSONObject tsconfig |
tsconfig.isTopLevel() and tsconfig.getFile().getBaseName() = "tsconfig.json"
|
v.getName() =
tsconfig
.getPropValue("compilerOptions")
.(JSONObject)
.getPropStringValue(["jsxFactory", "jsxFragmentFactory"])
)
)
}

View File

@@ -0,0 +1,6 @@
{
"compilerOptions": {
"jsx": "react",
"jsxFactory": "m"
}
}

View File

@@ -0,0 +1,5 @@
import {m} from 'some-react-library';
export default function doAThing() {
return <span>foo</span>;
}