JSHint and eclipse plugin

一世执手 提交于 2019-12-09 17:58:29

问题


So I just installed JSHint in Eclipse Kepler I loaded my .jshintrc file .

How do I run jshint on my javascript files? I do not see a menu item nor a place to specify filenames, etc...

Can someone help?


回答1:


After adding a .jshintrc file to the root of the project you need to:

Right-click on your project in the Project Explorer view -> properties -> JSHint -> Configuration -> Check enable.

Also select the folders containing your js files (use slashes in the path). I split my js files into two folders custom and external and only check on custom (and all subfolders of custom).




回答2:


As mentioned in this jshint-eclipse issue:

You have to explicitly enable JSHint for your project.
You can do so by adding a file pattern on the JSHint page in your project's preferences.

The main contributor to jshint-eclipse, ralfstx, comments:

Maybe it's not obvious.
I wanted to avoid checking all files by default for performance reasons.
JSHint is written in JavaScript, and running large scripts is not exactly fast.

OTOH, checking all *.js files by default (maybe excluding .min.js files) would not affect non-JS projects, and for JS-only workspaces, checking all projects is probably useful...



来源:https://stackoverflow.com/questions/26309397/jshint-and-eclipse-plugin

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