Editorconfig Guide.e

Prefer static local function

EditorConfig key: csharp-prefer-static-local-function

Prefer static local function

csharp-prefer-static-local-function

This option controls whether local functions that do not capture any enclosing state should be marked static.

Default value:

true

Possible values:

  • true
  • false

Examples

true
void Main()
{
  static void LocalFunc() { }
}
false
void Main()
{
  void LocalFunc() { }
}