离线安装

1、下载插件包 http://download.eclipsesource.com/~rsternberg/jshint-eclipse-0.9.8.20130728-0004-b94b446.zip

2、解压缩后是一个jshint-eclipse-0.9.8.20130728-0004-b94b446文件夹,拷贝至一个web容器中,可以敲地址访问的

例如:http://127.0.0.1/xx/jshint-eclipse-0.9.8.20130728-0004-b94b446 xx是项目名称,

3、在Eclipse主菜单,点击: Help > Install New Software…

输入上面的URL,然后选择 JSHint Eclipse Integration

不要急着点Next,当前界面最下一行的复选框勾去掉(Contact all update sites during install to find required software)
后面的安装过程很简单,往下按确定就可以了

在线安装或如何配置?

请参照这里 http://www.cnblogs.com/lhb25/archive/2012/04/05/javascript-validation-with-jshint-eclipse.html

按道理可以直接使用了,但似乎还是不行...

需修改配置,步骤如下:

1、下载官方的jshint.js https://raw.github.com/jshint/jshint/master/dist/jshint.js (可选操作

Window > Preferences > JSHint   点击JSHint 选择Provide a custom JSHint library file  然后选择刚才下载的jshint.js文件

2、配置验证的选项 Window > Preferences > JSHint > Configuration

 1 {
 2     "maxerr": 50,
 3     "bitwise": true,
 4     "camelcase": false,
 5     "curly": true,
 6     "eqeqeq": true,
 7     "forin": true,
 8     "immed": false,
 9     "indent": 4,
10     "latedef": false,
11     "newcap": false,
12     "noarg": true,
13     "noempty": true,
14     "nonew": false,
15     "plusplus": false,
16     "quotmark": false,
17     "undef": true,
18     "unused": true,
19     "strict": true,
20     "trailing": false,
21     "maxparams": false,
22     "maxdepth": false,
23     "maxstatements": false,
24     "maxcomplexity": false,
25     "maxlen": false,
26     "asi": false,
27     "boss": false,
28     "debug": false,
29     "eqnull": false,
30     "es5": false,
31     "esnext": false,
32     "moz": false,
33     "evil": false,
34     "expr": false,
35     "funcscope": false,
36     "globalstrict": false,
37     "iterator": false,
38     "lastsemic": false,
39     "laxbreak": false,
40     "laxcomma": false,
41     "loopfunc": false,
42     "multistr": false,
43     "proto": false,
44     "scripturl": false,
45     "smarttabs": false,
46     "shadow": false,
47     "sub": false,
48     "supernew": false,
49     "validthis": false,
50     "browser": true,
51     "couch": false,
52     "devel": true,
53     "dojo": false,
54     "jquery": false,
55     "mootools": false,
56     "node": false,
57     "nonstandard": false,
58     "prototypejs": false,
59     "rhino": false,
60     "worker": false,
61     "wsh": false,
62     "yui": false,
63     "nomen": false,
64     "onevar": false,
65     "passfail": false,
66     "white": false,
67     "globals": { }
68 }

