Skip to content

Issues with quick fix for sort_constructors_first lint rule #60703

@gryznar

Description

@gryznar

1. Spacing

class Foo {
  final String foo;

  const Foo({required this.foo});
}

after applying quick fix:

class Foo {

  const Foo({required this.foo});
  final String foo;
}

expected:

class Foo {
  const Foo({required this.foo});

  final String foo;
}
  • no blank space between signature and constructor
  • space between constructor and field?

2. Enum:

enum Foo {
  bar('Open'),
  baz('Accepted Provisionally'),

  final String value;

  const Foo(this.value);
}

after applying nothing happens despite analyzer properly emits warning. Expected:

enum Foo {
  bar('Open'),
  baz('Accepted Provisionally'),

  const Foo(this.value);

  final String value;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions