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. ...
随机推荐
- P3768 简单的数学题(莫比乌斯反演)
[题目链接] https://www.luogu.org/problemnew/show/P3768 [题目描述] 求 \(\sum_{i=1}^{n}\sum_{j=1}^{n}i* j* gcd( ...
- 1047 邮票面值设计 (DFS+DP)
题目描述 Description 给定一个信封,最多只允许粘贴N张邮票,计算在给定K(N+K≤40)种邮票的情况下(假定所有的邮票数量都足够),如何设计邮票的面值,能得到最大值MAX,使在1-MAX之 ...
- day_10 函数名,闭包,迭代器
1. 函数名的使用 1.函数名是一个变量,函数名储存的是函数的内存地址 2.函数名可以赋值给其他变量 3.函数名可以当容器类对象的元素 4.函数名可以当其他函数的参数 5.函数名可以做函数的返回值 2 ...
- day32 线程
1. 线程是什么,有了进程为什么还要线程 进程有很多优点,它提供了多道编程,让我们感觉我们每个人都拥有自己的CPU和其他资源,可以提高计算机的利用率.很多人就不理解了,既然进程这么优秀,为什么 ...
- 一般小的maven pom
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...
- Linux学习grep,sed,awk工具的使用
1.grep:根据模式搜索文本并将符合模式的文本显示出来(pattern模式:由文本字符和正则表达式元字符所匹配出来的条件) 注:alias grep='grep --color' -c:打印符合要求 ...
- 实用的vue插件大汇总
Vue是一个构建数据驱动的 web 界面的渐进式框架.Vue.js 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件特别整理了常用的vue插件,来了个大汇总,方便查找使用,便于工作 ...
- 转 windows下安装pycharm并连接Linux的python环境 以及 windows 下notepad ++编辑 linux 的文件
######sample 1:windows下安装pycharm并连接Linux的python环境 https://www.cnblogs.com/junxun/p/8287998.html wind ...
- Dev Express Report 学习总结(三)关于子报表Sub-Report的使用
子报表即在一个Report(主报表)中嵌入另一个Report(子报表),从理论上来讲,任何一个Report都可以作为一个子报表,但在实际使用过程中,只有主报表和子报表构成一对多关系时才会使用子报表.使 ...
- 3DSMAX 卸载
AUTODESK系列软件着实令人头疼,安装失败之后不能完全卸载!!!(比如maya,cad,3dsmax等).有时手动删除注册表重装之后还是会出现各种问题,每个版本的C++Runtime和.NET f ...