clutchski/coffeelint

"unexpected indentation" when omitting braces for the default export of an ES6 module

wintermutt opened this issue · 4 comments

The following code gives me "unexpected indentation" as an error:

export default
  foo: 'bar'

CoffeeScript compiles it just fine:

export default {
  foo: 'bar'
};

CoffeeLint has no problems with the one-liner version though:

export default foo: 'bar'

Not sure if I'm missing something, but I believe the first block should raise no linting errors.

I'm on v1.16.0.

swang commented

coffeelint doesn't generate an unexpected indentation error... i don't get any errors with the example..

Hmm... I was using it from within sublime so it looked like a standard coffeelint error. Running it directly in the cli still gives me the same error, but now it's clearer coffeelint is forwarding it to me from elsewhere.

$ coffeelint -v
1.16.0
$ cat foo.coffee 
export default
  foo: 'bar'
$ coffeelint foo.coffee 
  ✗ foo.coffee
     ✗ #2: [stdin]:2:1: error: unexpected indentation
  foo: 'bar'
^^.

✗ Lint! » 1 error and 0 warnings in 1 file

I would expect this to be coming from coffeescript, but compiling the file directly works fine:

$ coffee -c foo.coffee 
$ cat foo.js 
// Generated by CoffeeScript 1.12.6
export default {
  foo: 'bar'
};

Do you have any idea where this error might be coming from? Does coffeelint do any kind of concatenation of the input files?

swang commented

looks like this is an issue with CS 1.11.x which coffeelint is still using.

Gotcha. I'll wait until the update then. Thanks!