How to scan JS files which are not being compiled with Maven

You cannot use a sonar-project.properties file with the Scanner for Maven.

src/main/java is a default value – you will need to adjust sonar.sources to include other directories.

And an example was shown in the very first reply to this thread: