From 898174426c913c919543c7f47cbeb89326adfe94 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Fri, 2 Aug 2019 00:57:39 +0800 Subject: [PATCH] refactor: fix lint on lib/config/index.js Signed-off-by: BoHong Li --- lib/config/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/config/index.js b/lib/config/index.js index 5a60c3a3..1dd9fbe7 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -53,14 +53,14 @@ if (['debug', 'verbose', 'info', 'warn', 'error'].includes(config.loglevel)) { // load LDAP CA if (config.ldap.tlsca) { - let ca = config.ldap.tlsca.split(',') - let caContent = [] - for (let i of ca) { - if (fs.existsSync(i)) { - caContent.push(fs.readFileSync(i, 'utf8')) + const certificateAuthorities = config.ldap.tlsca.split(',') + const caContent = [] + for (const ca of certificateAuthorities) { + if (fs.existsSync(ca)) { + caContent.push(fs.readFileSync(ca, 'utf8')) } } - let tlsOptions = { + const tlsOptions = { ca: caContent } config.ldap.tlsOptions = config.ldap.tlsOptions ? Object.assign(config.ldap.tlsOptions, tlsOptions) : tlsOptions @@ -134,10 +134,10 @@ config.isGitlabSnippetsEnable = (!config.gitlab.scope || config.gitlab.scope === config.updateI18nFiles = (env === Environment.development) // merge legacy values -let keys = Object.keys(config) +const keys = Object.keys(config) const uppercase = /[A-Z]/ for (let i = keys.length; i--;) { - let lowercaseKey = keys[i].toLowerCase() + const lowercaseKey = keys[i].toLowerCase() // if the config contains uppercase letters // and a lowercase version of this setting exists // and the config with uppercase is not set