Closed Bug 1752347 Opened 4 years ago Closed 4 years ago

ESLint: Handle XPCOMUtils.define* using unary expressions when defining globals

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P3)

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: standard8, Assigned: standard8)

Details

Attachments

(1 file)

Currently, this works for ESLint to recognise it and define snapshot_overlap_limit as a global:

XPCOMUtils.defineLazyPreferenceGetter(
  this,
  "snapshot_overlap_limit",
  "browser.places.interactions.snapshotOverlapLimit",
  1000
);

However this version does not:

XPCOMUtils.defineLazyPreferenceGetter(
  this,
  "snapshot_overlap_limit",
  "browser.places.interactions.snapshotOverlapLimit",
  -1
);

The issue is that the -1 is a unary expression and our AST source handler is not handling those expressions.

Summary: ESLint: Fully handle XPCOMUtils.define* calls to define globals → ESLint: Handle XPCOMUtils.define* using unary expressions when defining globals
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36e6e0798fe9 ESLint: Handle XPCOMUtils.define* using unary expressions when defining globals. r=mossop
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: