This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 414779 - Use ESLint for JavaScript validation instead of JSLint
Summary: Use ESLint for JavaScript validation instead of JSLint
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 5.0 M1   Edit
Assignee: Mark Macdonald CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 422161 422162
Blocks: 422630
  Show dependency tree
 
Reported: 2013-08-09 09:52 EDT by Mark Macdonald CLA
Modified: 2013-11-27 00:44 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2013-08-09 09:52:58 EDT
We should move to ESLint as our tool for checking JavaScript code.

Advantages are:

* Built on Esprima
This makes it feasible to share a single AST between our current Esprima-based Content Assist and ESLint, instead of parsing the same code multiple times.

* Uses an extensible set of validation rules
Unwanted rules can be disabled, new rules can be plugged in.
  
* Plain MIT license


Project page: https://github.com/nzakas/eslint/

Opened CQ 7466 for this.
Comment 1 Mark Macdonald CLA 2013-08-09 10:03:18 EDT
ESLint has the following runtime dependencies, which we will have to distribute as well:
* esprima (already distributed in Orion; no action required)
* estraverse (opened CQ 7523)
* escope (opened CQ 7522)
Comment 2 Mark Macdonald CLA 2013-08-09 17:35:27 EDT
Note that ESLint does not handle HTML files, whereas JSLint does. 

We'd have to write some supporting code that extracts <script> tags from an HTML document and feeds them to ESLint.
Comment 3 Mark Macdonald CLA 2013-09-26 12:54:31 EDT
We've obtained approval to use the core of ESLint -- however the contributed rules are problematic, due to their many authors.
Comment 4 Mark Macdonald CLA 2013-11-13 17:00:48 EST
Let's flip the switch in 5.0M1 and feel the pain
Comment 5 Mark Macdonald CLA 2013-11-15 10:35:24 EST
Added a Wiki page for this work:
https://wiki.eclipse.org/Orion/5.0/Replacing_JSLint
Comment 6 Mark Macdonald CLA 2013-11-27 00:14:28 EST
Pushed
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=4da74be

ESLint is now enabled by default, and JSLint is disabled by default. (You can change this in Settings > Validation.)

Calling this bug fixed. I will open separate bugs dealing with specific bugs or features we need.
Comment 7 Mark Macdonald CLA 2013-11-27 00:40:47 EST
Released additional change to server repo to update the RequireJS module paths used by the PDE build:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=e894ee1

And reenabling JSLint for HTML files only
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3ee1743