详细参数说明:

 1 {
 2     // JSHint Default Configuration File (as on JSHint website)
 3     // See http://jshint.com/docs/ for more details
 4
 5     "maxerr"        : 50,       // {int} Maximum error before stopping
 6
 7     // Enforcing
 8     "bitwise"       : true,     // true: Prohibit bitwise operators (&, |, ^, etc.)
 9     "camelcase"     : false,    // true: Identifiers must be in camelCase
10     "curly"         : true,     // true: Require {} for every new block or scope
11     "eqeqeq"        : true,     // true: Require triple equals (===) for comparison
12     "forin"         : true,     // true: Require filtering for..in loops with obj.hasOwnProperty()
13     "immed"         : false,    // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
14     "indent"        : 4,        // {int} Number of spaces to use for indentation
15     "latedef"       : false,    // true: Require variables/functions to be defined before being used
16     "newcap"        : false,    // true: Require capitalization of all constructor functions e.g. `new F()`
17     "noarg"         : true,     // true: Prohibit use of `arguments.caller` and `arguments.callee`
18     "noempty"       : true,     // true: Prohibit use of empty blocks
19     "nonew"         : false,    // true: Prohibit use of constructors for side-effects (without assignment)
20     "plusplus"      : false,    // true: Prohibit use of `++` & `--`
21     "quotmark"      : false,    // Quotation mark consistency:
22                                 //   false    : do nothing (default)
23                                 //   true     : ensure whatever is used is consistent
24                                 //   "single" : require single quotes
25                                 //   "double" : require double quotes
26     "undef"         : true,     // true: Require all non-global variables to be declared (prevents global leaks)
27     "unused"        : true,     // true: Require all defined variables be used
28     "strict"        : true,     // true: Requires all functions run in ES5 Strict Mode
29     "trailing"      : false,    // true: Prohibit trailing whitespaces
30     "maxparams"     : false,    // {int} Max number of formal params allowed per function
31     "maxdepth"      : false,    // {int} Max depth of nested blocks (within functions)
32     "maxstatements" : false,    // {int} Max number statements per function
33     "maxcomplexity" : false,    // {int} Max cyclomatic complexity per function
34     "maxlen"        : false,    // {int} Max number of characters per line
35
36     // Relaxing
37     "asi"           : false,     // true: Tolerate Automatic Semicolon Insertion (no semicolons)
38     "boss"          : false,     // true: Tolerate assignments where comparisons would be expected
39     "debug"         : false,     // true: Allow debugger statements e.g. browser breakpoints.
40     "eqnull"        : false,     // true: Tolerate use of `== null`
41     "es5"           : false,     // true: Allow ES5 syntax (ex: getters and setters)
42     "esnext"        : false,     // true: Allow ES.next (ES6) syntax (ex: `const`)
43     "moz"           : false,     // true: Allow Mozilla specific syntax (extends and overrides esnext features)
44                                  // (ex: `for each`, multiple try/catch, function expression…)
45     "evil"          : false,     // true: Tolerate use of `eval` and `new Function()`
46     "expr"          : false,     // true: Tolerate `ExpressionStatement` as Programs
47     "funcscope"     : false,     // true: Tolerate defining variables inside control statements"
48     "globalstrict"  : false,     // true: Allow global "use strict" (also enables 'strict')
49     "iterator"      : false,     // true: Tolerate using the `__iterator__` property
50     "lastsemic"     : false,     // true: Tolerate omitting a semicolon for the last statement of a 1-line block
51     "laxbreak"      : false,     // true: Tolerate possibly unsafe line breakings
52     "laxcomma"      : false,     // true: Tolerate comma-first style coding
53     "loopfunc"      : false,     // true: Tolerate functions being defined in loops
54     "multistr"      : false,     // true: Tolerate multi-line strings
55     "proto"         : false,     // true: Tolerate using the `__proto__` property
56     "scripturl"     : false,     // true: Tolerate script-targeted URLs
57     "smarttabs"     : false,     // true: Tolerate mixed tabs/spaces when used for alignment
58     "shadow"        : false,     // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
59     "sub"           : false,     // true: Tolerate using `[]` notation when it can still be expressed in dot notation
60     "supernew"      : false,     // true: Tolerate `new function () { ... };` and `new Object;`
61     "validthis"     : false,     // true: Tolerate using this in a non-constructor function
62
63     // Environments
64     "browser"       : true,     // Web Browser (window, document, etc)
65     "couch"         : false,    // CouchDB
66     "devel"         : true,     // Development/debugging (alert, confirm, etc)
67     "dojo"          : false,    // Dojo Toolkit
68     "jquery"        : false,    // jQuery
69     "mootools"      : false,    // MooTools
70     "node"          : false,    // Node.js
71     "nonstandard"   : false,    // Widely adopted globals (escape, unescape, etc)
72     "prototypejs"   : false,    // Prototype and Scriptaculous
73     "rhino"         : false,    // Rhino
74     "worker"        : false,    // Web Workers
75     "wsh"           : false,    // Windows Scripting Host
76     "yui"           : false,    // Yahoo User Interface
77
78     // Legacy
79     "nomen"         : false,    // true: Prohibit dangling `_` in variables
80     "onevar"        : false,    // true: Allow only one `var` statement per function
81     "passfail"      : false,    // true: Stop on first error
82     "white"         : false,    // true: Check against strict whitespace and indentation rules
83
84     // Custom Globals
85     "globals"       : {}        // additional predefined global variables
86 }

相关参考资料:

jshint官网

在 Eclipse 中使用 JSHint 检查 JavaScript 代码

在Eclipse中使用JSLint保证JavaScript代码质量

jsint4java 精简安装

JSLint for eclipse 安装以及setting 说明

转载于:https://www.cnblogs.com/yimu/p/jslint.html

在Eclipse中安装JSHint插件相关推荐

  1. SVN工具的使用 和在Eclipse中安装GPD插件:(多步审批流,因此选择使用工作流(JBPM)来实现)...

    前言 重点解说SVN工具的还原版本号. 1.提交svn之前.要先更新文件.假设更新之后有版本号冲突的话.就线下解决掉冲突,在把该文件标记为已经解决冲突. 正文 使用SVN还原历史版本号 去除掉Ecli ...

  2. 在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文

    在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文 安装成功后ASCII还是不能转换成中文的,原因是设置里面没有把编码设置为utf8的 ...

  3. Eclipse中安装TestNG插件

    Eclipse中安装TestNG插件 HelpàInstall new Software Work with:填入http://beust.com/eclipse 点击Add Name:TestNG ...

  4. 怎么在eclipse中安装properties插件使其显示中文

    在eclipse中编写properties文件时,如果直接写中文,它不会自动转换成ASCII编码,在浏览器中就会显示为乱码怎么在eclipse中安装properties插件. 1.首先,在eclips ...

  5. eclipse中安装freemarker插件及ftl使用freemarker编辑器--在线安装方法

    eclipse中安装freemarker插件及ftl使用freemarker编辑器--在线安装方法 在线安装的方法是:Help –> Install New Software 点击  and h ...

  6. Eclipse中安装HibernateTools插件

     在Eclipse(Luna)中安装Hibernatetools插件 1.  下载地址:http://tools.jboss.org/downloads/overview.html,该版本为hib ...

  7. eclipse中安装flex插件

    http://xm-koma.iteye.com/blog/1648585 这里记录一下安装FB3_WWEJ_Plugin.exe(Flex的插件)的步骤,用来阐述eclipse中安装插件的两种方式( ...

  8. 在eclipse中安装groovy插件详细步骤

    为了方便,将groovy插件集成到eclipse中使用,安装步骤如下: step 1:检查自己的eclipse版本:在help->About Eclipse中查看: step 2:进入 http ...

  9. eclipse 中 安装git 插件和使用git 插件

    1.首先你的eclipse中需要配置代理,如果能直接连接外网这个就不需要配置,否则就配置代理: window->preferences 选择manual,然后配置http,https设置auth ...

  10. 在eclipse中安装svn插件

    clipse里安装SVN插件,一般来说,有三种方式:  1. 直接下载SVN插件,将其解压到eclipse的对应目录里  2. 使用eclipse 里Help菜单的"Install New ...

最新文章

  1. leangoo怎么导入导出,归档和删除看板?
  2. 一文读懂 CNN、DNN、RNN 内部网络结构区别
  3. MJRefresh iphonx 显示问题
  4. nginx图片服务器性能,搭建nginx图片服务器
  5. 【CSS3】CSS中的定位
  6. linux中默认安装php,Linux系统中Apache PHP MySQL的默认安装路径
  7. android 去锯齿
  8. unreal world 皮革_UnRealWorld 进阶游戏教程
  9. python的常量和变量_python变量和常量
  10. kb4023057安装失败_微软重发Win10 KB4023057 补丁,推动Win10更新
  11. Java并发编程实战——volatile
  12. 重新学习操作系统的知识
  13. python3中input()方法报错traceback变量未定义的解决方法
  14. Debian中proftpd+mysql+虚拟用户+匿名用户+磁盘限额的配置
  15. 使用systemd管理程序进程
  16. 广数系统加工中心编程_编程十五年,谈谈对加工中心编程的一些看法...
  17. 软考中级网络工程师证书如何查询?
  18. 常用导数与等价无穷小
  19. 编写函数求x的n次方
  20. jav皮卡_前5名:12个模因,皮卡第,AMP打开还是关闭? 和更多

热门文章

  1. DIY年轻人的第一辆电动滑板车
  2. 微擎模块-微信门禁小区物业版(微信开门)
  3. 没完全读懂的《人间失格》
  4. tampermonkey油猴实现自动定时刷新页面,刷访问量
  5. 多伦多计算机科学排名,2017加拿大大学专业排名:计算机科学类项目
  6. 如何批量将 Excel 文档转为 Json 格式
  7. 服务器cpu虚拟化怎么开启,开启cpu虚拟化
  8. 2022年前端还好找工作吗?
  9. 腾讯云 python接口_Python 服务端集成 腾讯云 IM 服务
  10. DAMA-DMBOK 数据治理功能框架