jshint-eclipse: JavaScript Code Quality Plugin for Eclipse
jshint-eclipse: JavaScript Code Quality Plugin for Eclipse
JavaScript has a lot of pitfalls, so it is very important to have a code analysis tool that detects errors and bad programming style.
jshint-eclipse is an Eclipse plugin that uses the static code analysis tool JSHint to analyze your JavaScript sources.
JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team’s coding conventions.
It is very flexible so you can easily adjust it to your particular
coding guidelines and the environment you expect your code to execute
in.
To install it, use the Eclipse update site: http://github.eclipsesource.com/jshint-eclipse/updates/
To activate JSHint for your project, open the project properties dialog, select JSHint and check “Enable JSHint for this project“.
From now on, all your .js files will be checked.
To exclude files or complete directory trees from the analysis, right
click on the file/folder to exclude in the Navigator. Select Properties -> JSHint and check “Exclude this folder from jshint validation“. You should exclude third party javascript libraries like jQuery.
Here is a screenshot that shows JSHint in action. You can see warning
icons next to lines that violate rules. The problem view shows all the
violations with a description of the problem.
The default configuration of JSHint is not that strict, so you probably want to provide your own configuration. The configuration page shows all possible settings. To adjust these settings in Eclipse, open the preferences page and navigate to JSHint -> Options.
Here is my personal config that is a lot stricter than the default configuration:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
devel: true, browser: true, curly: true, eqeqeq: true, forin: true, immed: true, latedef: newcap, noarg: true, noempty: true, undef: true, strict: true, trailing: true, newcap: true |
JSHint directly supports some famous JavaScript frameworks. If you are using jQuery, you should add this to your config:
1
|
jquery: true |
Like this:
Related
JavaScript Lint - checks your JavaScript source code for common mistakes21. August 2011In "Java and Quality"
Dynamic Reloading of Vaadin Applications With Maven and Eclipse, Pt. I23. August 2012In "Build, config and deploy"
TypeScript Plug-in for Eclipse5. August 2013In "Eclipse Universe"
Leave a Reply
OIO ‘s Developer Blog
This is the publication playground for these guys from Orientation in Objects, a Java Competence Center based in Germany.Tag cloud
Agile Methods and development
Atlassian Tools
Build, config and deploy
Did you know?
Eclipse Universe
Groovy and Grails
Java and Quality
Java Basics
Java EE
Java modularization
Java Persistence
Java Runtimes - VM, Appserver & Cloud
Java Web Frameworks
MDSD
Open Source BI
Other languages for the Java VM
Politics
Security
SOA / Webservices
Spring Universe
Web as a Platform
XML Universe
OIO news
OIO Braintime Blog
- Confluence 5.9: Wissen für alle, auch für JIRA Service Desk-Nutzer
- Erfahrungsbericht Architektur-Kata
- Confluence 5.9: Neues Dashboard, CQL-Filter und bessere Performance
- Portfolio für JIRA – Einführung für Projektmanager
- Portfolio für JIRA – Eine Einführung für Entwicklungsleiter
- Portfolio for JIRA – Eine Einführung für Produktmanager
- JIRA Plugins für den Projektalltag (10/10): Structure – The Issue Organizer
- JIRA Plugins für den Projektalltag (9/10): Create on Transition
- JIRA Plugins für den Projektalltag (8/10): Repeating Issues
- JIRA Plugins für den Projektalltag (7/10): The Scheduler
Email Subscription
Click to subscribe to this blog and receive notifications of new posts by email.
Join 59 other subscribers
Email Address
Top Posts & Pages
- Integrating PDF.js as PDF viewer in your web application
- An introduction to TypeScript's module system
- Java Profilers - A short comparison between JProfiler, YourKit and Java’s VisualVM
- How to create a Loading Animation / Spinner using jQuery
- Add Support for Java 8 Date & Time API to Jackson Serialized REST Web Services
- Split comma-separated Strings in Java
- Logging additional information like SessionID in every Log4j message
- Grails Database Queries - Criteria Builder vs. Where Queries [updated]
- A comprehensive example of JSF's Faces Flow
- Mapping ISO2 and ISO3 Country Codes with Java
Latest Comments
- Pierluigi Vernetto on Java Profilers – A short comparison between JProfiler, YourKit and Java’s VisualVM
- Texte aufsplitten und zusammenführen in Java 8 – Teil 2 | techscouting through the java news on Texte aufsplitten und zusammenführen in Java 8 – Teil 1
- Roland Krüger on Accessing Maven Properties From Your Code
- Chris Passante on Accessing Maven Properties From Your Code
- Srikanth on Integrating PDF.js as PDF viewer in your web application
RSS
Archiv
- December 2015 (1)
- November 2015 (9)
- October 2015 (1)
- September 2015 (2)
- August 2015 (5)
- July 2015 (3)
- June 2015 (4)
- May 2015 (4)
- April 2015 (3)
- March 2015 (4)
- February 2015 (4)
- January 2015 (4)
- December 2014 (2)
- November 2014 (3)
- October 2014 (3)
- September 2014 (10)
- August 2014 (2)
- July 2014 (19)
- June 2014 (1)
- May 2014 (5)
- April 2014 (5)
- March 2014 (16)
- February 2014 (20)
- January 2014 (6)
- December 2013 (6)
- November 2013 (2)
- October 2013 (3)
- September 2013 (1)
- August 2013 (7)
- July 2013 (15)
- June 2013 (11)
- May 2013 (17)
- April 2013 (9)
- March 2013 (8)
- February 2013 (16)
- January 2013 (8)
- December 2012 (9)
- November 2012 (8)
- October 2012 (12)
- September 2012 (7)
- August 2012 (9)
- July 2012 (9)
- June 2012 (11)
- May 2012 (9)
- April 2012 (8)
- March 2012 (6)
- February 2012 (16)
- January 2012 (4)
- December 2011 (24)
- November 2011 (2)
- October 2011 (3)
- September 2011 (7)
- August 2011 (6)
- July 2011 (10)
- June 2011 (5)
- May 2011 (26)
- April 2011 (13)
- March 2011 (19)
- February 2011 (11)
- January 2011 (7)
- December 2010 (8)
- November 2010 (19)
- October 2010 (32)
- September 2010 (2)
- August 2010 (5)
- July 2010 (7)
- June 2010 (1)
- May 2010 (21)
- April 2010 (9)
- March 2010 (9)
- February 2010 (17)
- January 2010 (14)
- June 2009 (1)
- May 2009 (2)
Categories
- Agile Methods and development
- Atlassian Tools
- Build, config and deploy
- Did you know?
- Eclipse Universe
- Groovy and Grails
- Java and Quality
- Java Basics
- Java EE
- Java modularization
- Java Persistence
- Java Runtimes – VM, Appserver & Cloud
- Java Web Frameworks
- MDSD
- Open Source BI
- Other languages for the Java VM
- Politics
- Security
- SOA / Webservices
- Someone thinks I fit nowhere else
- Spring Universe
- Uncategorized
- Web as a Platform
- XML Universe
Subscribe to Blog via Email
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 59 other subscribers
Email Address
jshint-eclipse: JavaScript Code Quality Plugin for Eclipse的更多相关文章
- eclipse启动报错 Problems occurred when invoking code from plug-in: "org.eclipse.jface"
eclipse在使用中可能会发生错误: Problems occurred when invoking code from plug-in: "org.eclipse.jface" ...
- Problems occurred when invoking code from plug-in: "org.eclipse.jface".
java.lang.NullPointerException at com.genuitec.eclipse.easie.core.AppServer.getServerLabel(Unknown S ...
- view class source code with JAD plugin in Eclipse
The default class viewer doesn't decompile the class file so you cannot open and check the source co ...
- eclipse's code assist
突然发现有个类没有code assist功能了,而别的类都还有,新建的类也有,可是当把代码拷贝到新建的类还是不行:尝试了各种办法,包括删除workspace/.metadata/.plugin/org ...
- Plug-in 'org.eclipse.cdt.ui' contributed an invalid Menu Extension
终于在mac上配置了最新的eclipse和adt(Win和Mac oxs通用),然后就Error Log报这种错误,运行了hello word,没有影响,但是依旧有这种错误! 记录下错误: eclip ...
- tip use view.isineditmode() in your custom views to skip code when shown in eclipse
tip use view.isineditmode() in your custom views to skip code when shown in eclipse
- Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
今天在做自定义ViewGroup中,出现了一下错误提示Use View.isInEditMode() in your custom views to skip code when shown in E ...
- (办公)plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal
今天上午开发环境遇到这个问题,解决方案如下,(解决了之后,项目并没有丢失.) 因为Eclipse的这个plug-in org.eclipse.jdt.ui was unable to load cla ...
- eclipse中无法新建Android工程 出现问题:Plug-in org.eclipse.ajdt.ui was unable to load
转自:http://www.bubuko.com/infodetail-757338.html eclipse中打开后新建Android项目区仍无法创建,出现下列提示对话框: Plug-in org. ...
随机推荐
- 07. 如何实现移动端rem适配
如何实现移动端rem适配 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- 【Leetcode】Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the arra ...
- Kibana6.2.2源码入口
后端入口 \kibana-6.2.2\src\server\kbn_server.js 前端入口 kibana-6.2.2\src\ui\public\chrome\chrome.js 页面框架模板 ...
- 关于c语言的位运算&,|,^(看懂汉字的都能看懂)
其中|,&可以当作逻辑运算符,当|,&当成逻辑运算符时,与||,&&的用法基本相似,&&,||运算时会当前面的表达式能够决定整个表达式,则不进行对后面的 ...
- shell脚本:Ctrl+C终止的是哪个进程
aa.sh中的内容如下图: 运行sh aa.sh, 显示aa.txt后面几行, 此时开启了两个进程:一个sh运行,一个tail -f运行 按Ctrl+C 会终止此sh进程, 父进程死了,里面的tail ...
- thinkphp引入模板view
3.1 模板放在哪儿? 放在模块的view目录下并且每个控制器的模板,要在与控制器同名的目录下. 以 index.php/Home/User/add则对应的模板在 /Home/view/User/ad ...
- thinkPHP5.0 volist标签理解
{volist name="list" id="vo" offset="5" length="10"} .... {/v ...
- oracle merge into函数中插入clob字段
当使用Merge into 函数向ORACLE数据库中插入或更新数据时,报错“ORA-01461: 仅可以为插入 LONG 列的 LONG 值赋值”,使用如下方法可以把String转换为clob. 需 ...
- 用navigator.geolocation.getCurrentPosition在IOS10以上的系统无法定位
昨天老板告诉我代码有Bug(定位失败),于是各种测试最终发现IOS10以上版本手机不能成功(穷,买不起iphone,测试不完全),先贴失败代码: var city =""; nav ...
- AndroidStudio项目提交到github最详细步骤
在使用studio开发的项目过程中有时候我们想将项目发布到github上,以前都是用一种比较麻烦的方式(cmd)进行提交,最近发现studio其实是自带这种功能的,终于可以摆脱命令行了. 因为自己也没 ...