Add an ESLint rule to ensure that member property accesses of Services are valid
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Tracking
(firefox103 fixed)
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(5 files)
I believe we occasionally have issues where code is broken because of incorrect use of Services.
member property accesses.
We also have several existing in-tree at the moment.
As our ESLint plugin already knows about what services are available on Services
, it is reasonably simple to add a rule to check that these are correct. Whilst it is not really the responsibility of ESLint, it is the best tool that we have at the moment.
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
This makes the tests consistent with the rest of the code, and avoids errors from the new ESLint valid-services rule.
Depends on D149389
Assignee | ||
Comment 3•2 years ago
|
||
This makes the tests consistent with the rest of the code, and avoids errors from the new ESLint valid-services rule.
Depends on D149390
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D149391
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D149392
Assignee | ||
Comment 6•2 years ago
|
||
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2c7ef1ad380a Add some more interface types to components that are included in services. r=kmag https://hg.mozilla.org/integration/autoland/rev/76a32127865d Replace manual Services.cookiemgr definition with Services.cookies in netwerk cookies tests. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/cbba28151712 Replace manual definition of Services.cookiesvc with Services.cookies. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/01642c97e7a5 Add nsICookieService as an acceptable interface for Services.cookies. r=kmag https://hg.mozilla.org/integration/autoland/rev/5ff1634cfe18 Add an ESLint rule to ensure that member property accesses of Services are valid. r=Gijs
Comment 8•2 years ago
•
|
||
Backed out for causing lint failures on test_restrequest.js
Failure line(s): TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/services/common/tests/unit/test_restrequest.js:851:3 | 'Services' is not defined. (no-undef)
There are also some xpcshell failures caused by this push as seen here . Failure log xpcshell
Assignee | ||
Comment 9•2 years ago
|
||
Ah, this conflicted with bug 1773609 which landed a few hours before this. I'll fix.
Comment 10•2 years ago
|
||
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6e8dfdb7a82d Add some more interface types to components that are included in services. r=kmag https://hg.mozilla.org/integration/autoland/rev/4ba8be002536 Replace manual Services.cookiemgr definition with Services.cookies in netwerk cookies tests. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/3240fa10558b Replace manual definition of Services.cookiesvc with Services.cookies. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/91253ef3da4f Add nsICookieService as an acceptable interface for Services.cookies. r=kmag https://hg.mozilla.org/integration/autoland/rev/29d19ae2936c Add an ESLint rule to ensure that member property accesses of Services are valid. r=Gijs
Comment 11•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6e8dfdb7a82d
https://hg.mozilla.org/mozilla-central/rev/4ba8be002536
https://hg.mozilla.org/mozilla-central/rev/3240fa10558b
https://hg.mozilla.org/mozilla-central/rev/91253ef3da4f
https://hg.mozilla.org/mozilla-central/rev/29d19ae2936c
Updated•2 years ago
|
Description
•