Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use eslint to enforce good const/let/var usage
Motivation: Currently the guidelines put this into the "linting won't catch this" section, because we've just been using plain semistandard. Modification: * Add prefer-const rule, which will force usage of const if an identifier is never reassigned. More info: http://eslint.org/docs/rules/prefer-const * Add no-use-before-define rule, which will prevent ReferenceErrors being thrown due to "temporal dead zone" issues with const/let. More info: http://eslint.org/docs/rules/no-use-before-define * Add block-scoped-var rule, which will force var to act like let. The current guidelines recommend against using var, and instead using let for mutable variables. Unfortunately, let currently doesn't perform as well as const or var: nodejs/node#8637 (comment) More info on this rule: http://eslint.org/docs/rules/block-scoped-var * Remove the recommendation to check for this manually.
- Loading branch information