Sonar rules are missing in editorconfig in extension mode

Please provide

  • Operating system: Windows 11
  • Visual Studio version: Visual Studio 2022
  • SonarLint plugin version: Version: 7.4.0.80741
  • Programming language you’re coding in: C#
  • Is connected mode used: NO
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:
I installed the SonarLint Extension through the Visual Studio Marketplace.
I want to disable some of the rules but I couldn’t find them in .editorconfig file.

Hi Fatih, welcome to the community !

The editorconfig file generated by Visual Studio does not contain any third-party rules.
You can however add you own configuration to silence rules if you so wish.

For that, you need to follow the instructions from Microsoft, but here is an example.
To silence rule 1133 and 1123, you can add the following to your editorconfig file

[*.cs]
dotnet_diagnostic.S1133.severity = none
dotnet_diagnostic.S1123.severity = none

Note that you will need to edit the file as text (either by using “open with” in Visual Studio, or by opening it in a pure text editor.

You can specify multiple extensions (if your solution contains C# and VB code, for example):

[*.{cs,vb}]

I hope this answers your question. Do not hesitate to elaborate if that does not cover your issue.

Denis