testing/eslint-plugin-mozilla/docs/index.rst
author Michael Ratcliffe <mratcliffe@mozilla.com>
Wed, 30 Sep 2015 14:44:48 +0100
changeset 298688 4fd815c46a675085b7bb23fdd1cd91bf875cda19
child 303117 da7f20651f168a5a6c43a1930d2db827e3379f9e
permissions -rw-r--r--
Bug 1203520 - We need a DevTools ESLint plugin containing our ruleset r=gps

.. _index:

=====================
Mozilla ESLint Plugin
=====================

``components-imports`` adds the filename of imported files e.g.
``Cu.import("some/path/Blah.jsm")`` adds Blah to the global scope.

``import-headjs-globals`` imports globals from head.js and from any files that
should be imported by head.js (as far as we can correctly resolve the path).

``mark-test-function-used`` simply marks test (the test method) as used. This
avoids ESLint telling us that the function is never called.

+-------+-----------------------+
| Possible values for all rules |
+-------+-----------------------+
| Value | Meaning               |
+-------+-----------------------+
| 0     | Deactivated           |
+-------+-----------------------+
| 1     | Warning               |
+-------+-----------------------+
| 2     | Error                 |
+-------+-----------------------+

Example configuration::

   "rules": {
     "mozilla/components-imports": 1,
     "mozilla/import-headjs-globals": 1,
     "mozilla/mark-test-function-used": 1,
   }

.. toctree::
   :maxdepth: 1

   components-imports
   import-headjs-globals
   mark-test-function-used