Skip to content

Indent ternary operands beneath the operator #1534

@nex3

Description

@nex3

I think it's weird that the arguments for Uri.dataFromString here are indented at the same level as the function call:

void main() {
  mapInPlace(
    resultSourceMap.urls,
    (url) =>
        url == ''
            ? Uri.dataFromString(
              stylesheet.span.file.getText(0),
              encoding: utf8,
            ).toString()
            : importCache.sourceMapUrl(Uri.parse(url)).toString(),
  );
}

I'd prefer

void main() {
  mapInPlace(
    resultSourceMap.urls,
    (url) =>
        url == ''
            ? Uri.dataFromString(
                stylesheet.span.file.getText(0),
                encoding: utf8,
              ).toString()
            : importCache.sourceMapUrl(Uri.parse(url)).toString(),
  );
}

...which I think also better matches the way constructor initializers are indented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions