Enable no-use-before-define

Disallow Early Use (no-use-before-define)

In JavaScript, prior to ES6, variable and function declarations are
hoisted to the top of a scope, so it's possible to use identifiers
before their formal declarations in code. This can be confusing and
some believe it is best to always declare variables and functions
before using them.

In ES6, block-level bindings (let and const) introduce a "temporal
dead zone" where a ReferenceError will be thrown with any attempt to
access the variable before its declaration.

http://eslint.org/docs/rules/no-use-before-define

Change-Id: Ia905b77e0938ac3e0279712bc6e5ccdb18a102e7
This commit is contained in:
Diana Whitten 2015-08-27 17:00:44 -07:00
parent 36d8d9deb9
commit 91b9608ab1
1 changed files with 3 additions and 1 deletions

View File

@ -465,7 +465,9 @@ rules:
# Disallow use of variables before they are defined
# http://eslint.org/docs/rules/no-use-before-define
no-use-before-define: 0 # TODO(krotscheck): Discuss & Activate
no-use-before-define:
- 2
- "nofunc"
#############################################################################
# Node.js rules