开发者

JS validator alternatives to JSLint?

Is JS开发者_运维知识库Lint it as far as js validation tools go, or are there others?


There are two good ones that I know of:

  • ESLint
  • JSHint


A recent addition to the list: https://github.com/eslint/eslint

All the rules are implemented as plugins so it's easy to add your own


JSHint, JavaScript Lint (cites JSLint as main source for inspiration, and has similarities and even borrowed code, but is different), Esprima (calls JavaScript by a different name, but is the same thing, "ECMAscript"), and any that other answers listed that I didn't include in this list.

Also, I believe there are plug-ins for eclipse and other IDEs that can be used that are implementations of the mentioned validators, as well as Apache Ant tasks.

Some Useful links:

http://www.jshint.com/

http://www.javascriptlint.com/index.htm

http://esprima.org/index.html

http://eclipsesource.com/blogs/2012/01/26/javascript-validation-with-jshint-eclipse/ (article on plug-in)

http://github.eclipsesource.com/jshint-eclipse/ (Installation link)

https://github.com/ariya/ant-javascript-validate (apache ant task)

Also, here is a more comprehensive tool going beyond just JavaScript validation, but doing additional things as well: https://code.google.com/p/wro4j/


Wikipedia only lists jslint but there is another at javascriptlint.com you could try.


JSHint, the Closure JavaScript compiler and PHP CodeSniffer are all robust, community-supported JavaScript validation tools. Each ships with its own set of rules, which you can modify to some extent (CodeSniffer is the most flexible in terms of customization). For JSLint users, JSHint may be the most interesting option as it was originally intended to be a less strict fork of JSLint.

See also my answer to the question "Are There Any JavaScript Static Analysis Tools?"


Full disclosure, I'm behind this: http://www.toptensoftware.com/minime which does minification, obfuscation and a reasonable set of lint style checks.


You can also use Closure Linter which is also available as a Grunt package

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