Closed Bug 1421968 Opened 2 years ago Closed 2 years ago

Enable ESLint rule mozilla/use-services by default, but whitelist it for various directories still to be fixed

Categories

(Firefox Build System :: Lint and Formatting, enhancement, P2)

3 Branch
enhancement

Tracking

(firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

Using the new glob based configuration can actually make it a lot simpler to roll out new rules to various areas without having to update lots of individual .eslintrc.js files.

We can enable the rule globally, but then disable it for specific directories. This gives us a couple of advantages:

- We can get it into the recommended configuration & roll it out to our github repositories sooner (and hence those that then are imported into m-c get fixed sooner).
- We have less places to look for working out where a rule is enabled or not.
- We have less .eslintrc.js churn in some areas, e.g. we won't need to keep creating them and removing them.
- Enabling ESLint on new directories, or creating new directories will more likely have the rule already enabled.

I'd like to kick this off using mozilla/use-services as an example. It is currently in the state that we can enable most of browser/ except for a few files.

It is already enabled for toolkit and services, which leaves a few more directories for whitelisting.
Blocks: 1421969
Comment on attachment 8933269 [details]
Bug 1421968 - Fix more instances of .getService to use Services.jsm where possible.

https://reviewboard.mozilla.org/r/204210/#review211106
Attachment #8933269 - Flags: review?(dtownsend) → review+
Comment on attachment 8933270 [details]
Bug 1421968 - Enable ESLint rule mozilla/use-services by default, but whitelist it for various directories still to be fixed.

https://reviewboard.mozilla.org/r/204212/#review211108
Attachment #8933270 - Flags: review?(dtownsend) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b1089f839d33
Fix more instances of .getService to use Services.jsm where possible. r=mossop
https://hg.mozilla.org/integration/autoland/rev/3abc6abd34bf
Enable ESLint rule mozilla/use-services by default, but whitelist it for various directories still to be fixed. r=mossop
https://hg.mozilla.org/mozilla-central/rev/b1089f839d33
https://hg.mozilla.org/mozilla-central/rev/3abc6abd34bf
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Depends on: 1425617
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.