From 95f9af2ba649ee5e247cd739fbd680bc78cb772b Mon Sep 17 00:00:00 2001
From: Sergio Zharinov <zharinov@users.noreply.github.com>
Date: Wed, 26 Aug 2020 16:59:50 +0400
Subject: [PATCH] refactor(config): Fix lint warnings (#7108)

---
 lib/config/migration.ts                   |  2 +-
 lib/config/presets/index.ts               |  8 ++++++--
 lib/config/validation-helpers/managers.ts |  4 ++--
 lib/config/validation.ts                  | 11 ++++++++---
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/lib/config/migration.ts b/lib/config/migration.ts
index 087511b501..ee9be62973 100644
--- a/lib/config/migration.ts
+++ b/lib/config/migration.ts
@@ -437,7 +437,7 @@ export function migrateConfig(
         is.array(val) &&
         val.length === 1
       ) {
-        migratedConfig[key] = `${val[0]}`;
+        migratedConfig[key] = String(val[0]);
       } else if (key === 'node' && (val as RenovateConfig).enabled === true) {
         isMigrated = true;
         delete migratedConfig.node.enabled;
diff --git a/lib/config/presets/index.ts b/lib/config/presets/index.ts
index dcfa9bdb3b..880394614f 100644
--- a/lib/config/presets/index.ts
+++ b/lib/config/presets/index.ts
@@ -195,10 +195,14 @@ export async function resolveConfigPresets(
     for (const preset of inputConfig.extends) {
       // istanbul ignore if
       if (existingPresets.includes(preset)) {
-        logger.debug(`Already seen preset ${preset} in ${existingPresets}`);
+        logger.debug(
+          `Already seen preset ${preset} in [${existingPresets.join(', ')}]`
+        );
       } else if (ignorePresets.includes(preset)) {
         // istanbul ignore next
-        logger.debug(`Ignoring preset ${preset} in ${existingPresets}`);
+        logger.debug(
+          `Ignoring preset ${preset} in [${existingPresets.join(', ')}]`
+        );
       } else {
         logger.trace(`Resolving preset "${preset}"`);
         let fetchedPreset: RenovateConfig;
diff --git a/lib/config/validation-helpers/managers.ts b/lib/config/validation-helpers/managers.ts
index 4933fb5617..53835b7a01 100644
--- a/lib/config/validation-helpers/managers.ts
+++ b/lib/config/validation-helpers/managers.ts
@@ -21,9 +21,9 @@ export function check({
       )
     ) {
       managersErrMessage = `${currentPath}:
-        You have included an unsupported manager in a package rule. Your list: ${
+        You have included an unsupported manager in a package rule. Your list: ${String(
           resolvedRule.managers
-        }.
+        )}.
         Supported managers are: (${getManagerList().join(', ')}).`;
     }
   } else if (typeof resolvedRule.managers !== 'undefined') {
diff --git a/lib/config/validation.ts b/lib/config/validation.ts
index 1b7fb9e76b..12429e340d 100644
--- a/lib/config/validation.ts
+++ b/lib/config/validation.ts
@@ -55,7 +55,10 @@ export async function validateConfig(
     return ignoredNodes.includes(key);
   }
 
-  function validateAliasObject(key: string, val: object): boolean {
+  function validateAliasObject(
+    key: string,
+    val: Record<string, unknown>
+  ): boolean {
     if (key === 'aliases') {
       for (const value of Object.values(val)) {
         if (!is.urlString(value)) {
@@ -285,7 +288,9 @@ export async function validateConfig(
                     } catch (e) {
                       errors.push({
                         depName: 'Configuration Error',
-                        message: `Invalid regExp for ${currentPath}: \`${matchString}\``,
+                        message: `Invalid regExp for ${currentPath}: \`${String(
+                          matchString
+                        )}\``,
                       });
                     }
                   }
@@ -357,7 +362,7 @@ export async function validateConfig(
             });
           }
         } else if (type === 'object' && currentPath !== 'compatibility') {
-          if (is.object(val)) {
+          if (is.plainObject(val)) {
             if (key === 'aliases') {
               if (!validateAliasObject(key, val)) {
                 errors.push({
-- 
GitLab