When I generate a new class, I would like to have the default access modifier written down explicitly like:
internal class Foo
{
}
instead of:
class Foo
{
}
Is that possible with a setting and if so - how?
Two things you can do:
Modify the class file template. This is found in you VS installation:
<InstallRoot>\<Edition>\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class
To confirm something has been specified: add the following to a .editorconfig:
dotnet_style_require_accessibility_modifiers=always:suggestion
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