Indent with multiline arguments in a chain
See original GitHub issueThe indent
rule should take into account when a chain that starts with multiline function call.
- eslint v1.6.0
This throws a Expected indentation
error for each parameter in geocode
and the closing })
line; it wants it to be one level less:
function foo() {
return geocode({
address: 'some address'
})
.then((result) => {
return result.latlng;
});
}
Currently, this works fine:
function foo() {
return geocode({ address: 'some address' })
.then((result) => {
return result.latlng;
});
}
This may be related to https://github.com/eslint/eslint/issues/4075
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Automatic indentation of arguments list on multiple lines in ...
Under menu Tools → Options → Text editor → C/C++ → Formatting → Indentation → "Within parentheses, align new lines when I type...
Read more >PEP-8: clarify if multiline argument list with a closing `)` on a ...
When using a hanging indent the following should be considered; there should be no arguments on the first line and further indentation ......
Read more >Auto-indent lines feature wrongly indents multiline chained ...
prefetch_related( statements have the wrong indent. The gray underline appears, and the tooltip warns: "PEP8: continuation line unaligned for hanging indent".
Read more >Wrap, indent, and align refactorings - Visual Studio (Windows)
In this article. Wrap and align call chains; Wrap, indent, and align parameters or arguments; Wrap binary expressions; See also.
Read more >Function argument/parameter indentation - style - Rust Internals
From the style guide: For multiline function signatures, ... between line length and functions with many parameters (or long method chains).
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 FreeTop 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
Top GitHub Comments
@MadLittleMods It’s our policy to close issues that haven’t made any progress after 21 days. We had at some point over 300 issues open, and it’s really hard to navigate them and find things you want to work on. So this policy was created to make it easier for people to actually commit code and triage issues.
@MadLittleMods You can open another issue. We are currently focusing on JSCS compatibility milestone, so there’s still a good chance that this issue will go unaddressed for another 21 days.