From ee07b7241500229189c3a04866b8a28be944be54 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 28 Apr 2017 16:51:57 +0100 Subject: [PATCH] move eslintrc up a directory --- src/.eslintrc.json => .eslintrc.json | 0 Gruntfile.js | 10 +++++----- test/TestRegister.js | 4 ++-- test/index.js | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) rename src/.eslintrc.json => .eslintrc.json (100%) diff --git a/src/.eslintrc.json b/.eslintrc.json similarity index 100% rename from src/.eslintrc.json rename to .eslintrc.json diff --git a/Gruntfile.js b/Gruntfile.js index 1869130f..18dc35eb 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -92,13 +92,13 @@ module.exports = function (grunt) { }, function(error, result) { if (error) { if (error instanceof Error) { - done(error) + done(error); } else { - done(new Error(error)); + done(new Error(error)); } } else { - grunt.file.write("build/prod/cyberchef.htm", result); - done(true); + grunt.file.write("build/prod/cyberchef.htm", result); + done(true); } }); } @@ -113,7 +113,7 @@ module.exports = function (grunt) { }, eslint: { options: { - configFile: "src/.eslintrc.json" + configFile: "./.eslintrc.json" }, configs: ["Gruntfile.js"], core: ["src/core/**/*.js", "!src/core/lib/**/*"], diff --git a/test/TestRegister.js b/test/TestRegister.js index fdd3431b..3088c8fe 100644 --- a/test/TestRegister.js +++ b/test/TestRegister.js @@ -38,7 +38,7 @@ import Chef from "../src/core/Chef.js"; TestRegister.prototype.runTests = function() { return Promise.all( this.tests.map(function(test, i) { - var chef = new Chef(); + let chef = new Chef(); return Promise.resolve(chef.bake( test.input, @@ -48,7 +48,7 @@ import Chef from "../src/core/Chef.js"; false )) .then(function(result) { - var ret = { + let ret = { test: test, status: null, output: null, diff --git a/test/index.js b/test/index.js index 13d82b10..c5dbe074 100644 --- a/test/index.js +++ b/test/index.js @@ -18,7 +18,7 @@ import "./tests/operations/FlowControl.js"; import "./tests/operations/MorseCode.js"; import "./tests/operations/StrUtils.js"; -var allTestsPassing = true, +let allTestsPassing = true, testStatusCounts = { total: 0, }; @@ -31,7 +31,7 @@ var allTestsPassing = true, * @returns {string} */ function statusToIcon(status) { - var icons = { + let icons = { erroring: "🔥", failing: "❌", passing: "✔️️", @@ -47,7 +47,7 @@ function statusToIcon(status) { */ function handleTestResult(testResult) { allTestsPassing = allTestsPassing && testResult.status === "passing"; - var newCount = (testStatusCounts[testResult.status] || 0) + 1; + let newCount = (testStatusCounts[testResult.status] || 0) + 1; testStatusCounts[testResult.status] = newCount; testStatusCounts.total += 1; @@ -82,8 +82,8 @@ TestRegister.runTests() console.log("\n"); - for (var testStatus in testStatusCounts) { - var count = testStatusCounts[testStatus]; + for (let testStatus in testStatusCounts) { + let count = testStatusCounts[testStatus]; if (count > 0) { console.log(testStatus.toUpperCase(), count); }