How to configure SonarLint with VS Code?
2 min readFeb 23, 2021
This article will guide you through the steps required to setup SonarLint in your VS Code. If you want to configure SonarLint with IntelliJ IDEA you can visit here.
Install the SonarLint from marketplace on your VS Code.
- Go to File > Preferences > Extensions or just type the shortcut ctrl + shift + X and type “SonarLint” in the search and click install.
Configure SonarLint for analysis and connected mode.
- Go to File > Preferences > Settings under Users tab go to extensions and then expand SonarLint.
- click on “Edit in settings.json” and enter this object in the file to make a connection to your SonarQube server. Connection Id is used to identify a unique connection from a sonarqube server in case of multiple connections.
"sonarlint.connectedMode.connections.sonarqube": [
{
"connectionId": "<any-connection-id>",
"serverUrl": "<sonarqube-server-url>",
"token": "<userToken-from-sonarqube-server>",
"disableNotifications": true
}
],
"sonarlint.connectedMode.project": {
"connectionId": "<any-connection-id>",
"projectKey": "<project-key-from-sonarqube-server>"
}
- Post successful connection, SonarLint will start the analysis and all the problems can be found on the problems window (ctrl + shift + M) or go to View > Problems.
Happy Coding !!!