Editorconfig Guide.e

Readonly field

EditorConfig key: dotnet-style-readonly-field

Readonly field

dotnet-style-readonly-field

This option controls whether fields that are only assigned inline or in a constructor should be marked readonly.

Default value:

true

Possible values:

  • true
  • false

Examples

true
private readonly int f = 0;
false
private int f = 0;