Source code
Revision control
Copy as Markdown
Other Tools
reject-chromeutils-import
================================
While ``ChromeUtils.import`` supports the fallback to ESMified module,
in-tree files should use ``ChromeUtils.importESModule`` for ESMified modules.
Examples of incorrect code for this rule:
-----------------------------------------
.. code-block:: js
ChromeUtils.defineModuleGetter(
XPCOMUtils.defineLazyModuleGetters(
Examples of correct code for this rule:
---------------------------------------
.. code-block:: js
ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs");
ChromeUtils.defineESModuleGetters(
obj, { AppConstants: "resource://gre/modules/AppConstants.sys.mjs" });