How configure SonarLint rules for C# code in VS?

503 views Asked by At

I installed SonarLint for Visual Studio 2022 and found the option to edit rule settings: Tools -> Options -> SonarLint

This creates file %appdata%\SonarLint for Visual Studio\settings.json with following content:

"sonarlint.rules": { }

How can I suppress a rule here? A sample for Java is given here but it does not work for C# and VS2022.

1

There are 1 answers

1
Jack Miller On

You can use .editorconfig to configure/suppress SonarLint rules. For example:

dotnet_diagnostic.S6602.severity = none