Closed Bug 1342459 Opened 8 years ago Closed 8 years ago

Enable eslint no-undef for browser/

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(3 files)

I'm working on a couple of patches to get no-undef enabled for all of browser/. It is already enabled for some of browser, but it is time to get it everywhere.
Depends on: 1342462
Depends on: 1342472
Depends on: 909102
Depends on: 1343945
Depends on: 1344017
Depends on: 1344027
Depends on: 1345991
Depends on: 1347642
For those watching, this is still in my queue - the remaining bit is browser/base. Currently I'm waiting on the bugs that block this, and also doing some more general refactoring of eslint-plugin-mozilla to make it easier to use elsewhere (bug 1347645).
Depends on: 1350298
Depends on: 1352969
I was going to wait a bit for these last patches, but it happened the other night in-between waiting for things. The patches I've just attached fix the last 100 or so issues in browser/base. I think there's more potential improvements to do for no-undef, and cleaning up some globals definitions, but they can wait whilst I get some other eslint issues sorted out.
Comment on attachment 8855239 [details] Bug 1342459 - Add a rule to automatically detect ContentTask.spawn and inject the relevant globals. https://reviewboard.mozilla.org/r/127100/#review129988 ::: tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-content-task-globals.js:32 (Diff revision 3) > + // --------------------------------------------------------------------------- > + // Public > + // --------------------------------------------------------------------------- > + > + return { > + "CallExpression[callee.object.name='ContentTask'][callee.property.name='spawn']": function(node) { Oh this is nice syntax, is that a new eslint feature?
Attachment #8855239 - Flags: review?(dtownsend) → review+
(In reply to Dave Townsend [:mossop] from comment #11) > > + "CallExpression[callee.object.name='ContentTask'][callee.property.name='spawn']": function(node) { > > Oh this is nice syntax, is that a new eslint feature? Yes, added in 3.18.0. I'm planning on rolling it out to wherever we can soon. http://eslint.org/blog/2017/03/eslint-v3.18.0-released
Comment on attachment 8855240 [details] Bug 1342459 - Enable no-undef on browser/base, and clean up unnecessary no-undef references. https://reviewboard.mozilla.org/r/127102/#review130066
Attachment #8855240 - Flags: review?(dtownsend) → review+
Comment on attachment 8855238 [details] Bug 1342459 - Fix various no-undef issues in browser/base. https://reviewboard.mozilla.org/r/127098/#review130048 I wonder if it would be easier to just define content as a global, but then we open the door for all the other window properties I guess.
Attachment #8855238 - Flags: review?(dtownsend) → review+
Comment on attachment 8855238 [details] Bug 1342459 - Fix various no-undef issues in browser/base. https://reviewboard.mozilla.org/r/127098/#review130048 Yeah, I did wonder about doing it differently, but the entire list of properties would be quite big (and also not appropriate in some files like .jsm).
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/28d99fb23327 Fix various no-undef issues in browser/base. r=mossop https://hg.mozilla.org/integration/autoland/rev/88f6f749466f Add a rule to automatically detect ContentTask.spawn and inject the relevant globals. r=mossop https://hg.mozilla.org/integration/autoland/rev/ca3083864db1 Enable no-undef on browser/base, and clean up unnecessary no-undef references. r=mossop
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: