문제

How do I get jslint to play nice with node --harmony? When I run node with the harmony flag, I get jslint errors like this:

 #1 Expected an identifier and instead saw 'let'.

To summarize I want jslint to recognize that I'm using ES6 extensions. Is there a way?

도움이 되었습니까?

해결책

JSLint does not currently have any support for any of the specced or proposed ES6 features. JSHint does have a basic level of support for some ES6 features, and is gaining more support fairly regularly:

  • Destructuring
  • Rest parameters/spread operator
  • Generator functions
  • Block scoping (including constants and let)
  • Classes
  • The for-of loop
  • Modules

Note that you will have to activate this behaviour in JSHint, by setting the esnext option to true.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top