Qowaiv / qowaiv-analyzers

Roslyn Analyzers
MIT License
1 stars 1 forks source link

Define global using statements in single file #41

Closed Corniel closed 2 months ago

Corniel commented 2 months ago

Defining using statements globally is wonderful way of reducing using statements in code files. To keep things maintainable, however, all global using statements should be defined in a single file. This rule prefers "Properties/GlobalUsings.cs".

The reason for this location is, that Visual Studio (and other IDE's for C#) show the Properties folder differently than other directories, and it are, that you could argue that it are properties from a compiler perspective.

Configuration

If desired, another location can be configured:

dotnet_diagnostic.QW0015.GlobalUsingsFile = Usings.cs