question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Indent with multiline arguments in a chain

See original GitHub issue

The 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:closed
  • Created 8 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
ilyavolodincommented, Aug 25, 2016

@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.

5reactions
ilyavolodincommented, Aug 26, 2016

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found