Skip to content

Unintentional difference in promise-style indentation #326

Description

@rstacruz

Placing .then in a.then(b) in the same indent level of a produces different results in jashkenas/coffee-script vs redux.

$.get('/notifications')
.then ->
  $.post('/notifications/read')
.then (result) ->
  alert result

jashkenas/coffee-script:

$.get('/users').then(function(data) {
  return $.post('/users', data);
}).then(function(result) {
  return alert(result);
});

Redux:

Syntax error on line 4, column 0: unexpected '.' (\u002E)
1 : $.get('/users')
2 : .then (data) ->
3 : $.post('/users', data)
4 : .then (result) ->
^ :~^
5 : alert(result)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4031307-unintentional-difference-in-promise-style-indentation?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions