How to prevent adding .editorconfig to one solution leading to StyleCop rules getting applied to every solution?

420 views Asked by At

Say I have the following folder structure:

Root -> dir A -> dir B -> sln B
              -> dir C -> sln C
     -> sln A

There's stylecop.json present for all the solutions.

{
  "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
  "settings": {
    "documentationRules": {
      "companyName": "X",
      "copyrightText": "X"
    }
  }
}

But there's no .editorconfig file and the SA rules are not applied to the solutions (not sure if it's expected). Now, the moment I create a .editorconfig file for sln C, the SA rules start getting applied to A, B, C all solutions. How do we configure it to apply for a single solution only?

1

There are 1 answers

0
Satashree Roy On

[Update]: It's working. There was a .editorconfig in root directory which probably messed it up. I am unable to think of any other reason.