Enable eslint no-undef for browser/

RESOLVED FIXED in Firefox 55

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

unspecified
Firefox 55
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(3 attachments)

Assignee

Description

2 years ago
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.
Assignee

Updated

2 years ago
Depends on: 1342462
Assignee

Updated

2 years ago
Depends on: 1342472
Assignee

Updated

2 years ago
Depends on: 909102
Assignee

Updated

2 years ago
Depends on: 1343945
Assignee

Updated

2 years ago
Depends on: 1344017
Assignee

Updated

2 years ago
Depends on: 1344027
Assignee

Updated

2 years ago
Depends on: 1345991
Assignee

Updated

2 years ago
Depends on: 1347642
Assignee

Comment 1

2 years ago
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).
Assignee

Updated

2 years ago
Depends on: 1350298
Assignee

Updated

2 years ago
Depends on: 1352969
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Assignee

Comment 8

2 years ago
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 hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 11

2 years ago
mozreview-review
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+
Assignee

Comment 12

2 years ago
(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 13

2 years ago
mozreview-review
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 14

2 years ago
mozreview-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+
Assignee

Comment 15

2 years ago
mozreview-review-reply
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).

Comment 16

2 years ago
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

Comment 17

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/28d99fb23327
https://hg.mozilla.org/mozilla-central/rev/88f6f749466f
https://hg.mozilla.org/mozilla-central/rev/ca3083864db1
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
You need to log in before you can comment on or make changes to this bug.