离线安装

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

 {
"maxerr": 50,
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"forin": true,
"immed": false,
"indent": 4,
"latedef": false,
"newcap": false,
"noarg": true,
"noempty": true,
"nonew": false,
"plusplus": false,
"quotmark": false,
"undef": true,
"unused": true,
"strict": true,
"trailing": false,
"maxparams": false,
"maxdepth": false,
"maxstatements": false,
"maxcomplexity": false,
"maxlen": false,
"asi": false,
"boss": false,
"debug": false,
"eqnull": false,
"es5": false,
"esnext": false,
"moz": false,
"evil": false,
"expr": false,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"proto": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": false,
"supernew": false,
"validthis": false,
"browser": true,
"couch": false,
"devel": true,
"dojo": false,
"jquery": false,
"mootools": false,
"node": false,
"nonstandard": false,
"prototypejs": false,
"rhino": false,
"worker": false,
"wsh": false,
"yui": false,
"nomen": false,
"onevar": false,
"passfail": false,
"white": false,
"globals": { }
}

详细参数说明:

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

相关参考资料:

jshint官网

在 Eclipse 中使用 JSHint 检查 JavaScript 代码

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

jsint4java 精简安装

JSLint for eclipse 安装以及setting 说明

在Eclipse中安装JSHint插件的更多相关文章

  1. 总结eclipse中安装maven插件

    当自己越来越多的接触到开源项目时,发现大多数的开源项目都是用maven来够建的.并且在开发应用时,也越来越意识到maven的确会解决很多问题,如果你要了解maven,可以参考:Maven入门指南(一) ...

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

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

  3. 在Eclipse中安装spket插件

    spket是一个开发JavaScript和Ext等的开发工具,它可以 是独立的IDE,也可以作为 Eclipse的插件使用,下面介绍如何在Eclipse中安装spket插件, 1.首先上 官网 htt ...

  4. Eclipse中安装MemoryAnalyzer插件及使用

    Eclipse中安装MemoryAnalyzer插件 一.简介 Eclipse作为JAVA非常好用的一款IDE,其自带的可扩展插件非常有利于JAVA程序员的工作效率提升. MemoryAnalyzer ...

  5. eclipse中安装freemarker插件及ftl使用freemarker编辑器

    http://www.07net01.com/2015/08/895212.html eclipse中安装freemarker插件及ftl使用freemarker编辑器 在线安装的方法是:Help – ...

  6. 在eclipse中安装groovy插件

    在eclipse中安装groovy插件详细步骤: step 1:检查自己的eclipse版本:在help->About Eclipse中查看: step 2:进入 https://github. ...

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

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

  8. eclipse中安装pydev插件出现duplicate location

    eclipse中安装pydev插件出现duplicate location,主要是因为之前已经填写了该地址并且已经加载了,具体的解决办法见下链接: http://jingyan.baidu.com/a ...

  9. 在Eclipse中安装python插件的方法

    一个博士给了我一堆代码,原本以为是C++或者java写的,结果是python,我压根没学过呀,不过本着语言都是相通的原则,我硬着头皮开始学习Python,当然先学习安装IDE(以前学习一门新语言,我会 ...

随机推荐

  1. Wscript.Shell 对象详细介绍

    详细 WshShell 对象ProgID Wscript.Shell 文件名 WSHom.Ocx CLSID F935DC22-1CF0-11d0-ADB9-00C04FD58A0B IID F935 ...

  2. js数组去重 javascript版

    //js数组去重 //思路: // 1.放入第一个元素 // 2.放入第n个元素,和第n个之前的元素就行比较,如果有重复,则跳过.没有重复就加入数组中 // 3.返回新的去重后数组 Array.pro ...

  3. Flutter 导入 import 'package:english_words/english_words.dart'

    import 'package:flutter/material.dart';import 'package:english_words/english_words.dart'; // 导入的包 vo ...

  4. List<Type> 随机排序

    public List<T> GetRandomList<T>(List<T> inputList){ //Copy to a array T[] copyArra ...

  5. RSA加密、解密、签名、校验签名

    先说下RSA概率: 公钥和私钥是通过本地openssl软件生成. 正常: 公钥加密=>私钥解密: 私钥签名=>公钥校验签名 最近做一个项目,对方用java公钥去校验签名,这边java的De ...

  6. SpringMVC HandlerMethodArgumentResolver自定义参数转换器

    来源: https://www.cnblogs.com/daxin/p/3296493.html 自定义Spring MVC3的参数映射和返回值映射 + fastjson首先说一下场景:在一些富客户端 ...

  7. python_面向对象—代码练习

    """注意:代码切勿照搬,错误请留言指出""" import re ''' class Person: name='xxx' age=20 ...

  8. 将libFM模型变换成tensorflow可serving的形式

    fm_model是libFM生成的模型 model.ckpt是可以tensorflow serving的模型结构 亲测输出正确. 代码: import tensorflow as tf # libFM ...

  9. ORACLE--12C--多租户体系架构概念

    一,概念 1,何为多租户? 官网链接: 飞机直达>> 多租户这个概念并不是12C的新特性,而是体系架构,多租户架构使得oracle 数据库成为了一个多租户的容器数据库,也就是contain ...

  10. Oracle broker--详解

    1,简介 01,介绍 Data Guard broker是建立在Data Guard基础上的一个对Data Guard配置,集中管理操作的一个平台.我们再上次DG主备切换的时候会发现特别麻烦,为此br ...