Closed Bug 1486739 Opened 3 years ago Closed 3 years ago

Enable ESLint rule comma-dangle for browser/, services/, taskcluster/ and toolkit/

Categories

(Toolkit :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(3 files)

As discussed on firefox-dev and dev.platform, we should require dangling commas for multi-line object/arrays in Javascript code for mozilla-central.

Why:

- Multiple components in toolkit/ and browser/ already have comma-dangle enabled.
- Having asked around in a few locations, I'm seeing support from the Firefox developer team and others in favour of enabling it.
- It helps make blame cleaner.
- It makes editing easier, and helps for a consistent style.
- Having automation available to cover the requirement reduces the need for review nits.

This bug is for the first half of the files, namely those in:

browser/
services/
taskcluster/
toolkit/

In the patches I'm effectively enabling the rule for ESLint by default, and then blacklisting the other directories.

I am hoping to land this bug on Friday 31 August (GMT timezone), ahead of the 63 merges.
Current stats: 1576 files changed, 7754 insertions(+), 7753 deletions(-)
Blocks: 1486741
Automatic changes by ESLint, except for manual corrections for .xml files.
Enable globally by default by blacklist directories outside of the ones we're enabling. Remove now unnecessary existing configurations.
Duplicate of this bug: 1476226
Comment on attachment 9004528 [details]
Bug 1486739 - Enable ESLint rule comma-dangle for browser/, services/, taskcluster/ and toolkit/ directories.

Dave Townsend [:mossop] has approved the revision.
Attachment #9004528 - Flags: review+
Comment on attachment 9004527 [details]
Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/.

Dave Townsend [:mossop] has approved the revision.
Attachment #9004527 - Flags: review+
Up to date try push with a couple of extra comma fixes. I'll be landing this tomorrow morning UK time.
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d7fcfbc15cfe
Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bc6d1a2d201
Enable ESLint rule comma-dangle for browser/, services/, taskcluster/ and toolkit/ directories. r=mossop
https://hg.mozilla.org/mozilla-central/rev/d7fcfbc15cfe
https://hg.mozilla.org/mozilla-central/rev/1bc6d1a2d201
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Commit pushed to master at https://github.com/mozilla/activity-stream

https://github.com/mozilla/activity-stream/commit/2076b6d27823afbdeef4abcfc0efe79a40acd13b
Port Bug 1486739 - Enable ESLint rule comma-dangle for browser/, services/, taskcluster/ and toolkit/ directories. r=mossop
You need to log in before you can comment on or make changes to this bug.