Bug 422630 - Adapt ESLint to run on scripts embedded in HTML files
Summary: Adapt ESLint to run on scripts embedded in HTML files
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 5.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 6.0 M1   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on: 414779
Blocks:
  Show dependency tree
 
Reported: 2013-11-27 00:43 EST by Mark Macdonald CLA
Modified: 2014-03-13 12:31 EDT (History)
1 user (show)

See Also:


Attachments
proposed fix (6.97 KB, patch)
2014-03-12 15:38 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2013-11-27 00:43:32 EST
JSLint will validate the contents of <script> tags that appear in an HTML file.

Orion should be able to execute the ESLint engine on these scripts. The user should receive consistent validation whether they are editing standalone or embedded JS.
Comment 1 Michael Rennie CLA 2014-03-12 15:38:50 EDT
Created attachment 240830 [details]
proposed fix

This patch allows eslint to validate <script> blocks in HTML files. It also removes the jslint pref to use jslint for js files.
Comment 2 Mark Macdonald CLA 2014-03-12 19:33:17 EDT
Took a quick look and I think this is OK. 

With this patch in place, we can actually delete jslintPlugin and jslintworker, right?
Comment 3 Michael Rennie CLA 2014-03-13 11:06:29 EDT
(In reply to Mark Macdonald from comment #2)
> Took a quick look and I think this is OK. 
>

Thanks for taking some time to look at this Mark. I found an issue with the offsets when you have whitespace before the closing '>' in a script tag. I'll patch that up today.
 
> With this patch in place, we can actually delete jslintPlugin and
> jslintworker, right?

No, it is still used to lint HTML and JSON and provides an HTML outline. If we decide that we don't care about any of that, then yes, we can turf it.
Comment 5 Mark Macdonald CLA 2014-03-13 12:31:52 EDT
(In reply to Michael Rennie from comment #3)
> No, it is still used to lint HTML and JSON and provides an HTML outline. If
> we decide that we don't care about any of that, then yes, we can turf it.

Oh right. I have some thoughts on this, I opened bug 430301 for it.