Bug 1479515 - Add an ESLint rule to check for unknown property accesses on Ci. r=Gijs

This is manually run and requires a full build. MOZ_OBJDIR needs to be set to point to the object directory.

Differential Revision: https://phabricator.services.mozilla.com/D156424
This commit is contained in:
Mark Banner
2022-09-12 16:38:43 +00:00
parent 7831137c5b
commit 418607ec92
8 changed files with 9458 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ The plugin implements the following rules:
eslint-plugin-mozilla/use-ownerGlobal
eslint-plugin-mozilla/use-returnValue
eslint-plugin-mozilla/use-services
eslint-plugin-mozilla/valid-ci-uses
eslint-plugin-mozilla/valid-lazy
eslint-plugin-mozilla/var-only-at-top-level

View File

@@ -0,0 +1,29 @@
valid-ci-uses
=============
Ensures that property access on ``Ci.<interface>`` are valid.
This rule requires a full build to run, and is not turned on by default. To run
this rule manually, use:
.. code-block:: console
MOZ_OBJDIR=objdir-ff-opt ./mach eslint --rule="mozilla/valid-ci-uses: error" *
Examples of incorrect code for this rule:
-----------------------------------------
``UNKNOWN_CONSTANT`` does not exist on nsIURIFixup.
.. code-block:: js
Ci.nsIURIFixup.UNKNOWN_CONSTANT
Examples of correct code for this rule:
---------------------------------------
``FIXUP_FLAG_NONE`` does exist on nsIURIFixup.
.. code-block:: js
Ci.nsIURIFixup.FIXUP_FLAG_NONE