Configuring SonarLint in VSCode

hello,

What are the steps to integrate sonarlint in VScode?

Hello, thanks for asking! (I took the liberty to move your help request to a separate post in the appropriate category and remove the duplicate post).

The first step is to install the extension. The easiest way is to use VSCode’s built-in “Extensions” view:

  1. Click on the “Extensions” icon
  2. In the input box on the top, enter “sonarlint”
  3. Click the “Install” button

01-sonarlint-install

:warning: If this doesn’t work, you can also install SonarLint’s manually using the VSIX file

Once SonarLint is installed, you should see:

  1. A new pane in the “Explorer” view, titled “SonarLint Rules”, listing all rules that are available out-of-the-box
  2. Issues underlined in your source code for selected languages: JavaScript, TypeScript, Python, PHP, Java and HTML
  3. Problems with the sonarlint(rule:id) tag in the problems view

You will also notice a new “SonarLint” category in the “Settings”, with a short description of how each property affects SonarLint’s behavior:

I hope this helps with the very first steps.

Please feel free to ask if you need further assistance on specific topics :slight_smile:

3 Likes

hey can u share the steps for visual studio as well?

also, can u pls mention the minimum version of various IDE’s like eclipse,vscode and visual studio for which sonarlint will be supported?
Many thanks

The current situation (mid-June 2020) on supported IDE versions is:

  • Eclipse Photon and above
  • Visual Studio 2015, 2017 and 2019
  • VSCode 1.37 and above
  • IntelliJ 2018.3 and above

I don’t have Visual Studio installed on my box right now, but I believe the installation experience is quite similar.

Additionally, the wiki has some documentation on how to configure SonarLint for Visual Studio.

Hey,
am not sure why sonarlint is not showing the issues.

it should through the catch block non complaint sonarlint issue

Hello, it looks like your code has a syntax error at line 10. SonarLint’s Java analyzer won’t report issues on files it cannot parse.

1 Like

A post was split to a new topic: How to integrate custom Apex rules (PMD)

Hi @padma_priyakantipaka,
Did you manage to visualize the Sonarlist alerts in the VSCode? I just started that adventure and I’m in the same problem, if you share me your results please.

@ j4v13r

Please do not bump 1-year-old topics, especially when you already opened a new topic.