summaryrefslogtreecommitdiff
path: root/deps/node/deps/node-inspect/tools/eslint-rules/no-let-in-for-declaration.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/node-inspect/tools/eslint-rules/no-let-in-for-declaration.js')
-rw-r--r--deps/node/deps/node-inspect/tools/eslint-rules/no-let-in-for-declaration.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/deps/node/deps/node-inspect/tools/eslint-rules/no-let-in-for-declaration.js b/deps/node/deps/node-inspect/tools/eslint-rules/no-let-in-for-declaration.js
deleted file mode 100644
index 8b1a6783..00000000
--- a/deps/node/deps/node-inspect/tools/eslint-rules/no-let-in-for-declaration.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @fileoverview Prohibit the use of `let` as the loop variable
- * in the initialization of for, and the left-hand
- * iterator in forIn and forOf loops.
- *
- * @author Jessica Quynh Tran
- */
-
-'use strict';
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = {
- create(context) {
-
- const msg = 'Use of `let` as the loop variable in a for-loop is ' +
- 'not recommended. Please use `var` instead.';
-
- /**
- * Report function to test if the for-loop is declared using `let`.
- */
- function testForLoop(node) {
- if (node.init && node.init.kind === 'let') {
- context.report(node.init, msg);
- }
- }
-
- /**
- * Report function to test if the for-in or for-of loop
- * is declared using `let`.
- */
- function testForInOfLoop(node) {
- if (node.left && node.left.kind === 'let') {
- context.report(node.left, msg);
- }
- }
-
- return {
- 'ForStatement': testForLoop,
- 'ForInStatement': testForInOfLoop,
- 'ForOfStatement': testForInOfLoop
- };
- }
-};