blob: 4dc29f443127d8e8d3b3b1e0cf97c6acb77c9148 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
reject-eager-module-in-lazy-getter
==================================
Rejects defining a lazy getter for module that's known to be loaded early in the
startup process and it is not necessary to lazy load it.
Examples of incorrect code for this rule:
-----------------------------------------
.. code-block:: js
ChromeUtils.defineESModuleGetters(lazy, {
AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
XPCOMUtils: "resource://gre/modules/XPCOMUtils.jsm",
});
Examples of correct code for this rule:
---------------------------------------
.. code-block:: js
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
|