Files
low-code-react-app-b/codeql/custom-queries/queries/ComponentFilesWithJSX.ql
2026-01-19 09:23:22 +00:00

18 lines
479 B
Plaintext

/**
* @name Component files with JSX
* @description Lists component TSX files that contain JSX (candidate for JSON conversion).
* @kind problem
* @severity warning
* @id custom/component-files-with-jsx
*/
import javascript
import semmle.javascript.JSX
predicate isComponentFile(File f) {
f.getRelativePath().regexpMatch("^(src/)?components/.*\\.tsx$")
}
from JsxElement jsx, File f
where f = jsx.getFile() and isComponentFile(f)
select f, "Component file contains JSX"