CodeQL fails to detect Javascript/Typescript files

Open
#3,384 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions, typescript
Domain
ci-cd, security

Research direction

Start with the linked workflow log and compare the default and advanced CodeQL analysis behavior with the repository's .github/codeql/codeql-config.yml, especially its paths setting. Check how the analysis step handles the two TypeScript files outside the repository root; done should mean the documented or default configuration reliably finds them without requiring the workaround.

Written by the indexing model from the issue text.

Description

I was trying to get CodeQL running on the following repo:

https://github.com/jessehouwing/azure-pipelines-msbuild-helper-task/tree/a3aeaf4b459f1912ccf4706d0e0c93a16a4d5ed0

But Code QL analysis fails to find any Javascript / Typescript files. Neither in "default mode" nor in "advanced mode".

[2026-01-05 08:48:07] [build-stderr] Only found JavaScript or TypeScript files that were empty or contained syntax errors.

A workflow log can be found here:
https://github.com/jessehouwing/azure-pipelines-msbuild-helper-task/actions/runs/20710231226/job/59448894856

It is unclear from the error message and from the docs why i can't find any files, because there are 2 Typescript files in the repo, but they aren't in the root (which I suspect is causing the issue).

I managed to resolve this by adding a codeql-config.yml and specifying the paths property to include **/*.ts:

https://github.com/jessehouwing/azure-pipelines-msbuild-helper-task/blob/main/.github/codeql/codeql-config.yml

I don't see why I would have to do this. CodeQL should detect **/*.js, **/*.ts and a few other extensions by default if you'd ask me.

Either the docs should clearly specify how do solve this situation (the docs currently do not contain an entry for this specific error message). But it would be even better if the analysis step would pick a decent set of default search options when it can't find a project.json in the root of the repo.

Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.