Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tall style: Indent ternary operands beneath the operator #1534

Open
nex3 opened this issue Aug 16, 2024 · 1 comment
Open

Tall style: Indent ternary operands beneath the operator #1534

nex3 opened this issue Aug 16, 2024 · 1 comment

Comments

@nex3
Copy link
Member

nex3 commented Aug 16, 2024

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.

@munificent
Copy link
Member

Yeah, I agree this doesn't look great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants