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

Make chaining indentation configurable #35

Closed
wmertens opened this issue Jan 10, 2017 · 2 comments
Closed

Make chaining indentation configurable #35

wmertens opened this issue Jan 10, 2017 · 2 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@wmertens
Copy link

I always thought that indenting chained functions was problematic, since as far as the parser is concerned, there is no block until it encounters the ..

That's why I prefer

fn()
.then(foo => bar())
.finally(cleanup)

indenting would mean this code style:

fn().
  then(foo => bar()).
  finally(cleanup)

...which is of course terrible because the . is easy to miss at the end of the line and you need to manage it when moving lines around.

Hence: please make chaining indentation configurable.

@jlongster
Copy link
Member

I'm not sure what you mean. I haven't run into any problems with this style:

fn()
  .then(foo => bar())
  .finally(x => x);

Which is close to your original example, which is what you are saying you want? JS parsers should have no problem with this.

@wmertens
Copy link
Author

Myeah, I suppose that this is a very minor request, certainly if you want to keep the number of options small. Closing.

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants