github / codeql-action

Actions for running CodeQL analysis
MIT License
1.15k stars 318 forks source link

Maybe false warning for js file #1622

Closed AnnAngela closed 1 year ago

AnnAngela commented 1 year ago

The codeql report an error: image

Could not process some files due to syntax errors

A parse error occurred: Unexpected token. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.

And left a link to my file https://github.com/MoegirlPediaInterfaceAdmins/MoegirlPediaInterfaceCodes/blob/master/src/gadgets/wikiplus-highlight/MediaWiki:Gadget-wikiplus-highlight.js#L828, but there is nothing invalid. How can I remove that warning?

aeisenberg commented 1 year ago

Thanks for posting. I will ask the team who supports the javascript queries for advice.

aeisenberg commented 1 year ago

A fix is in the works.

AnnAngela commented 1 year ago

@aeisenberg Thx a lot!

jaymevillafranca commented 1 year ago

We're experiencing a similar issue in several repositories containing js. Despite using the default CodeQL configuration on all repos, only some of them are reporting errors.

Error messages:

image

aeisenberg commented 1 year ago

It looks like you are using comments in your JSON files. This is not technically legal, even though some JSON parsers allow that. Your best bet is to explicitly exclude all of the JSON files with a paths-ignore property.

asgerf commented 1 year ago

@AnnAngela I'm closing this issue as I believe the issue has been fixed as of https://github.com/github/codeql/pull/12759.

AnnAngela commented 1 year ago

@AnnAngela I'm closing this issue as I believe the issue has been fixed as of https://github.com/github/codeql/pull/12759.

Thx a lot, I will monitor my workflow for it.