* 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.
This commit is contained in:
Bobby Wibowo 2018-05-01 00:32:50 +07:00
parent 31ef82d37d
commit 715c821c14
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
4 changed files with 48 additions and 36 deletions

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
**/*.min.js

44
.eslintrc.json Normal file
View File

@ -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
}
}
]
}

View File

@ -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?')

View File

@ -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"
]
}
}