How can I set up in StyleCop rules that all private fields must begin with underscore _
?
In your StyleCop install, there's a Settings. StyleCop file. You can edit this to turn off rules globally. Drag that file onto the Settings Editor executable in that file to edit it.
stylecop.jsonCode analysis rule sets are the standard way to configure most diagnostic analyzers within Visual Studio. Information about creating and customizing these files can be found in the Using Rule Sets to Group Code Analysis Rules documentation on docs.microsoft.com.
You could take a look at StyleCop+ with its flexible naming rules. It is open-source, so you could also use it for writing your own custom rules.
P.S. A similar question: Find out if CsElement is a static field? (StyleCop custom rule)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With