Fix CoffeeScript Unexpected Indent Error in SublimeText

Getting this

error: unexpected INDENT

in my rails app related to the coffeescript was very frustrating, and difficult to debug because all the indentation in my code appeared to be correct.  It actually had to do with our my text editor, Sublime Text, was handling tabs and spaces.

To fix this, go to View -> Indentation and check Indent Using Spaces and Convert Indentation to Spaces.

Credit here.

Advertisements

One Response to Fix CoffeeScript Unexpected Indent Error in SublimeText

  1. Reblogged this on learn coffeescript and commented:
    Use a tab size of 1 in text editors for CoffeeScript.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: