tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

valid-services-property.rst (755B)


      1 valid-services-property
      2 =======================
      3 
      4 Ensures that accesses of properties of items accessed via the ``Services``
      5 object are valid.
      6 
      7 This rule requires a full build to run, and is not turned on by default. To run
      8 this rule manually, use:
      9 
     10 .. code-block:: console
     11 
     12    MOZ_OBJDIR=objdir-ff-opt ./mach eslint --rule="mozilla/valid-services-property: error" *
     13 
     14 Examples of incorrect code for this rule:
     15 -----------------------------------------
     16 
     17 Assuming ``foo`` is not defined within ``Ci.nsISearchService``.
     18 
     19 .. code-block:: js
     20 
     21    Services.search.foo();
     22 
     23 Examples of correct code for this rule:
     24 ---------------------------------------
     25 
     26 Assuming ``bar`` is defined within ``Ci.nsISearchService``.
     27 
     28 .. code-block:: js
     29 
     30    Services.search.bar();