I have a folder in VS Code connected with a Sonarqube
On Sonarqube there are a lot of issues on my .ts files, and, on the older version of VS Code and SonaLint, the …ts issues are show on my Problems view.
Don’t remember my old versions, but since I updated VS Code and SonaLint, Problem view do not show issues from .ts files anymore…
Issues from other files (like .html) are shown normally.
Could you please check the version of SonarJS installed on your SonarQube instance?
If you set the sonarlint.output.showVerboseLogs setting to true, the versions of analyzers should appear in the SonarLint output at startup, something like this:
I don’t think the problem is because there are .js and .ts files. The project do not gain new files recently and before the VS Code/ Sonarlint update, the issues from .ts files are shown. And the issues from .ts are still shown on SonarQube.
The problem could be because my SonarTS/SonarJS on SonarQube are newer than the SonarTS/SonarJS on VS Code + SonarLint?
If yes, how may I update then on VS Code + SonarLint?
Theses analysis are actually made by Sonarlint itself (based on the “Quality Profiles” downloaded from SonarQube) and not by SonarQube (via request), right?
2 - Is there a way to list the active rules (on sonarlint) after the sync with SonarQube?
(I’m suspecting that because of the difference in SonarJS/SonarTs version, some rules are being ignored by Sonarlint…)
[Info - 10:34:07.899] Analyzing file 'file:///d%3A/workspaces/workspace-fred/blive-cockpit/Cockpit/frontend/cockpit/src/models/geo.ts'...
[Info - 10:34:07.903] Index files
[Info - 10:34:07.904] 1 file indexed
[Info - 10:34:07.927] Since SonarTS v2.0, TypeScript analysis is performed by SonarJS analyzer v6.0 or later. No TypeScript analysis is performed by SonarTS.
[Info - 10:34:07.940] Found 0 issue(s)
Could you please try with both sonarlint.output.showAnalyzerLogs and sonarlint.output.showVerboseLogs?
Also, it could be useful to check the logs of the first analysis, i.e to restart or reload your Code window after updating these properties, and re-open your .ts file.
[Info - 11:12:12.844] Using storage for server 'BLLOG' (last update 3/10/20 9:41 AM)
[Info - 11:12:13.847] Analyzing file 'file:///d%3A/workspaces/workspace-fred/blive-cockpit/Cockpit/frontend/cockpit/src/models/geo.ts'...
[Info - 11:12:13.936] Index files
[Info - 11:12:13.941] 1 file indexed
[Info - 11:12:15.109] Since SonarTS v2.0, TypeScript analysis is performed by SonarJS analyzer v6.0 or later. No TypeScript analysis is performed by SonarTS.
[Info - 11:12:19.166] Using TypeScript at: 'c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules'
[Error - 11:12:19.208] Only Node.js v8 or later is supported, got v7.10.1.
[Error - 11:12:19.209] org.sonarsource.nodejs.NodeCommandException: Only Node.js v8 or later is supported, got v7.10.1.
at org.sonarsource.nodejs.NodeCommandBuilderImpl.checkNodeCompatibility(NodeCommandBuilderImpl.java:172)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.build(NodeCommandBuilderImpl.java:144)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.initNodeCommand(EslintBridgeServerImpl.java:148)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServer(EslintBridgeServerImpl.java:106)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:168)
at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:106)
at org.sonar.plugins.javascript.eslint.TypeScriptSensor.execute(TypeScriptSensor.java:53)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:80)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:71)
at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:134)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:81)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:344)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:334)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:149)
at org.sonarsource.sonarlint.ls.AnalysisManager.lambda$analyzeConnected$7(AnalysisManager.java:336)
at org.sonarsource.sonarlint.ls.AnalysisManager.analyzeWithTiming(AnalysisManager.java:352)
at org.sonarsource.sonarlint.ls.AnalysisManager.analyzeConnected(AnalysisManager.java:336)
at org.sonarsource.sonarlint.ls.AnalysisManager.analyze(AnalysisManager.java:243)
at org.sonarsource.sonarlint.ls.AnalysisManager.lambda$analyzeAsync$0(AnalysisManager.java:205)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[Info - 11:12:19.218] Found 0 issue(s)
Seems like the problem is my old Nodes version (needed for another specific project…).
I Installed the version 8 and… it worked…
[Info - 11:19:05.298] Using storage for server 'BLLOG' (last update 3/10/20 9:41 AM)
[Info - 11:19:07.058] Analyzing file 'file:///d%3A/workspaces/workspace-fred/blive-cockpit/Cockpit/frontend/cockpit/src/models/geo.ts'...
[Info - 11:19:07.170] Index files
[Info - 11:19:07.178] 1 file indexed
[Info - 11:19:08.503] Since SonarTS v2.0, TypeScript analysis is performed by SonarJS analyzer v6.0 or later. No TypeScript analysis is performed by SonarTS.
[Info - 11:19:14.942] Using TypeScript at: 'c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules'
[Info - 11:19:17.164] Found 1 tsconfig.json file(s): [d:\workspaces\workspace-fred\blive-cockpit\Cockpit\frontend\cockpit\tsconfig.json]
[Info - 11:19:17.319] 1 source files to be analyzed
[Info - 11:19:17.320] Analyzing 1 files using tsconfig: d:\workspaces\workspace-fred\blive-cockpit\Cockpit\frontend\cockpit\tsconfig.json
[Warn - 11:19:17.333] You are using version of TypeScript 3.8.3 which is not officially supported; supported versions >=3.2.1 <3.8.0
[Info - 11:19:18.993] 1/1 source files have been analyzed
[Info - 11:19:19.133] Found 10 issue(s)
This kind of problem should be shown to the user in a more direct/clear way…
A frequent issue with this kind of log messages is that they can quickly become invasive and noisy, which kind of defeats their purpose as troubleshooting tools. And here, I agree that we could provide a more actionable feedback to end users - ticket created!