Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368207

Summary: Upgrade JSLint
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 0.4   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Mark Macdonald CLA 2012-01-09 19:02:06 EST
To fix Bug 367639, we need to pick up a more recent version of JSLint. We want to get this fix: 

https://github.com/douglascrockford/JSLint/issues/67
Comment 1 Mark Macdonald CLA 2012-01-10 10:51:12 EST
The 2011-12-21 version of JSLint is more stringent than our current one. We need to pass it these options to get roughly the same validation result as we get now:

> nomen:true    (allow leading/trailing _ in variable names)
> plusplus:true (allow ++ and --)
> sloppy:true   (don't require 'use strict')
> white:true    (allow reasonable whitespace)
> vars:true     (allow more than one 'var' statement per function)
Comment 2 Mark Macdonald CLA 2012-01-10 11:03:03 EST
It also has many more things that are considered fatal errors (meaning the parser stops and doesn't report anything beyond that point).

For example, this blows up (with a very confusing message) when 'foo' is never referenced as a global in the file:
> /*global foo*/ 

Declaration a variable inside a 'for' loop is also a fatal error:
> function f () {
>   for (var i;;) {}
> }
Comment 3 Felipe Heidrich CLA 2012-01-11 13:47:07 EST
out of curiosity, is there any new feature in this version of JSLint that matters to us (besides fixing 367639) ?
Comment 4 Mark Macdonald CLA 2012-01-18 15:36:14 EST
(In reply to comment #3)
> out of curiosity, is there any new feature in this version of JSLint that
> matters to us (besides fixing 367639) ?

It does have some new validation features but I'm not sure they're worth the effort. Since Bug 367639 has been fixed with our current version of JSLint, let's pass on the upgrade.