leading chained method does not indent
See original GitHub issueconst create = (
queue: AWS.SQS,
queueSettings: AWS.SQS.ReceiveMessageRequest,
): Most.Stream<Job> =>
Most.periodic(secondsToMilliseconds(queueSettings.WaitTimeSeconds))
.map(() => pull(queue, queueSettings))
.await()
.concatMap(({ Messages }: AWS.SQS.ReceiveMessageResult) =>
Most.from(Messages.map(parseMessage).map(createJob)),
)
.multicast()
Would read better as:
const create = (
queue: AWS.SQS,
queueSettings: AWS.SQS.ReceiveMessageRequest,
): Most.Stream<Job> =>
Most
.periodic(secondsToMilliseconds(queueSettings.WaitTimeSeconds))
.map(() => pull(queue, queueSettings))
.await()
.concatMap(({ Messages }: AWS.SQS.ReceiveMessageResult) =>
Most.from(Messages.map(parseMessage).map(createJob)),
)
.multicast()
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Wrong indentation after chained methods #66816 - GitHub
For this particular issue, if the indentation rules are leading to more trouble than having no auto indent, you can set editor.autoIndent to ......
Read more >c# - Indent chained method calls so they all start at the same ...
In ReSharper, under Code Editing -> C# -> Formatting Style -> Tabs, Indents, Alignment -> Align multiline constructs, check the Chained ...
Read more >Auto-indent lines feature wrongly indents multiline chained ...
Auto -indent lines feature wrongly indents multiline chained method calls ; Relates to 1 issue (1 unresolved) · PY-33832 ; Is duplicated by...
Read more >Indent Chained Methods - Unibeautify
Indent chained method calls. Configuration option for beautifiers JS-Beautify, ESLint and languages EJS, JSX, JavaScript.
Read more >Standard rules - Ktlint
Indentation formatting - respects .editorconfig indent_size with no continuation indent (see ... Rule id: no-blank-lines-in-chained-method-calls ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Warning: Bike Sheds Ahead
^ IMHO looks great to me. It is a computational pipeline along the lines of functional composition, I don’t see anything silly here personally.
^ IMHO worse than silly this is just plain harder to read. Personally I would write this as:
Which once again captures the functional pipeline nature (and some namespace access, fine) and is easy on the eyes because incremental steps follow along a single dimension.
^ Silly because
_
is not a great identifier. Use almost anything else and its fine.F
orL
or whatever.@vjeux clear! Thanks