Brian Cragun
Brian Cragun

Reputation: 780

How can I reset or change rules for SonarLint in VSCode?

Using SonarLint in VSCode, I disabled certain rules to get a local java program to run. However when checked in to the GIT project, the CI build failed. How can I turn the SonarLint rules back on so I can get the benefit of the linting again?

Upvotes: 8

Views: 6269

Answers (1)

Brian Cragun
Brian Cragun

Reputation: 780

Open View > Command Palette... (Mac: Cmd+Shift+P)

Select Preferences: Open Settings (JSON)

In the settings.json file, the disabled SonarLint rules are listed:

"sonarlint.rules": {
    "java:S2095": {
        "level": "off"
    },
    "java:S1192": {
        "level": "off"
    }
}

Delete the rules you wish to reactivate, save the settings

Upvotes: 14

Related Questions