Files
codeql/javascript/ql/test/library-tests/frameworks/ReactJS/ReactName.qll
Erik Krogh Kristensen eb5dfe8438 autoformat
2020-08-17 22:46:20 +02:00

18 lines
577 B
Plaintext

import semmle.javascript.frameworks.React
query predicate test_JSXname(JSXElement element, JSXName jsxname, string name, string type) {
name = jsxname.getValue() and
(
jsxname instanceof Identifier and type = "Identifier"
or
jsxname instanceof ThisExpr and type = "thisExpr"
or
jsxname.(DotExpr).getBase() instanceof JSXName and type = "dot"
or
jsxname instanceof JSXQualifiedName and type = "qualifiedName"
) and
element.getNameExpr() = jsxname
}
query ThisExpr test_JSXName_this(JSXElement element) { result.getParentExpr+() = element }