Closed Bug 1945458 Opened 7 months ago Closed 7 months ago

Add support for TypeScript definitions for pre-processed import AppConstants.sys.mjs

Categories

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

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: standard8, Assigned: zombie)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

TypeScript currently errors about AppConstants.sys.mjs imports:

js/xpconnect/loader/XPCOMUtils.sys.mjs:7:30 - error TS2792: Cannot find module 'resource://gre/modules/AppConstants.sys.mjs'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?

7 import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If we tell it about where the file is, then it can't handle it, as it is a pre-processed file.

We need to figure out a way of at least simulating the types defined in the file, and preferably automating the update if that is possible.

Assignee: nobody → tomica
Status: NEW → ASSIGNED
Pushed by tjovanovic@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7f74859ff2a1 Add substitution type declaration for pre-processeed AppConstants.sys.mjs r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Whiteboard: [addons-jira]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: