Ignore lines of Javascript when running CodeQL

Qt have a distinct way of importing JavaScript resources from other JavaScript resources, where the syntax is:
.import "filename.js" as Qualifier

More about this syntax is found here.

The challenge with this is that it prevents CodeQL from reading our JavaScript files, as this is noted as a syntax error, with the following message:

Syntax errors prevent code from executing correctly. If a piece of code contains syntax errors, this most likely indicates that it is never run and thus is dead code that should be removed.

I have looked for any way to insert compiler directives or anything similar so that the static analysis would ignore these lines without luck.

Is there anyway to perform CodeQL analysis on JavaScript files used in Qt/QML applications where these import and pragma statements are present?