SonarLint not scanning typescript files

  • Operating system: MacOS
  • SonarLint plugin version: latest 10.9.0.79423
  • IntelliJ version: latest 2024.2.2 (same problem on webstorm 2024.2.1)
  • Programming language you’re coding in: typescript
  • Is connected mode used: doesn’t work either way

Hi,
My typescript files are being ignored by the SonarLint plugin.
In the rules, I don’t see any Typescript anymore either.

I don’t see any error in the SonarLint logs.
I tried restarting the OS, the IDE, and reinstalling the pluging without success

Hi @hqrd,

and thanks for reaching out. As per our requirements of SonarLint the analysis for JavaScript / TypeScript and CSS is only available when a Node.js installation is configured for SonarLint.

Did you make sure to configure it in the SonarLint Settings? The logs will also give you a hint when a Node.js installation was not automatically found and that in that case the analysis of JavaScript / TypeScript and CSS is not available.

Best,
Tobias

Thanks for the quick response, I have indeed a Node.js path setup, which was working previously.

image

But in the log, I still get :

 [2024-09-19T11:03:15.606] [SonarLint Server RPC request executor] WARN sonarlint - Node.js could not be automatically detected, has to be configured manually in the SonarLint preferences!
 [2024-09-19T11:03:15.606] [SonarLint Server RPC request executor] WARN sonarlint - Automatic detection does not work on macOS when added to PATH from user shell configuration (e.g. Bash)

When you configured the Node.js path and restarted the IDE, did you still get the information in the logs and did the analysis still not work?

Otherwise I will check with my colleagues regarding the Node.js requirements, maybe something has changed regarding which versions (including minor versions) are supported or not.

After another restart, it started working again.

But before that, even with the correct path, I did not see the TypeScript rules. Maybe changing the path without a restart doesn’t refresh the rules ?

Hey @hqrd, you are right. Changing the Node.JS path does not take effect until restarting. This is a known limitation on our side, and we are already tracking it via this ticket.

1 Like