Closed Bug 1466497 Opened 2 years ago Closed 2 years ago

Enable ESLint rule require-expected-throws-or-rejects for remaining directories

Categories

(Firefox :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 62
Tracking Status
firefox62 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(2 files)

This is continuing roll-out of require-expected-throws-or-rejects as per bug 1452706.
No longer depends on: 1465762
Comment on attachment 8983018 [details]
Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for head_devtools_inspector_sidebar.js.

This change is upsetting browser_ext_devtools_panels_elements_sidebar.js that seems to import the head file. Cancelling review whilst I take a look.
Attachment #8983018 - Flags: review?(jdescottes)
Comment on attachment 8983019 [details]
Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for storage/test/unit.

https://reviewboard.mozilla.org/r/248882/#review255226
Attachment #8983019 - Flags: review?(mak77) → review+
Comment on attachment 8983018 [details]
Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for head_devtools_inspector_sidebar.js.

https://reviewboard.mozilla.org/r/248880/#review255386

Thanks for the patch!

::: devtools/client/inspector/extensions/test/head_devtools_inspector_sidebar.js:42
(Diff revision 2)
>  // on the remote debugging server
>  // (used in browser_ext_devtools_panels_elements_sidebar.js).
>  async function expectNoSuchActorIDs(client, actors) {
>    info(`Test that all the objectValueGrip actors have been released`);
>    for (const actor of actors) {
> +    const re = new RegExp(`No such actor for ID: ${actor}`);

Could we do a string comparison rather than using a regexp built from string concatenation?
Attachment #8983018 - Flags: review?(jdescottes) → review+
Comment on attachment 8983018 [details]
Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for head_devtools_inspector_sidebar.js.

https://reviewboard.mozilla.org/r/248880/#review255386

> Could we do a string comparison rather than using a regexp built from string concatenation?

Yes, now that we're using the function form. I was getting too obsessed by RegExps :-)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c9c090ac9e24
Enable ESLint rule require-expected-throws-or-rejects for head_devtools_inspector_sidebar.js. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/e83a2d180ff5
Enable ESLint rule require-expected-throws-or-rejects for storage/test/unit. r=mak
https://hg.mozilla.org/mozilla-central/rev/c9c090ac9e24
https://hg.mozilla.org/mozilla-central/rev/e83a2d180ff5
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
You need to log in before you can comment on or make changes to this bug.