Skip to content

New Formatter not formatting nicely after comments #1765

@atreeon

Description

@atreeon

What input code did you provide to the formatter?

    final isValid = //
        context.select((ProjectEditBloc bloc) => (bloc.state as ProjectEditState_data).isValid);

What output did the formatter produce?

    final isValid = //
    context.select(
      (ProjectEditBloc bloc) => (bloc.state as ProjectEditState_data).isValid,
    );

What output did you expect or want the formatter to produce?
I have used comments to force a line break in order to improve readability. This has worked really well since almost day one of Flutter.

After a comment line, the next line should be indented.

Also, the comma has been added, even though I haven't gone over my max chars per line setting.

formatter:
  trailing_commas: preserve
  page_width: 500
    final isValid = //
        context.select((ProjectEditBloc bloc) => (bloc.state as ProjectEditState_data).isValid);

Anything else we should know?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions