Support eslint in XBL files

RESOLVED FIXED in Firefox 45

Status

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mossop, Assigned: mossop)

Tracking

unspecified
mozilla45
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox45 fixed)

Details

()

Attachments

(1 attachment)

We should be able to create (or find) an eslint plugin that preprocesses XBL files into lintable JS
Assignee

Updated

4 years ago
Assignee: nobody → dtownsend
Bug 1229858: Add a preprocessor to convert XBL into JavaScript blocks for eslint. r?miker
Attachment #8695038 - Flags: review?(mratcliffe)
Blocks: 1230776
Comment on attachment 8695038 [details]
MozReview Request: Bug 1229858: Add a preprocessor to convert XBL into JavaScript blocks for eslint. r?miker

https://reviewboard.mozilla.org/r/26965/#review24715

Awesome work, easy r+
Attachment #8695038 - Flags: review?(mratcliffe) → review+
This is breaking for me:

gkruitbosch-16516:fx-team gkruitbosch$ ./mach eslint browser/base/content/
 0:00.22 Running /usr/local/bin/eslint
 0:00.22 /usr/local/bin/eslint --ext [.js,.jsm,.jsx,.xml] browser/base/content/
/Users/gkruitbosch/dev/fx-team/testing/eslint-plugin-mozilla/lib/processors/xbl-bindings.js:12
const NS_XBL = "http://www.mozilla.org/xbl";
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/gkruitbosch/dev/fx-team/testing/eslint-plugin-mozilla/lib/index.js:17:13)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
Flags: needinfo?(dtownsend)
(In reply to :Gijs Kruitbosch from comment #4)
> This is breaking for me:

Which version of node are you running?
Flags: needinfo?(dtownsend) → needinfo?(gijskruitbosch+bugs)
So it seems like this code uses ES6 features only available in node >5. DO we have a policy on what node version we should support?
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(gps)
Depends on: 1231509

Comment 7

4 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6c9319ab4430
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Assignee

Updated

4 years ago
Depends on: 1231828
Turns out that the Gaia developers use the LTS version of node, 4.2.3 so we should probably standardise on that. Bug 1231867 will fix this code to work there.
Depends on: 1231867
Flags: needinfo?(gps)
You need to log in before you can comment on or make changes to this bug.