From 715c821c148b8aed3f518301d2166d04de435d00 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Tue, 1 May 2018 00:32:50 +0700 Subject: [PATCH] Updates * Bumped node requirement to >= 8.0.0 (due to async/await). * Moved ESLint config to .eslintrc.json. * Moved ESLint ignore to .eslintignore. * Bumped ESLint's ecmaVersion to 8, although it was probably already automatically set to that before. * Bugfix line 110 of albumsController.js. --- .eslintignore | 1 + .eslintrc.json | 44 +++++++++++++++++++++++++++++++++ controllers/albumsController.js | 2 +- package.json | 37 ++------------------------- 4 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..db181dd --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +**/*.min.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..20e31c2 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,44 @@ +{ + "root": true, + "parserOptions": { + "ecmaVersion": 8 + }, + "env": { + "node": true + }, + "extends": [ + "standard" + ], + "rules": { + "curly": [ + "error", + "all" + ], + "prefer-const": [ + "error", + { + "destructuring": "any", + "ignoreReadBeforeAssign": false + } + ], + "object-shorthand": [ + "error", + "always" + ], + "quotes": [ + "error", + "single" + ], + "no-var": "error" + }, + "overrides": [ + { + "files": [ + "public/**/*.js" + ], + "env": { + "browser": true + } + } + ] +} diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 6fe5c60..9dc2662 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -107,7 +107,7 @@ albumsController.getUniqueRandomName = () => { .where('identifier', identifier) .then(rows => { if (!rows || !rows.length) { return resolve(identifier) } - console.log(`An album with identifier ${name} already exists (${++i}/${maxTries}).`) + console.log(`An album with identifier ${identifier} already exists (${++i}/${maxTries}).`) if (i < maxTries) { return select(i) } // eslint-disable-next-line prefer-promise-reject-errors return reject('Sorry, we could not allocate a unique random identifier. Try again?') diff --git a/package.json b/package.json index 4f353a9..1088f57 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/WeebDev/lolisafe/issues" }, "engines": { - "node": ">=7.0.0" + "node": ">=8.0.0" }, "license": "MIT", "scripts": { @@ -43,38 +43,5 @@ }, "resolutions": { "chokidar": "^2.0.3" - }, - "eslintConfig": { - "env": { - "browser": true, - "node": true - }, - "extends": [ - "standard" - ], - "rules": { - "curly": [ - "error", - "all" - ], - "prefer-const": [ - "error", - { - "destructuring": "any", - "ignoreReadBeforeAssign": false - } - ], - "object-shorthand": [ - "error", - "always" - ], - "quotes": [ - "error", - "single" - ] - } - }, - "eslintIgnore": [ - "**/*.min.js" - ] + } }