CoffeeScriptRedux icon indicating copy to clipboard operation
CoffeeScriptRedux copied to clipboard

Unintentional difference in promise-style indentation

Open rstacruz opened this issue 11 years ago • 3 comments

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

rstacruz avatar Aug 25 '14 16:08 rstacruz

I get this as well

eddiemonge avatar Oct 10 '14 21:10 eddiemonge

Redux doesn't allow variable indentation anymore. Check if you're using space & tabs combined by accident.

19h avatar Oct 11 '14 23:10 19h

I do have this problem as well (see: https://github.com/michaelficarra/CoffeeScriptRedux/issues/22)

I did make sure to just have 2-spaces for indentation

lordnox avatar Apr 12 '16 13:04 lordnox