summaryrefslogtreecommitdiff
path: root/lib/config
diff options
context:
space:
mode:
authorSheogorath2019-05-31 00:27:56 +0200
committerSheogorath2019-05-31 00:30:29 +0200
commit4da68597f701376307fe8849ed57edd3a80833ed (patch)
treefb50db25c63b3b2cb70426ba3eab42007be60134 /lib/config
parent3eca0a74ae3d87a42acb7c7b8e39e2c389e3c96c (diff)
Fix eslint warnings
Since we are about to release it's time to finally fix our linting. This patch basically runs eslint --fix and does some further manual fixes. Also it sets up eslint to fail on every warning on order to make warnings visable in the CI process. There should no functional change be introduced. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to 'lib/config')
-rw-r--r--lib/config/environment.js2
-rw-r--r--lib/config/hackmdEnvironment.js2
-rw-r--r--lib/config/index.js12
-rw-r--r--lib/config/oldEnvironment.js2
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 0a709745..d2350e72 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -1,6 +1,6 @@
'use strict'
-const {toBooleanConfig, toArrayConfig, toIntegerConfig} = require('./utils')
+const { toBooleanConfig, toArrayConfig, toIntegerConfig } = require('./utils')
module.exports = {
sourceURL: process.env.CMD_SOURCE_URL,
diff --git a/lib/config/hackmdEnvironment.js b/lib/config/hackmdEnvironment.js
index e5ffeb8a..dcfda0bc 100644
--- a/lib/config/hackmdEnvironment.js
+++ b/lib/config/hackmdEnvironment.js
@@ -1,6 +1,6 @@
'use strict'
-const {toBooleanConfig, toArrayConfig, toIntegerConfig} = require('./utils')
+const { toBooleanConfig, toArrayConfig, toIntegerConfig } = require('./utils')
module.exports = {
domain: process.env.HMD_DOMAIN,
diff --git a/lib/config/index.js b/lib/config/index.js
index e102dce9..b6001aa0 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -4,11 +4,11 @@
const crypto = require('crypto')
const fs = require('fs')
const path = require('path')
-const {merge} = require('lodash')
+const { merge } = require('lodash')
const deepFreeze = require('deep-freeze')
-const {Environment, Permission} = require('./enum')
+const { Environment, Permission } = require('./enum')
const logger = require('../logger')
-const {getGitCommit, getGitHubURL} = require('./utils')
+const { getGitCommit, getGitHubURL } = require('./utils')
const appRootPath = path.resolve(__dirname, '../../')
const env = process.env.NODE_ENV || Environment.development
@@ -17,7 +17,7 @@ const debugConfig = {
}
// Get version string from package.json
-const {version, repository} = require(path.join(appRootPath, 'package.json'))
+const { version, repository } = require(path.join(appRootPath, 'package.json'))
const commitID = getGitCommit(appRootPath)
const sourceURL = getGitHubURL(repository.url, commitID || version)
@@ -159,8 +159,8 @@ if (Object.keys(process.env).toString().indexOf('HMD_') !== -1) {
if (config.sessionSecret === 'secret') {
logger.warn('Session secret not set. Using random generated one. Please set `sessionSecret` in your config.js file. All users will be logged out.')
config.sessionSecret = crypto.randomBytes(Math.ceil(config.sessionSecretLen / 2)) // generate crypto graphic random number
- .toString('hex') // convert to hexadecimal format
- .slice(0, config.sessionSecretLen) // return required number of characters
+ .toString('hex') // convert to hexadecimal format
+ .slice(0, config.sessionSecretLen) // return required number of characters
}
// Validate upload upload providers
diff --git a/lib/config/oldEnvironment.js b/lib/config/oldEnvironment.js
index a3b13cb9..06047553 100644
--- a/lib/config/oldEnvironment.js
+++ b/lib/config/oldEnvironment.js
@@ -1,6 +1,6 @@
'use strict'
-const {toBooleanConfig} = require('./utils')
+const { toBooleanConfig } = require('./utils')
module.exports = {
debug: toBooleanConfig(process.env.DEBUG),