Nodeclipse not recognizing generator functions

陌路散爱 提交于 2019-12-24 16:35:27

问题


First off, I am starting Node with the --harmony flag. I set this flag in Eclipse "Preferences > Nodeclipse > node options"

The problems show in the .js files themselves.

For instance, I have a generator method in one of my controllers...

show: function* () { ... }

Nodeclipse is showing an error on all .js files with generator functions. It displays the red "x" with the message...

Syntax error on "*".  Delete this token.

Since most of node modules I use have generator functions, I have like 500 errors in the project.

Anyone know how to fix this?


回答1:


a) get Nodeclipse 1.1 http://www.nodeclipse.org/history

or

b) do manually:

remove JSDT nature in .project

    <nature>org.eclipse.wst.jsdt.core.jsNature</nature>

in .jshintrc enable ES6

"esnext" : true, // Allow ES.next (ECMAScript 6) specific features such as `const` and `let`.


来源:https://stackoverflow.com/questions/32213915/nodeclipse-not-recognizing-generator-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!