Closed Bug 1887687 Opened 2 years ago Closed 1 years ago

reject-multiple-getters-calls should allow multiple calls when 3rd argument is used and `global` is different

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement

Tracking

(firefox126 fixed)

RESOLVED FIXED
Tracking Status
firefox126 --- fixed

People

(Reporter: ochameau, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See https://phabricator.services.mozilla.com/D203409?id=839207#inline-1137461
I had to disable the rule on the following legit usages of duplicated calls to defineESModuleGetters:

const lazy = {};
ChromeUtils.defineESModuleGetters(
  lazy,
  {
    isWindowGlobalPartOfContext:
      "resource://devtools/server/actors/watcher/browsing-context-helpers.sys.mjs",
    WindowGlobalLogger:
      "resource://devtools/server/connectors/js-window-actor/WindowGlobalLogger.sys.mjs",
  },
  { global: "contextual" }
);

// TargetActorRegistery has to be shared between all devtools instances
// and so is loaded into the shared global.
// eslint-disable-next-line mozilla/reject-multiple-getters-calls
ChromeUtils.defineESModuleGetters(
  lazy,
  {
    TargetActorRegistry:
      "resource://devtools/server/actors/targets/target-actor-registry.sys.mjs",
  },
  { global: "shared" }
);

Actually, going to add this to the post esm-ification work.

Blocks: 1776174
No longer blocks: esm-ification
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/a9b265a1368e Reflect global option to reject-multiple-getters-calls rule. r=Standard8,frontend-codestyle-reviewers,Gijs
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: