summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/use-console-createInstance.rst
blob: b505cfd8fb76caa7260ee963d6798df4b98c0b4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use-console-createInstance
==========================

Rejects usage of Console.sys.mjs or Log.sys.mjs, preferring use of
``console.createInstance`` instead. See `Javascript Logging </toolkit/javascript-logging.html>`__ for more information.

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

.. code-block:: js

    "resource://gre/modules/Console.sys.mjs"
    "resource://gre/modules/Log.sys.mjs"

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

.. code-block:: js

    console.createInstance({ prefix: "Foo" });