wallabyjs / atom-wallaby

Wallaby.js atom package starter
Other
57 stars 6 forks source link

parameter merging error #8

Closed inancgumus closed 9 years ago

inancgumus commented 9 years ago

In http://coffeescript.org 's 'try coffee script' section, I can use the code without any problem. But, within wallaby it throws an error (my linter also throws an error). It may be because of the coffee script version that wallaby uses. Is there a way to change the version? And how to get rid of this error?

CODE:

class Foo
  constructor: (parameters = {}) ->
    {
      @id = 0
      @width  = 320
      @height = 200
    } = parameters

console.log new Foo({width: 500})

ERROR:

Failed to run compilers on test/firstTest.coffee, test/firstTest.coffee:16:11: error: unexpected =
      @id = 0
          ^
ArtemGovorov commented 9 years ago

CoffeeScript 1.10 was released a few days ago and it's a new feature of it, so as you have suggested it wasn't working because wallaby.js didn't support that version yet. Have added the 1.10 support to wallaby.js, should now work in core v1.0.98. Please let me know if it works for you now.

inancgumus commented 9 years ago

I'm trying to update wallaby from Atom but it says it's in the latest version which is: 1.0.4 and so, does not make an update.

ArtemGovorov commented 9 years ago

There hasn't been any package updates, but there's been wallaby core update. Wallaby.js core updates itself automatically, you may read about it here. Open Dev Tools (Cmd + Alt + I) console to see the current core version, perhaps it's already updated, if not restart you Atom editor and wait for a few minutes.

inancgumus commented 9 years ago

Yes it shows that the core version is: 1.0.98. But, I'm still probably getting the same error.

Wallaby Failing Tests: Failed to run compilers on test/mine/firstTest.coffee,
test/mine/firstTest.coffee:48:11: error: "1" cannot be assigned
      @a: 1
          ^/Users/me/.atom/packages/atom-wallaby/wallaby-atom/index.js:8 (anonymous function)
events.js:77 
emitOneevents.js:166 
emit/Users/me/.atom/packages/atom-wallaby/wallaby-atom/index.js:8 (anonymous function
)
events.js:77 
emitOneevents.js:166 
emit/Users/me/.atom/packages/atom-wallaby/wallaby/client.js:8 1._.extend._stats/Users/me/.atom/packages/atom-wallaby/wallaby/client.js:8 
(anonymous function)
events.js:87 
emitTwoevents.js:169 
emitchild_process.js:306 
handleMessagechild_process.js:334 
channel.onread
ArtemGovorov commented 9 years ago

It doesn't look like the same error, the message is different. Could you please share your not working code snippet?

inancgumus commented 9 years ago

Sure.

class Image
  constructor: (options = {}) ->
    {
      @a: 1
      @b: '2'
    } = options

new Image()
ArtemGovorov commented 9 years ago

It doesn't seem like a valid CoffeeScript (doesn't work in http://coffeescript.org 's 'try coffee script' section either). I'm guessing it should be:

class Image
  constructor: (options = {}) ->
    {
      @a = 1
      @b = '2'
    } = options

new Image()
inancgumus commented 9 years ago

Sorry, my mistake. I've tried the new code but it's getting the first error: error: unexpected =. But, it works in try coffee script without a problem.

ArtemGovorov commented 9 years ago

Strange, could you please uninstall wallaby.js package from Atom and install it again? It works for me, so the only guess I have why it doesn't for you is that because there's were some issues in updating the core.

screen shot 2015-09-07 at 6 24 16 pm