Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

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

Open
wintermutt opened this issue Jul 14, 2017 · 4 comments

Comments

@wintermutt
Copy link

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
Copy link
Collaborator

swang commented Jul 15, 2017

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

@wintermutt
Copy link
Author

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
Copy link
Collaborator

swang commented Jul 15, 2017

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

@wintermutt
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants