From b8c4c19e98cb0e65d6ebf01e36d9456832f7cd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Valdemar=20M=C3=B8rch?= Date: Mon, 13 Dec 2021 15:38:47 +0100 Subject: [PATCH] feat(config): Fixed linter problems (#13035) --- .../{fileAsyncFunction.js => file-async-function.js} | 2 +- .../{fileFunctionPromise.js => file-function-promise.js} | 2 +- .../__fixtures__/{fileFunction.js => file-function.js} | 0 .../__fixtures__/{filePromise.js => file-promise.js} | 0 lib/workers/global/config/parse/file.spec.ts | 8 ++++---- lib/workers/global/config/parse/file.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename lib/workers/global/config/parse/__fixtures__/{fileAsyncFunction.js => file-async-function.js} (51%) rename lib/workers/global/config/parse/__fixtures__/{fileFunctionPromise.js => file-function-promise.js} (60%) rename lib/workers/global/config/parse/__fixtures__/{fileFunction.js => file-function.js} (100%) rename lib/workers/global/config/parse/__fixtures__/{filePromise.js => file-promise.js} (100%) diff --git a/lib/workers/global/config/parse/__fixtures__/fileAsyncFunction.js b/lib/workers/global/config/parse/__fixtures__/file-async-function.js similarity index 51% rename from lib/workers/global/config/parse/__fixtures__/fileAsyncFunction.js rename to lib/workers/global/config/parse/__fixtures__/file-async-function.js index 5e5888fa1f40cf..050c5c7d10ec2d 100644 --- a/lib/workers/global/config/parse/__fixtures__/fileAsyncFunction.js +++ b/lib/workers/global/config/parse/__fixtures__/file-async-function.js @@ -1,4 +1,4 @@ -// This is functionally equivalent to fileFunctionPromise.js but syntactically different +// This is functionally equivalent to file-function-promise.js but syntactically different // @ts-ignore module.exports = async function () { diff --git a/lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js b/lib/workers/global/config/parse/__fixtures__/file-function-promise.js similarity index 60% rename from lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js rename to lib/workers/global/config/parse/__fixtures__/file-function-promise.js index bf5c11affb5e15..aefa3db9cd3eae 100644 --- a/lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js +++ b/lib/workers/global/config/parse/__fixtures__/file-function-promise.js @@ -1,4 +1,4 @@ -// This is functionally equivalent to fileAsyncFunction.js but syntactically different +// This is functionally equivalent to file-async-function.js but syntactically different // @ts-ignore module.exports = function () { diff --git a/lib/workers/global/config/parse/__fixtures__/fileFunction.js b/lib/workers/global/config/parse/__fixtures__/file-function.js similarity index 100% rename from lib/workers/global/config/parse/__fixtures__/fileFunction.js rename to lib/workers/global/config/parse/__fixtures__/file-function.js diff --git a/lib/workers/global/config/parse/__fixtures__/filePromise.js b/lib/workers/global/config/parse/__fixtures__/file-promise.js similarity index 100% rename from lib/workers/global/config/parse/__fixtures__/filePromise.js rename to lib/workers/global/config/parse/__fixtures__/file-promise.js diff --git a/lib/workers/global/config/parse/file.spec.ts b/lib/workers/global/config/parse/file.spec.ts index d37811e1928f44..d673a72c99e3b8 100644 --- a/lib/workers/global/config/parse/file.spec.ts +++ b/lib/workers/global/config/parse/file.spec.ts @@ -19,16 +19,16 @@ describe('workers/global/config/parse/file', () => { describe('.getConfig()', () => { it.each([ ['custom js config file', 'file.js'], - ['custom js config file exporting a Promise', 'filePromise.js'], - ['custom js config file exporting a function', 'fileFunction.js'], + ['custom js config file exporting a Promise', 'file-promise.js'], + ['custom js config file exporting a function', 'file-function.js'], // The next two are different syntactic ways of expressing the same thing [ 'custom js config file exporting a function returning a Promise', - 'fileFunctionPromise.js', + 'file-function-promise.js', ], [ 'custom js config file exporting an async function', - 'fileAsyncFunction.js', + 'file-async-function.js', ], ['JSON5 config file', 'config.json5'], ['YAML config file', 'config.yaml'], diff --git a/lib/workers/global/config/parse/file.ts b/lib/workers/global/config/parse/file.ts index 476f0bda322e85..24a0e31df7d6c0 100644 --- a/lib/workers/global/config/parse/file.ts +++ b/lib/workers/global/config/parse/file.ts @@ -1,3 +1,4 @@ +import is from 'is'; import { load } from 'js-yaml'; import JSON5 from 'json5'; import upath from 'upath'; @@ -5,7 +6,6 @@ import { migrateConfig } from '../../../../config/migration'; import type { AllConfig, RenovateConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; import { readFile } from '../../../../util/fs'; -import is from 'is'; export async function getParsedContent(file: string): Promise { switch (upath.extname(file)) {