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

@@ -71,6 +71,10 @@ predicate isReactImportForJSX(UnusedLocal v) {
)
|
v.getADeclaration() = any(ImportDeclaration imp).getASpecifier().getLocal()
or
exists(VariableDeclarator vd | vd.getBindingPattern() = v.getADeclaration() |
vd.getInit() instanceof Require
)
)
}