summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/var-only-at-top-level.rst
blob: d21fc1b299453e46dd92e6d042eb5bb7c53bff3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var-only-at-top-level
=====================

Marks all var declarations that are not at the top level invalid.

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

.. code-block:: js

    { var foo; }
    function() { var bar; }

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

.. code-block:: js

    var foo;
    { let foo; }
    function () { let bar; }