mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
detect uses of jsxFactory and jsxFragmentFactory in js/unused-local-variable
This commit is contained in:
@@ -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"])
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user