Disable SonarLint for some file extensions in VS Code

Hi !
I’ve searched (I believe) pretty thoroughly for a way to disable SonarLint on some file extensions … but without any success. I found a few threads here asking someting similar … but then the answers were ansering an other (root) problem … and closed

Thing is I use drawio in VS Code alongside other (coding) files. Problem is SonarLint treats those .drawio files as text and detects some “OVH Key” that should be revoked … in the base64 encoding (I suppose, I’m no expert in drawio format … I really only use it in visual edition mode) … But like a lot (100-300 / file )
It’d be really nice to have a way to ignore those **.drawio files …

It’s kind of annoying always having 1K+ problems … and also is pretty much defying the whole purpose of the thing … with that many … all related to that “stupid” problem … I don’t even get to notice if for some reason a new (legitimate) error/warning appears somewhere else.

I hope my problem is clear enough … feel free to ask otherwise !

PS : I noticed same behaviour on a .dotx file (> 600 warnings) …

Hello :wave: welcome to the community! And thanks for reporting this behavior.

By default, the “Text and Secrets” analyzer will run on any file, which can lead to this kind of false positive; you should be able to use the sonarlint.analysisExcludesStandalone configuration property to exclude files that should not be analyzed, e.g. in your user or folder settings:

{
  "sonarlint.analysisExcludesStandalone": "**/*.drawio"
}
1 Like

Damn I can’t understand how I did not come accross that after all the research !
Thanks a lot !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.