summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/valid-services.rst
blob: bd76cb52ac5074f9803bb67dec8eee2355512d8b (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
valid-services
==============

Ensures that accesses of the ``Services`` object are valid.
``Services`` are defined in ``tools/lint/eslint/eslint-plugin-mozilla/lib/services.json`` and can be added by copying from
``<objdir>/xpcom/components/services.json`` after a build.

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

Assuming ``foo`` is not defined within Services.

.. code-block:: js

    Services.foo.fn();

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

Assuming ``bar`` is defined within Services.

.. code-block:: js

    Services.bar.fn();