From 93e8c59e37773a6a6c1be8f669df2d3d43748418 Mon Sep 17 00:00:00 2001 From: Dany Shaanan Date: Mon, 5 Jan 2015 14:10:33 +0200 Subject: [PATCH] added eslint rules: no-new-require, block-scoped-var and fixed errors --- .eslintrc | 4 ++-- src/reactTemplates.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index c8cd547..6206790 100644 --- a/.eslintrc +++ b/.eslintrc @@ -24,7 +24,7 @@ "no-mixed-requires": [0, false], "no-negated-in-lhs": 2, "no-nested-ternary": 2, - "no-new-require": 0, + "no-new-require": 2, "no-octal-escape": 2, "no-path-concat": 1, "no-process-exit": 2, @@ -47,7 +47,7 @@ "no-wrap-func": 2, "yoda": 2, - "block-scoped-var": 0, + "block-scoped-var": 2, "brace-style": [2, "1tbs", { "allowSingleLine": true }], "consistent-return": 2, "consistent-this": [0, "self", "TODO: add this options, remove this value in array"], diff --git a/src/reactTemplates.js b/src/reactTemplates.js index a0d85e9..c372830 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -78,7 +78,8 @@ function convertText(node, context, txt) { first = false; } var curlyCounter = 1; - for (var end = start + 1; end < txt.length && curlyCounter > 0; end++) { + var end; + for (end = start + 1; end < txt.length && curlyCounter > 0; end++) { curlyCounter += curlyMap[txt.charAt(end)] || 0; } if (curlyCounter !== 0) {