summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/reject-multiple-getters-calls.rst
blob: 7ea048402bbbb8e6a89a39bcd8c31926f15bb9fc (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
reject-multiple-getters-calls
=============================

Rejects multiple calls on ``ChromeUtils.defineESModuleGetters`` for the same
target in the same context.

Examples of incorrect code for this rule:
-----------------------------------------

.. code-block:: js

    ChromeUtils.defineESModuleGetters(lazy, {
      AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
    });
    ChromeUtils.defineESModuleGetters(lazy, {
      PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
    });

Examples of correct code for this rule:
---------------------------------------

.. code-block:: js

    ChromeUtils.defineESModuleGetters(lazy, {
      AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
      PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
    });