Skip to content

require_trailing_commas is not triggered on switch expressions #57138

@FMorschel

Description

@FMorschel

Describe the issue
require_trailing_commas is not triggered on switch expressions.

To Reproduce

enum E {
  a,
  b,
  c,
  d,
  e,
  f;
}

int a(E e) {
  return switch (e) {
    E.a => 0,
    E.b => 1,
    E.c => 2,
    E.d => 3,
    E.e => 4,
    E.f => 5     // Should trigger
  };
}

Expected behavior
Triggering of require_trailing_commas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestlegacy-area-analyzerUse area-devexp instead.linter-false-negativeIssues related to lint rules that fail to report a problem.triage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions