Enable the ESLint no-caller rule across mozilla-central

RESOLVED FIXED in Firefox 57

Status

RESOLVED FIXED
a year ago
9 months ago

People

(Reporter: standard8, Assigned: dbugs, Mentored)

Tracking

Version 3
mozilla57

Firefox Tracking Flags

(firefox57 fixed)

Details

(Whiteboard: [lang=js])

Attachments

(1 attachment)

(Reporter)

Description

a year ago
We currently have no-caller enabled for a few directories, but we should expand it to the whole of the repository.

There's background on our eslint setups here:

https://developer.mozilla.org/docs/ESLint

Also, details of the rule: http://eslint.org/docs/rules/no-caller

Here's some approximate steps:

- Add a no-caller (error) line in recommended.js.
- Remove the no-caller related lines in the existing .eslintrc.js configs (apart from devtools/):

https://dxr.mozilla.org/mozilla-central/search?q=no-caller&redirect=false

- Run eslint to find the issues to fix:

./mach lint -l eslint

- Fix the failures (note: the ESLint rules page gives hints as to what needs changing)
- Create a commit and push it to mozreview:

http://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview.html
Comment hidden (mozreview-request)
(Reporter)

Comment 2

a year ago
mozreview-review
Comment on attachment 8900260 [details]
Bug 1392119 - Enable the ESLint no-caller rule across mozilla-central

https://reviewboard.mozilla.org/r/171652/#review176884

Almost there, just a few things to address.

::: browser/base/content/test/general/browser_bug432599.js:87
(Diff revision 1)
>  var removeElement = document.getElementById("editBookmarkPanelRemoveButton");
>  
>  function checkBookmarksPanel(invoker, phase) {
>    let onPopupShown = function(aEvent) {
>      if (aEvent.originalTarget == popupElement) {
> -      popupElement.removeEventListener("popupshown", arguments.callee);
> +      popupElement.removeEventListener("popupshown", checkBookmarksPanel);

This needs a function name inserting around line 85, e.g. popupShownListener

::: browser/base/content/test/general/browser_printpreview.js:57
(Diff revision 1)
>    executeSoon(function() {
>      if (gInPrintPreviewMode) {
>        executeSoon(aCallback);
>        return;
>      }
> -    executeSoon(arguments.callee);
> +    executeSoon(openPrintPreview);

Same as before.

::: browser/base/content/test/general/browser_printpreview.js:72
(Diff revision 1)
>      }
>      if (++count == 1000) {
>        // The test might fail.
>        PrintUtils.exitPrintPreview();
>      }
> -    executeSoon(arguments.callee);
> +    executeSoon(checkPrintPreviewClosed);

Same as before.

::: toolkit/content/widgets/toolbar.xml:140
(Diff revision 1)
>            if (document.readyState == "complete") {
>              this._init();
>            } else {
>              // Need to wait until XUL overlays are loaded. See bug 554279.
>              let self = this;
> -            document.addEventListener("readystatechange", function(event) {
> +            document.addEventListener("readystatechange", function listerner(event) {

nit: spelling

::: toolkit/content/widgets/toolbar.xml:143
(Diff revision 1)
>              // Need to wait until XUL overlays are loaded. See bug 554279.
>              let self = this;
> -            document.addEventListener("readystatechange", function(event) {
> +            document.addEventListener("readystatechange", function listerner(event) {
>                if (document.readyState != "complete")
>                  return;
> -              document.removeEventListener("readystatechange", arguments.callee);
> +              document.removeEventListener("readystatechange", listerner);

nit: spelling
Attachment #8900260 - Flags: review?(standard8)
Comment hidden (mozreview-request)
(Reporter)

Comment 4

a year ago
mozreview-review
Comment on attachment 8900260 [details]
Bug 1392119 - Enable the ESLint no-caller rule across mozilla-central

https://reviewboard.mozilla.org/r/171652/#review177544

Looks good, as long as try is green. r=Standard8
Attachment #8900260 - Flags: review?(standard8) → review+

Comment 5

a year ago
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c36031a6431b
Enable the ESLint no-caller rule across mozilla-central r=standard8
https://hg.mozilla.org/mozilla-central/rev/c36031a6431b
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57

Updated

9 months ago
Product: Testing → Firefox Build System
You need to log in before you can comment on or make changes to this bug.