prettier
prettier copied to clipboard
Indent for pipeline operators
pipeline operator is a Stage-2 proposal
- context: https://github.com/prettier/prettier/pull/11557/files#r714007093
- ref: https://github.com/tc39/proposal-pipeline-operator
Should we add indent for pipeline?
input:
foo
|> (await %)
|> % || throw new Error(\`foo \${bar1}\`)
|> bar2(%, ", ")
|> bar3(%)
|> % + "!"
|> new Bar.Foo(%)
|> (await bar.bar(%))
|> console.log(%);
without indent(same as input):
foo
|> (await %)
|> % || throw new Error(\`foo \${bar1}\`)
|> bar2(%, ", ")
|> bar3(%)
|> % + "!"
|> new Bar.Foo(%)
|> (await bar.bar(%))
|> console.log(%);
with indent:
foo
|> (await %)
|> % || throw new Error(\`foo \${bar1}\`)
|> bar2(%, ", ")
|> bar3(%)
|> % + "!"
|> new Bar.Foo(%)
|> (await bar.bar(%))
|> console.log(%);
/cc @fisker
Looks good without indentation to me.
Missed this, I prefer add indentation.