var-only-at-top-level.rst (423B)
1 var-only-at-top-level 2 ===================== 3 4 Marks all var declarations that are not at the top level invalid. 5 6 Examples of incorrect code for this rule: 7 ----------------------------------------- 8 9 .. code-block:: js 10 11 { var foo; } 12 function() { var bar; } 13 14 Examples of correct code for this rule: 15 --------------------------------------- 16 17 .. code-block:: js 18 19 var foo; 20 { let foo; } 21 function () { let bar; }