Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spread operator doesn't work #3

Closed
delacruz-dev opened this issue Oct 22, 2015 · 9 comments
Closed

Spread operator doesn't work #3

delacruz-dev opened this issue Oct 22, 2015 · 9 comments
Labels

Comments

@delacruz-dev
Copy link

Hi!

I'm using esdoc to document my code and the esdoc-es7-plugin. I've got the following code in one of my functions:

return new SomeEntity({
      ...someParams,
      some,
      other,
      params
    });

And I'm getting the following error on generating the documentation:

error: could not parse the following code. if you want to use ES7, see esdoc-es7-plugin(https://github.com/esdoc/esdoc-es7-plugin)

This is my esdoc.json

{
  "source": "./src",
  "destination": "./docs",
  "coverage": true,
  "plugins": [
    {"name": "esdoc-es7-plugin"}
  ],
  "test": {
    "type": "mocha",
    "source": "./test",
    "includes": ["Spec\\.js$"]
  }
}

What am I doing bad? It doesn't happen when compiling with babel, so I guess the mistake is not in my code :(

@h13i32maru h13i32maru added the bug label Oct 25, 2015
@h13i32maru
Copy link
Member

@danderu Hi! Thanks for this issue!
Your code is valid. This is ESDoc bug. I will fix this issue in next version.

For now, can use the following workaround:

cd /usr/local/lib/node_modules/esdoc-es7-plugin/
rm -rf node_modules/estraverse
npm i estraverse@4.1.0

h13i32maru added a commit that referenced this issue Nov 2, 2015
@h13i32maru
Copy link
Member

@danderu I published v0.0.3. The version fixed this issue.

@delacruz-dev
Copy link
Author

Thanks for the quick fix!

@h13i32maru
Copy link
Member

I published ESDoc v0.4.3. This plugin require the ESDoc version. Please update ESDoc as well.

@delacruz-dev
Copy link
Author

Sorry, but I'm still having this issue after upgrading to v0.4.3 and plugin version 0.0.3. I applied the same workaround and it works.

cd /usr/local/lib/node_modules/esdoc-es7-plugin/
rm -rf node_modules/estraverse
npm i estraverse@4.1.0

@parris
Copy link

parris commented Sep 20, 2016

hmmm, I'm still seeing this issue. I tried manually installing estraverse too.

@parris
Copy link

parris commented Sep 20, 2016

code:

{ SyntaxError: unknown: Unexpected token (14:8)
  12 | export const store = createStore(
  13 |     combineReducers({
> 14 |         ...reducers,
     |         ^
  15 |         routing: routerReducer,
  16 |     })
  17 | )

@SamMatthewsIsACommonName

Hi I'm also having this issue:
`{ SyntaxError: unknown: Unexpected token (61:15)
59 | switch (action.type) {
60 | case 'CLOSE_MENU':

61 | return { ...state, menuOpen: false };
| ^
62 | case 'UPDATE_SCROLL_LOCATION':
63 | return { ...state, scrollLocation: action.scrollLocation };
64 | case DISPLAY_SUCCESS_MESSAGE:`

@hughvidos
Copy link

I'm seeing the same.

  20 | export default StyleSheet.create({
  21 |   backButton: {
> 22 |     ...navButton,
     |     ^
  23 |     marginTop: Metrics.baseMargin,
  24 |     marginLeft: Metrics.baseMargin
  25 |   },

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

No branches or pull requests

5 participants