在Eclipse中安装JSHint插件
离线安装
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
}
相关参考资料:
在 Eclipse 中使用 JSHint 检查 JavaScript 代码
在Eclipse中使用JSLint保证JavaScript代码质量
JSLint for eclipse 安装以及setting 说明
在Eclipse中安装JSHint插件的更多相关文章
- 总结eclipse中安装maven插件
当自己越来越多的接触到开源项目时,发现大多数的开源项目都是用maven来够建的.并且在开发应用时,也越来越意识到maven的确会解决很多问题,如果你要了解maven,可以参考:Maven入门指南(一) ...
- SVN工具的使用 和在Eclipse中安装GPD插件:(多步审批流,因此选择使用工作流(JBPM)来实现)
前言 重点解说SVN工具的还原版本号. 1.提交svn之前.要先更新文件.假设更新之后有版本号冲突的话.就线下解决掉冲突,在把该文件标记为已经解决冲突. 正文 使用SVN还原历史版本号 water ...
- 在Eclipse中安装spket插件
spket是一个开发JavaScript和Ext等的开发工具,它可以 是独立的IDE,也可以作为 Eclipse的插件使用,下面介绍如何在Eclipse中安装spket插件, 1.首先上 官网 htt ...
- Eclipse中安装MemoryAnalyzer插件及使用
Eclipse中安装MemoryAnalyzer插件 一.简介 Eclipse作为JAVA非常好用的一款IDE,其自带的可扩展插件非常有利于JAVA程序员的工作效率提升. MemoryAnalyzer ...
- eclipse中安装freemarker插件及ftl使用freemarker编辑器
http://www.07net01.com/2015/08/895212.html eclipse中安装freemarker插件及ftl使用freemarker编辑器 在线安装的方法是:Help – ...
- 在eclipse中安装groovy插件
在eclipse中安装groovy插件详细步骤: step 1:检查自己的eclipse版本:在help->About Eclipse中查看: step 2:进入 https://github. ...
- 在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文
在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文安装成功后ASCII还是不能转换成中文的,原因是设置里面没有把编码设置为utf8的, ...
- eclipse中安装pydev插件出现duplicate location
eclipse中安装pydev插件出现duplicate location,主要是因为之前已经填写了该地址并且已经加载了,具体的解决办法见下链接: http://jingyan.baidu.com/a ...
- 在Eclipse中安装python插件的方法
一个博士给了我一堆代码,原本以为是C++或者java写的,结果是python,我压根没学过呀,不过本着语言都是相通的原则,我硬着头皮开始学习Python,当然先学习安装IDE(以前学习一门新语言,我会 ...
随机推荐
- Android应用捕获全局异常自定义处理
[2016-06-30]最新的全局异常处理DRCrashHandler已经集成在DR_support_lib库中 具体请看: https://coding.net/u/wrcold520/p/DR_s ...
- spark第三篇:Cluster Mode Overview 集群模式预览
Spark applications run as independent sets of processes on a cluster, coordinated by the SparkContex ...
- oracle 基础知识(九)----SQL解析
一,解析过程 二,硬解析,软解析,软软解析 01,硬解析 将SQL语句通过监听器发送到Oracle时, 会触发一个Server process生成,来对该客户进程服务.Server process得到 ...
- rsync 参数配置说明[转]
rsync 特性 可以镜像保存整个目录树和文件系统. 可以很容易做到保持原来文件的权限.时间.软硬链接等等. 无须特殊权限即可安装. 快速:第一次同步时 rsync 会复制全部内容,但在下一次只传输修 ...
- SpringMVC 源码阅读
- ionic resources
下面是我在使用ionic,cordova,angularjs的时候经常使用的资源. ionic css components cordova documentation ionic icons ngC ...
- JAVA 利用反射自定义数据层框架
之前的随笔一直都在介绍c#,主要公司最近的业务都是做桌面程序,那么目前c#中的WPF肯定是我做桌面程序的不二之选,做了半年的WPF,也基本摸清了c#写代码的套路和规则(本人之前是两年多的JAVA开发者 ...
- 移动平台的meta标签(转)
1.Meta 之 viewport 说到移动平台meta标签,那就不得不说一下viewport了,那么什么是viewport呢? viewport即可视区域,对于桌面浏览器而言,viewport指的就 ...
- 游戏AI的生命力源自哪里?为你揭开MOBA AI的秘密!
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由wataloo发表在专栏wataloo的试验田 1 设计概要 1.1 设计原则和目的 英雄AI的目的主要有: 1.新手过渡局,让玩家刚 ...
- 《Python编程从入门到实践》_第九章_类
创建一个简单的类 根据Dog类创建的每个实列都将存储名字和年龄.我们赋予了每条小狗蹲下(sit())和打滚(roll_over())的能力: class Dog(): ""&quo ...