diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20f34b1428a066aeac3f3fe7177abd3af8defa35..40e9f9eb44fb0a19b3a34698534bbf5b62a1203e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -344,6 +344,8 @@ jobs: - name: Unit tests shell: bash + env: + NODE_OPTIONS: --experimental-vm-modules run: | for shard in ${{ matrix.shards }}; do diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 31b295cf4d7e24d9d655b95896c4b65927f82809..074fdee1ceeff736cf76e48c22d1d8edddd4a506 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -189,9 +189,8 @@ describe('config/validation', () => { }, major: null, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(3); expect(errors).toMatchSnapshot(); @@ -206,9 +205,8 @@ describe('config/validation', () => { }, ], }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(1); expect(errors[0].message).toContain('ansible'); @@ -242,9 +240,8 @@ describe('config/validation', () => { }, ], ])('validates enabled managers for %s', async (_case, config) => { - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(0); }); @@ -259,9 +256,8 @@ describe('config/validation', () => { ])( 'errors if included not supported enabled managers for %s', async (_case, config) => { - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(1); expect(errors).toMatchSnapshot(); @@ -299,9 +295,8 @@ describe('config/validation', () => { ], major: null, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(1); expect(errors).toMatchSnapshot(); expect(errors).toHaveLength(15); @@ -327,9 +322,8 @@ describe('config/validation', () => { }, }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(4); expect(errors).toMatchSnapshot(); expect(errors).toHaveLength(4); @@ -363,9 +357,8 @@ describe('config/validation', () => { fileMatch: ['x?+'], }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(2); expect(errors).toMatchSnapshot(); @@ -692,9 +685,8 @@ describe('config/validation', () => { example2: 'https://www.example2.com/example', }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(0); }); @@ -707,9 +699,8 @@ describe('config/validation', () => { } as unknown as string, // intentional incorrect config to check error message }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toMatchObject([ { @@ -727,9 +718,8 @@ describe('config/validation', () => { example2: 'http://www.example.com', }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toMatchObject([ { @@ -759,9 +749,8 @@ describe('config/validation', () => { }, ], }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(errors).toHaveLength(1); expect(warnings).toHaveLength(1); expect(errors).toMatchSnapshot(); @@ -779,9 +768,8 @@ describe('config/validation', () => { }, }, } as never; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(errors).toHaveLength(1); expect(warnings).toHaveLength(0); expect(errors).toMatchSnapshot(); @@ -791,9 +779,8 @@ describe('config/validation', () => { const config = { hostType: 'npm', }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(errors).toHaveLength(0); expect(warnings).toHaveLength(1); expect(warnings).toMatchSnapshot(); @@ -869,9 +856,8 @@ describe('config/validation', () => { example2: 'https://www.example2.com/example', }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(0); }); @@ -883,9 +869,8 @@ describe('config/validation', () => { example2: 123, }, }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toMatchObject([ { @@ -900,9 +885,8 @@ describe('config/validation', () => { const config = { schedule: ['30 5 * * *'], }; - const { warnings, errors } = await configValidation.validateConfig( - config, - ); + const { warnings, errors } = + await configValidation.validateConfig(config); expect(warnings).toHaveLength(0); expect(errors).toMatchObject([ { diff --git a/lib/modules/datasource/conan/index.ts b/lib/modules/datasource/conan/index.ts index 1a1fd2e9826105b8889ee7d096cdd4100eb194c1..b8cc3d77d3a21b41f2d5fbfd0d882b810162fef9 100644 --- a/lib/modules/datasource/conan/index.ts +++ b/lib/modules/datasource/conan/index.ts @@ -91,9 +91,8 @@ export class ConanDatasource extends Datasource { conanPackage.userAndChannel, '/revisions', ); - const revisionRep = await this.http.getJson<ConanRevisionsJSON>( - revisionLookUp, - ); + const revisionRep = + await this.http.getJson<ConanRevisionsJSON>(revisionLookUp); const revisions = revisionRep?.body.revisions; return revisions?.[0].revision ?? null; } @@ -180,9 +179,8 @@ export class ConanDatasource extends Datasource { url, `v2/conans/${conanPackage.conanName}/${latestVersion}/${conanPackage.userAndChannel}/latest`, ); - const revResp = await this.http.getJson<ConanRevisionJSON>( - latestRevisionUrl, - ); + const revResp = + await this.http.getJson<ConanRevisionJSON>(latestRevisionUrl); const packageRev = revResp.body.revision; const [user, channel] = conanPackage.userAndChannel.split('/'); @@ -190,9 +188,8 @@ export class ConanDatasource extends Datasource { `${groups.host}/artifactory/api/storage/${groups.repo}`, `${user}/${conanPackage.conanName}/${latestVersion}/${channel}/${packageRev}/export/conanfile.py?properties=conan.package.url`, ); - const packageUrlResp = await this.http.getJson<ConanProperties>( - packageUrl, - ); + const packageUrlResp = + await this.http.getJson<ConanProperties>(packageUrl); if ( packageUrlResp.body.properties && diff --git a/lib/modules/datasource/cpan/index.ts b/lib/modules/datasource/cpan/index.ts index ee8a808da54bf94750a46f381137233fb44d31cb..777da99563f7a74bb6ef796b8c943a4d3c87b611 100644 --- a/lib/modules/datasource/cpan/index.ts +++ b/lib/modules/datasource/cpan/index.ts @@ -79,9 +79,8 @@ export class CpanDatasource extends Datasource { deprecated: isDeprecated, maturity, } = hit; - const version = module.find( - ({ name }) => name === packageName, - )?.version; + const version = module.find(({ name }) => name === packageName) + ?.version; if (version) { // https://metacpan.org/pod/CPAN::DistnameInfo#maturity const isStable = maturity === 'released'; diff --git a/lib/modules/datasource/galaxy-collection/index.ts b/lib/modules/datasource/galaxy-collection/index.ts index dcd4ceca31734e1063322f3880fbe3bad98e48d6..7ea6363022f844d835c1ddfda370624e59f8e649 100644 --- a/lib/modules/datasource/galaxy-collection/index.ts +++ b/lib/modules/datasource/galaxy-collection/index.ts @@ -59,9 +59,8 @@ export class GalaxyCollectionDatasource extends Datasource { let versionsUrlResponse: HttpResponse<VersionsProjectResult>; try { - versionsUrlResponse = await this.http.getJson<VersionsProjectResult>( - versionsUrl, - ); + versionsUrlResponse = + await this.http.getJson<VersionsProjectResult>(versionsUrl); } catch (err) { this.handleGenericErrors(err); } diff --git a/lib/modules/datasource/go/releases-direct.ts b/lib/modules/datasource/go/releases-direct.ts index b9cb6c2e092d73cc1351d044392c188840b235b2..e419898fb5dddfccbda537f81fff5e7520400cfd 100644 --- a/lib/modules/datasource/go/releases-direct.ts +++ b/lib/modules/datasource/go/releases-direct.ts @@ -126,8 +126,8 @@ export class GoDirectDatasource extends Datasource { } if (res.releases) { - res.releases = res.releases.filter((release) => - release.version?.startsWith('v'), + res.releases = res.releases.filter( + (release) => release.version?.startsWith('v'), ); } diff --git a/lib/modules/datasource/nuget/common.ts b/lib/modules/datasource/nuget/common.ts index 55ce19a78f768b34b4485a12ae28520f7110b82b..cc9db0aee350a40aa56acee8a24b61f089d381d4 100644 --- a/lib/modules/datasource/nuget/common.ts +++ b/lib/modules/datasource/nuget/common.ts @@ -33,9 +33,8 @@ export function parseRegistryUrl(registryUrl: string): ParsedRegistryUrl { return { feedUrl: registryUrl, protocolVersion: null }; } let protocolVersion = 2; - const protocolVersionMatch = protocolVersionRegExp.exec( - parsedUrl.hash, - )?.groups; + const protocolVersionMatch = protocolVersionRegExp.exec(parsedUrl.hash) + ?.groups; if (protocolVersionMatch) { const { protocol } = protocolVersionMatch; parsedUrl.hash = ''; diff --git a/lib/modules/datasource/terraform-provider/index.ts b/lib/modules/datasource/terraform-provider/index.ts index 09cb34092dcb9177e8ac2102ae2047db42a78226..d52a78198b1652f0d9d18e83bd127a5105c677db 100644 --- a/lib/modules/datasource/terraform-provider/index.ts +++ b/lib/modules/datasource/terraform-provider/index.ts @@ -67,9 +67,8 @@ export class TerraformProviderDatasource extends TerraformDatasource { const repository = TerraformProviderDatasource.getRepository({ packageName, }); - const serviceDiscovery = await this.getTerraformServiceDiscoveryResult( - registryUrl, - ); + const serviceDiscovery = + await this.getTerraformServiceDiscoveryResult(registryUrl); if (registryUrl === this.defaultRegistryUrls[0]) { return await this.queryRegistryExtendedApi( @@ -220,9 +219,8 @@ export class TerraformProviderDatasource extends TerraformDatasource { } // check public or private Terraform registry - const serviceDiscovery = await this.getTerraformServiceDiscoveryResult( - registryURL, - ); + const serviceDiscovery = + await this.getTerraformServiceDiscoveryResult(registryURL); if (!serviceDiscovery) { logger.trace(`Failed to retrieve service discovery from ${registryURL}`); return null; diff --git a/lib/modules/manager/asdf/upgradeable-tooling.ts b/lib/modules/manager/asdf/upgradeable-tooling.ts index 983703b9927c798090529068986b9fc0d642f279..1877ff5d9988f4d65c382ef3e1235e83717dc596 100644 --- a/lib/modules/manager/asdf/upgradeable-tooling.ts +++ b/lib/modules/manager/asdf/upgradeable-tooling.ts @@ -297,9 +297,8 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = { currentValue: semeruJreMatches.version, }; } - const temurinJdkMatches = version.match( - /^temurin-(?<version>\d\S+)/, - )?.groups; + const temurinJdkMatches = version.match(/^temurin-(?<version>\d\S+)/) + ?.groups; if (temurinJdkMatches) { return { datasource: JavaVersionDatasource.id, @@ -307,9 +306,8 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = { currentValue: temurinJdkMatches.version, }; } - const temurinJreMatches = version.match( - /^temurin-jre-(?<version>\d\S+)/, - )?.groups; + const temurinJreMatches = version.match(/^temurin-jre-(?<version>\d\S+)/) + ?.groups; if (temurinJreMatches) { return { datasource: JavaVersionDatasource.id, diff --git a/lib/modules/manager/bazel-module/bazelrc.ts b/lib/modules/manager/bazel-module/bazelrc.ts index 4ea652988d464cd486410c4e3c8c2c45e953cd45..39de1fab86074c7c9125576edefc61e357f46003 100644 --- a/lib/modules/manager/bazel-module/bazelrc.ts +++ b/lib/modules/manager/bazel-module/bazelrc.ts @@ -12,11 +12,17 @@ const spaceRegex = regEx(`\\s+`); export class ImportEntry { readonly entryType = 'import'; - constructor(readonly path: string, readonly isTry: boolean) {} + constructor( + readonly path: string, + readonly isTry: boolean, + ) {} } export class BazelOption { - constructor(readonly name: string, readonly value?: string) {} + constructor( + readonly name: string, + readonly value?: string, + ) {} static parse(input: string): BazelOption[] { const options: BazelOption[] = []; diff --git a/lib/modules/manager/composer/schema.ts b/lib/modules/manager/composer/schema.ts index e1d9ffa47fd45553607691aa67bfa7dacaca56f1..ca074dad97b665b26e3e6a1d4518f6bbed75af5f 100644 --- a/lib/modules/manager/composer/schema.ts +++ b/lib/modules/manager/composer/schema.ts @@ -309,9 +309,8 @@ export const ComposerExtract = z const gitRepo = gitRepos[depName]; if (gitRepo) { - const bitbucketMatchGroups = bitbucketUrlRegex.exec( - gitRepo.url, - )?.groups; + const bitbucketMatchGroups = bitbucketUrlRegex.exec(gitRepo.url) + ?.groups; if (bitbucketMatchGroups) { dep.datasource = BitbucketTagsDatasource.id; diff --git a/lib/modules/manager/dockerfile/extract.spec.ts b/lib/modules/manager/dockerfile/extract.spec.ts index 606ca371acdea5c34798b2585f6581b5c4d31b2d..9c47215ae70a61fbe81df68b0ac170e14c79e965 100644 --- a/lib/modules/manager/dockerfile/extract.spec.ts +++ b/lib/modules/manager/dockerfile/extract.spec.ts @@ -108,11 +108,8 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles from as', () => { - const res = extractPackageFile( - 'FROM node:8.9.0-alpine as base\n', - '', - {}, - )?.deps; + const res = extractPackageFile('FROM node:8.9.0-alpine as base\n', '', {}) + ?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: @@ -724,11 +721,8 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles FROM without ARG default value', () => { - const res = extractPackageFile( - 'ARG img_base\nFROM $img_base\n', - '', - {}, - )?.deps; + const res = extractPackageFile('ARG img_base\nFROM $img_base\n', '', {}) + ?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: diff --git a/lib/modules/manager/maven-wrapper/artifacts.ts b/lib/modules/manager/maven-wrapper/artifacts.ts index cd9b21035f9a3c883021e2d14014fe6b65f2b111..4d1e9fcc16a531cbe84788baf1bc9e296f71bb93 100644 --- a/lib/modules/manager/maven-wrapper/artifacts.ts +++ b/lib/modules/manager/maven-wrapper/artifacts.ts @@ -176,9 +176,8 @@ function getExtraEnvOptions(deps: PackageDependency[]): ExtraEnv { function getCustomMavenWrapperRepoUrl( deps: PackageDependency[], ): string | null { - const replaceString = deps.find( - (dep) => dep.depName === 'maven-wrapper', - )?.replaceString; + const replaceString = deps.find((dep) => dep.depName === 'maven-wrapper') + ?.replaceString; if (!replaceString) { return null; diff --git a/lib/modules/manager/npm/extract/post/monorepo.spec.ts b/lib/modules/manager/npm/extract/post/monorepo.spec.ts index 07c79f83c648aeaa141cb82b6618ca11c15f312c..7adce0b7a2f81f8e75433347222c38dd063db894 100644 --- a/lib/modules/manager/npm/extract/post/monorepo.spec.ts +++ b/lib/modules/manager/npm/extract/post/monorepo.spec.ts @@ -65,8 +65,8 @@ describe('modules/manager/npm/extract/post/monorepo', () => { ]; await detectMonorepos(packageFiles); expect( - packageFiles.some((packageFile) => - packageFile.deps?.some((dep) => dep.isInternal), + packageFiles.some( + (packageFile) => packageFile.deps?.some((dep) => dep.isInternal), ), ).toBeTrue(); }); diff --git a/lib/modules/manager/terraform/lockfile/hash.ts b/lib/modules/manager/terraform/lockfile/hash.ts index 62357e30fe75b7cbd1bb27f276592cb87e0ce5e4..e6f9fdddc708e898d6571ab331ae3fa4f9d05d78 100644 --- a/lib/modules/manager/terraform/lockfile/hash.ts +++ b/lib/modules/manager/terraform/lockfile/hash.ts @@ -123,9 +123,8 @@ export class TerraformProviderHash { )) ?? []; } - const h1Hashes = await TerraformProviderHash.calculateHashScheme1Hashes( - builds, - ); + const h1Hashes = + await TerraformProviderHash.calculateHashScheme1Hashes(builds); const hashes = []; hashes.push(...h1Hashes.map((hash) => `h1:${hash}`)); diff --git a/lib/modules/platform/azure/azure-helper.spec.ts b/lib/modules/platform/azure/azure-helper.spec.ts index 4707ef8560f6004b5eb19f474a85b464e6562f23..1e7a722ab38f6b1eaf5d521c0c6df0b90a48c576 100644 --- a/lib/modules/platform/azure/azure-helper.spec.ts +++ b/lib/modules/platform/azure/azure-helper.spec.ts @@ -20,7 +20,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getRefs: jest.fn(() => [{ objectId: 132 }]), - } as any), + }) as any, ); const res = await azureHelper.getRefs('123', 'branch'); expect(res).toMatchSnapshot(); @@ -31,7 +31,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getRefs: jest.fn(() => []), - } as any), + }) as any, ); const res = await azureHelper.getRefs('123'); expect(res).toHaveLength(0); @@ -42,7 +42,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getRefs: jest.fn(() => [{ objectId: '132' }]), - } as any), + }) as any, ); const res = await azureHelper.getRefs('123', 'refs/head/branch1'); expect(res).toMatchSnapshot(); @@ -55,7 +55,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getRefs: jest.fn(() => [{ objectId: '132' }]), - } as any), + }) as any, ); const res = await azureHelper.getAzureBranchObj( '123', @@ -70,7 +70,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getRefs: jest.fn(() => []), - } as any), + }) as any, ); const res = await azureHelper.getAzureBranchObj('123', 'branchName'); expect(res).toMatchSnapshot(); @@ -96,7 +96,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getItemText: jest.fn(() => mockEventStream), - } as any), + }) as any, ); const res = await azureHelper.getFile( @@ -125,7 +125,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getItemText: jest.fn(() => mockEventStream), - } as any), + }) as any, ); const res = await azureHelper.getFile( @@ -154,7 +154,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getItemText: jest.fn(() => mockEventStream), - } as any), + }) as any, ); const res = await azureHelper.getFile( @@ -172,7 +172,7 @@ describe('modules/platform/azure/azure-helper', () => { getItemText: jest.fn(() => ({ readable: false, })), - } as any), + }) as any, ); const res = await azureHelper.getFile( @@ -192,7 +192,7 @@ describe('modules/platform/azure/azure-helper', () => { getCommit: jest.fn(() => ({ parents: ['123456'], })), - } as any), + }) as any, ); const res = await azureHelper.getCommitDetails('123', '123456'); expect(res).toMatchSnapshot(); @@ -205,7 +205,7 @@ describe('modules/platform/azure/azure-helper', () => { () => ({ getPolicyConfigurations: jest.fn(() => []), - } as any), + }) as any, ); expect(await azureHelper.getMergeMethod('', '')).toEqual( GitPullRequestMergeStrategy.NoFastForward, @@ -231,7 +231,7 @@ describe('modules/platform/azure/azure-helper', () => { }, }, ]), - } as any), + }) as any, ); expect(await azureHelper.getMergeMethod('', '')).toEqual( GitPullRequestMergeStrategy.Squash, @@ -270,7 +270,7 @@ describe('modules/platform/azure/azure-helper', () => { }, }, ]), - } as any), + }) as any, ); expect(await azureHelper.getMergeMethod('', '')).toEqual( GitPullRequestMergeStrategy.Rebase, @@ -339,7 +339,7 @@ describe('modules/platform/azure/azure-helper', () => { }, }, ]), - } as any), + }) as any, ); expect( await azureHelper.getMergeMethod('', '', refMock, defaultBranchMock), @@ -395,7 +395,7 @@ describe('modules/platform/azure/azure-helper', () => { }, }, ]), - } as any), + }) as any, ); expect( await azureHelper.getMergeMethod('', '', refMock, defaultBranchMock), diff --git a/lib/modules/platform/azure/index.spec.ts b/lib/modules/platform/azure/index.spec.ts index 3f4b4a40743e599890f0fc655519671f1e3699c9..1b2e258a71f28ca2ae5b5660040d72ec2be18992 100644 --- a/lib/modules/platform/azure/index.spec.ts +++ b/lib/modules/platform/azure/index.spec.ts @@ -75,7 +75,7 @@ describe('modules/platform/azure/index', () => { }, }, ]), - } as any), + }) as any, ); return azure.getRepos(); } @@ -229,7 +229,7 @@ describe('modules/platform/azure/index', () => { }, ]), getPullRequestCommits: jest.fn().mockReturnValue([]), - } as any), + }) as any, ); const res = await azure.findPr({ branchName: 'branch-a', @@ -270,7 +270,7 @@ describe('modules/platform/azure/index', () => { }, ]), getPullRequestCommits: jest.fn().mockReturnValue([]), - } as any), + }) as any, ); const res = await azure.findPr({ branchName: 'branch-a', @@ -311,7 +311,7 @@ describe('modules/platform/azure/index', () => { }, ]), getPullRequestCommits: jest.fn().mockReturnValue([]), - } as any), + }) as any, ); const res = await azure.findPr({ branchName: 'branch-a', @@ -352,7 +352,7 @@ describe('modules/platform/azure/index', () => { }, ]), getPullRequestCommits: jest.fn().mockReturnValue([]), - } as any), + }) as any, ); const res = await azure.findPr({ branchName: 'branch-a', @@ -491,7 +491,7 @@ describe('modules/platform/azure/index', () => { () => ({ getPullRequests: jest.fn(() => []), - } as any), + }) as any, ); expect(await azure.getPrList()).toEqual([]); }); @@ -561,7 +561,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'a-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -582,7 +582,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'a-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -603,7 +603,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'a-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -624,7 +624,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'a-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -645,7 +645,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'a-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -666,7 +666,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'a-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -709,7 +709,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'another-genre', name: 'a-name' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatusCheck( 'somebranch', @@ -732,7 +732,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'renovate' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatus('somebranch', true); expect(res).toBe('green'); @@ -750,7 +750,7 @@ describe('modules/platform/azure/index', () => { context: { genre: 'renovate' }, }, ]), - } as any), + }) as any, ); const res = await azure.getBranchStatus('somebranch', false); expect(res).toBe('yellow'); @@ -763,7 +763,7 @@ describe('modules/platform/azure/index', () => { ({ getBranch: jest.fn(() => ({ commit: { commitId: 'abcd1234' } })), getStatuses: jest.fn(() => [{ state: GitStatusState.Error }]), - } as any), + }) as any, ); const res = await azure.getBranchStatus('somebranch', true); expect(res).toBe('red'); @@ -776,7 +776,7 @@ describe('modules/platform/azure/index', () => { ({ getBranch: jest.fn(() => ({ commit: { commitId: 'abcd1234' } })), getStatuses: jest.fn(() => [{ state: GitStatusState.Pending }]), - } as any), + }) as any, ); const res = await azure.getBranchStatus('somebranch', true); expect(res).toBe('yellow'); @@ -789,7 +789,7 @@ describe('modules/platform/azure/index', () => { ({ getBranch: jest.fn(() => ({ commit: { commitId: 'abcd1234' } })), getStatuses: jest.fn(() => []), - } as any), + }) as any, ); const res = await azure.getBranchStatus('somebranch', true); expect(res).toBe('yellow'); @@ -808,7 +808,7 @@ describe('modules/platform/azure/index', () => { () => ({ getPullRequests: jest.fn(() => []), - } as any), + }) as any, ); const pr = await azure.getPr(1234); expect(pr).toBeNull(); @@ -837,7 +837,7 @@ describe('modules/platform/azure/index', () => { }, }, ]), - } as any), + }) as any, ); const pr = await azure.getPr(1234); expect(pr).toMatchSnapshot(); @@ -854,7 +854,7 @@ describe('modules/platform/azure/index', () => { pullRequestId: 456, })), createPullRequestLabel: jest.fn(() => ({})), - } as any), + }) as any, ); const pr = await azure.createPr({ sourceBranch: 'some-branch', @@ -875,7 +875,7 @@ describe('modules/platform/azure/index', () => { pullRequestId: 456, })), createPullRequestLabel: jest.fn(() => ({})), - } as any), + }) as any, ); const pr = await azure.createPr({ sourceBranch: 'some-branch', @@ -1034,7 +1034,7 @@ describe('modules/platform/azure/index', () => { createPullRequest: jest.fn(() => prResult), createPullRequestLabel: jest.fn(() => ({})), createPullRequestReviewer: updateFn, - } as any), + }) as any, ); const pr = await azure.createPr({ sourceBranch: 'some-branch', @@ -1057,7 +1057,7 @@ describe('modules/platform/azure/index', () => { () => ({ updatePullRequest, - } as any), + }) as any, ); await azure.updatePr({ number: 1234, @@ -1075,7 +1075,7 @@ describe('modules/platform/azure/index', () => { () => ({ updatePullRequest, - } as any), + }) as any, ); await azure.updatePr({ number: 1234, @@ -1091,7 +1091,7 @@ describe('modules/platform/azure/index', () => { () => ({ updatePullRequest, - } as any), + }) as any, ); await azure.updatePr({ number: 1234, @@ -1109,7 +1109,7 @@ describe('modules/platform/azure/index', () => { () => ({ updatePullRequest, - } as any), + }) as any, ); await azure.updatePr({ number: 1234, @@ -1145,7 +1145,7 @@ describe('modules/platform/azure/index', () => { pullRequestId: prResult.pullRequestId, createdBy: prResult.createdBy, })), - } as any), + }) as any, ); const pr = await azure.updatePr({ number: prResult.pullRequestId, @@ -1360,7 +1360,7 @@ describe('modules/platform/azure/index', () => { getRepositories: jest.fn(() => [{ id: '1', project: { id: 2 } }]), createThread: jest.fn(() => [{ id: 123 }]), getThreads: jest.fn(() => []), - } as any), + }) as any, ); azureApi.coreApi.mockImplementation( () => @@ -1372,7 +1372,7 @@ describe('modules/platform/azure/index', () => { getTeamMembersWithExtendedProperties: jest.fn(() => [ { identity: { displayName: 'jyc', uniqueName: 'jyc', id: 123 } }, ]), - } as any), + }) as any, ); await azure.addAssignees(123, ['test@bonjour.fr', 'jyc', 'def']); expect(azureApi.gitApi).toHaveBeenCalledTimes(3); @@ -1387,7 +1387,7 @@ describe('modules/platform/azure/index', () => { ({ getRepositories: jest.fn(() => [{ id: '1', project: { id: 2 } }]), createPullRequestReviewer: jest.fn(), - } as any), + }) as any, ); azureApi.coreApi.mockImplementation( () => @@ -1399,7 +1399,7 @@ describe('modules/platform/azure/index', () => { getTeamMembersWithExtendedProperties: jest.fn(() => [ { identity: { displayName: 'jyc', uniqueName: 'jyc', id: 123 } }, ]), - } as any), + }) as any, ); await azure.addReviewers(123, ['test@bonjour.fr', 'jyc', 'required:def']); expect(azureApi.gitApi).toHaveBeenCalledTimes(3); @@ -1435,7 +1435,7 @@ describe('modules/platform/azure/index', () => { ({ getBranch: jest.fn(() => ({ commit: { commitId: 'abcd1234' } })), createCommitStatus: createCommitStatusMock, - } as any), + }) as any, ); await azure.setBranchStatus({ branchName: 'test', @@ -1467,7 +1467,7 @@ describe('modules/platform/azure/index', () => { ({ getBranch: jest.fn(() => ({ commit: { commitId: 'abcd1234' } })), createCommitStatus: createCommitStatusMock, - } as any), + }) as any, ); await azure.setBranchStatus({ branchName: 'test', @@ -1510,7 +1510,7 @@ describe('modules/platform/azure/index', () => { title: 'title', })), updatePullRequest: updatePullRequestMock, - } as any), + }) as any, ); azureHelper.getMergeMethod = jest @@ -1552,7 +1552,7 @@ describe('modules/platform/azure/index', () => { updatePullRequest: jest .fn() .mockRejectedValue(new Error(`oh no pr couldn't be updated`)), - } as any), + }) as any, ); azureHelper.getMergeMethod = jest @@ -1576,7 +1576,7 @@ describe('modules/platform/azure/index', () => { targetRefName: 'refs/heads/ding', })), updatePullRequest: jest.fn(), - } as any), + }) as any, ); azureHelper.getMergeMethod = jest .fn() @@ -1611,7 +1611,7 @@ describe('modules/platform/azure/index', () => { updatePullRequest: jest.fn(() => ({ status: 1, })), - } as any), + }) as any, ); azureHelper.getMergeMethod = jest .fn() @@ -1643,7 +1643,7 @@ describe('modules/platform/azure/index', () => { updatePullRequest: jest.fn(() => ({ status: 1, })), - } as any), + }) as any, ); azureHelper.getMergeMethod = jest .fn() @@ -1667,7 +1667,7 @@ describe('modules/platform/azure/index', () => { () => ({ deletePullRequestLabels: jest.fn(), - } as any), + }) as any, ); await azure.deleteLabel(1234, 'rebase'); expect(azureApi.gitApi.mock.calls).toMatchSnapshot(); @@ -1687,7 +1687,7 @@ describe('modules/platform/azure/index', () => { getItemContent: jest.fn(() => Promise.resolve(Readable.from(JSON.stringify(data))), ), - } as any), + }) as any, ); const res = await azure.getJsonFile('file.json'); expect(res).toEqual(data); @@ -1706,7 +1706,7 @@ describe('modules/platform/azure/index', () => { getItemContent: jest.fn(() => Promise.resolve(Readable.from(json5Data)), ), - } as any), + }) as any, ); const res = await azure.getJsonFile('file.json5'); expect(res).toEqual({ foo: 'bar' }); @@ -1720,7 +1720,7 @@ describe('modules/platform/azure/index', () => { getItemContent: jest.fn(() => Promise.resolve(Readable.from(JSON.stringify(data))), ), - } as any), + }) as any, ); const res = await azure.getJsonFile('file.json', undefined, 'dev'); expect(res).toEqual(data); @@ -1733,7 +1733,7 @@ describe('modules/platform/azure/index', () => { getItemContent: jest.fn(() => Promise.resolve(Readable.from('!@#')), ), - } as any), + }) as any, ); await expect(azure.getJsonFile('file.json')).rejects.toThrow(); }); @@ -1745,7 +1745,7 @@ describe('modules/platform/azure/index', () => { getItemContent: jest.fn(() => { throw new Error('some error'); }), - } as any), + }) as any, ); await expect(azure.getJsonFile('file.json')).rejects.toThrow(); }); diff --git a/lib/modules/platform/azure/index.ts b/lib/modules/platform/azure/index.ts index 874da300b9ff6dc94c3c2f2cfc77be3d27dff245..00d1bbba8fdc120ab289bd081d22b15f56b08717 100644 --- a/lib/modules/platform/azure/index.ts +++ b/lib/modules/platform/azure/index.ts @@ -754,10 +754,8 @@ export async function mergePr({ logger.trace( `Updating PR ${pullRequestId} to status ${PullRequestStatus.Completed} (${ PullRequestStatus[PullRequestStatus.Completed] - }) with lastMergeSourceCommit ${ - // TODO: types (#22198) - pr.lastMergeSourceCommit?.commitId - } using mergeStrategy ${mergeStrategy} (${ + }) with lastMergeSourceCommit ${// TODO: types (#22198) + pr.lastMergeSourceCommit?.commitId} using mergeStrategy ${mergeStrategy} (${ GitPullRequestMergeStrategy[mergeStrategy] })`, ); diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 68034f9319dfd5489c8adfc06c6120bfba446940..9e16030bc3c8d8294267f51ccde3611f76846110 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -283,8 +283,8 @@ export async function getRepos(config?: AutodiscoverConfig): Promise<string[]> { } logger.debug({ topics: config.topics }, 'Filtering by topics'); - const topicRepositories = nonArchivedRepositories.filter((repo) => - repo.topics?.some((topic) => config?.topics?.includes(topic)), + const topicRepositories = nonArchivedRepositories.filter( + (repo) => repo.topics?.some((topic) => config?.topics?.includes(topic)), ); if (topicRepositories.length < nonArchivedRepositories.length) { diff --git a/lib/util/http/github.ts b/lib/util/http/github.ts index a7a7a6ce8ce4d6db0691cc961143674fa5f0280d..bf8ce9848ff04a3bd59b25fb9e494eb87a1c7776 100644 --- a/lib/util/http/github.ts +++ b/lib/util/http/github.ts @@ -139,8 +139,8 @@ function handleGotError( logger.debug({ err }, 'Received invalid response - aborting'); return new Error(REPOSITORY_CHANGED); } else if ( - err.body?.errors?.find((e: any) => - e.message?.startsWith('A pull request already exists'), + err.body?.errors?.find( + (e: any) => e.message?.startsWith('A pull request already exists'), ) ) { return err; diff --git a/lib/util/http/index.ts b/lib/util/http/index.ts index 1cfe45b61b2244d522dd2e4b7372e3c4d08ff920..98db134c62ddc619a85606708b8a2561a474047c 100644 --- a/lib/util/http/index.ts +++ b/lib/util/http/index.ts @@ -127,7 +127,10 @@ async function gotTask<T>( export class Http<Opts extends HttpOptions = HttpOptions> { private options?: GotOptions; - constructor(protected hostType: string, options: HttpOptions = {}) { + constructor( + protected hostType: string, + options: HttpOptions = {}, + ) { this.options = merge<GotOptions>(options, { context: { hostType } }); } diff --git a/lib/util/package-rules/sourceurl-prefixes.ts b/lib/util/package-rules/sourceurl-prefixes.ts index 13d6d4801cb9d78532346647a2eb893c3ad23bf7..dc8be4f24204dca3d117b926a0c9097c9c9436b8 100644 --- a/lib/util/package-rules/sourceurl-prefixes.ts +++ b/lib/util/package-rules/sourceurl-prefixes.ts @@ -15,8 +15,8 @@ export class SourceUrlPrefixesMatcher extends Matcher { } const upperCaseSourceUrl = sourceUrl?.toUpperCase(); - return matchSourceUrlPrefixes.some((prefix) => - upperCaseSourceUrl?.startsWith(prefix.toUpperCase()), + return matchSourceUrlPrefixes.some( + (prefix) => upperCaseSourceUrl?.startsWith(prefix.toUpperCase()), ); } } diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index 10eed7681638b57ff395d353f01566966b31abca..5a0b279d23aa33fde7fc3f62e6b3455eeafc79d5 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -20,8 +20,9 @@ handlebars.registerHelper( handlebars.registerHelper('lowercase', (str: string) => str?.toLowerCase()); -handlebars.registerHelper('containsString', (str, subStr) => - str?.includes(subStr), +handlebars.registerHelper( + 'containsString', + (str, subStr) => str?.includes(subStr), ); handlebars.registerHelper('equals', (arg1, arg2) => arg1 === arg2); diff --git a/lib/workers/repository/config-migration/branch/create.ts b/lib/workers/repository/config-migration/branch/create.ts index c762b797435c4adccf6451170710e90fdbfb8ca9..202b41a4d755fd03bff3e61165f053d9830ecefe 100644 --- a/lib/workers/repository/config-migration/branch/create.ts +++ b/lib/workers/repository/config-migration/branch/create.ts @@ -29,9 +29,8 @@ export async function createConfigMigrationBranch( } await scm.checkoutBranch(config.defaultBranch!); - const contents = await MigratedDataFactory.applyPrettierFormatting( - migratedConfigData, - ); + const contents = + await MigratedDataFactory.applyPrettierFormatting(migratedConfigData); return scm.commitAndPush({ baseBranch: config.baseBranch, branchName: getMigrationBranchName(config), diff --git a/lib/workers/repository/config-migration/branch/rebase.ts b/lib/workers/repository/config-migration/branch/rebase.ts index da1d9095649b2afa37f27552d80a529d6dd0b945..85469195ddc4deba45dfa8487be70e4a53d11667 100644 --- a/lib/workers/repository/config-migration/branch/rebase.ts +++ b/lib/workers/repository/config-migration/branch/rebase.ts @@ -43,9 +43,8 @@ export async function rebaseMigrationBranch( const commitMessage = commitMessageFactory.getCommitMessage(); await scm.checkoutBranch(config.defaultBranch!); - contents = await MigratedDataFactory.applyPrettierFormatting( - migratedConfigData, - ); + contents = + await MigratedDataFactory.applyPrettierFormatting(migratedConfigData); return scm.commitAndPush({ baseBranch: config.baseBranch, branchName, diff --git a/lib/workers/repository/config-migration/pr/index.ts b/lib/workers/repository/config-migration/pr/index.ts index aaf28923789c15437447c862e649efe349a9c9f7..3fde6d57c6a5ed7e7dca9fc4ddd27717c01d9eea 100644 --- a/lib/workers/repository/config-migration/pr/index.ts +++ b/lib/workers/repository/config-migration/pr/index.ts @@ -50,9 +50,8 @@ ${ :no_bell: **Ignore**: Close this PR and you won't be reminded about config migration again, but one day your current config may no longer be valid. -:question: Got questions? Does something look wrong to you? Please don't hesitate to [request help here](${ - config.productLinks?.help - }).\n\n`, +:question: Got questions? Does something look wrong to you? Please don't hesitate to [request help here](${config + .productLinks?.help}).\n\n`, ); if (is.string(config.prHeader)) { diff --git a/lib/workers/repository/onboarding/pr/index.ts b/lib/workers/repository/onboarding/pr/index.ts index 6810cd4b24878d90dd607369061658385f5bcab8..3d36e5d5775d7ff67e6f9035b5270c5b7c0f08c2 100644 --- a/lib/workers/repository/onboarding/pr/index.ts +++ b/lib/workers/repository/onboarding/pr/index.ts @@ -63,9 +63,8 @@ export async function ensureOnboardingPr( return; } } - const onboardingConfigHashComment = await getOnboardingConfigHashComment( - config, - ); + const onboardingConfigHashComment = + await getOnboardingConfigHashComment(config); const rebaseCheckBox = getRebaseCheckbox(config.onboardingRebaseCheckbox); logger.debug('Filling in onboarding PR template'); let prTemplate = `Welcome to [Renovate](${ diff --git a/lib/workers/repository/update/branch/index.ts b/lib/workers/repository/update/branch/index.ts index ed167ba474c9fc45c65309401092aac0cf56594d..8c145295ba2d313179d38e64af3c1f124e983709 100644 --- a/lib/workers/repository/update/branch/index.ts +++ b/lib/workers/repository/update/branch/index.ts @@ -494,9 +494,8 @@ export async function processBranch( await embedChangelogs(config.upgrades); } - const postUpgradeCommandResults = await executePostUpgradeCommands( - config, - ); + const postUpgradeCommandResults = + await executePostUpgradeCommands(config); if (postUpgradeCommandResults !== null) { const { updatedArtifacts, artifactErrors } = postUpgradeCommandResults; diff --git a/lib/workers/repository/update/pr/index.ts b/lib/workers/repository/update/pr/index.ts index 5364a9d108af248975706764f4dfda37d153137c..6eb44a70eb04a6f4c0e8e919d71949d0af7418de 100644 --- a/lib/workers/repository/update/pr/index.ts +++ b/lib/workers/repository/update/pr/index.ts @@ -449,8 +449,9 @@ export async function ensurePr( if ( err.body?.message === 'Validation failed' && err.body.errors?.length && - err.body.errors.some((error: { message?: string }) => - error.message?.startsWith('A pull request already exists'), + err.body.errors.some( + (error: { message?: string }) => + error.message?.startsWith('A pull request already exists'), ) ) { logger.warn('A pull requests already exists'); diff --git a/package.json b/package.json index 91dd4d39e787582a3e806598c9328c36dbba6449..aa28638d85e1eb61f58bdfb93c5582afc2acb1a9 100644 --- a/package.json +++ b/package.json @@ -228,7 +228,7 @@ "p-queue": "6.6.2", "p-throttle": "4.1.1", "parse-link-header": "2.0.0", - "prettier": "2.8.8", + "prettier": "3.0.3", "redis": "4.6.10", "remark": "13.0.0", "remark-github": "10.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7def06bf803e9b8f0fb4b3d3ae50f6b65375ce0..a035699d0296dbaeee0fad5caee9dee7e497979c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -264,8 +264,8 @@ importers: specifier: 2.0.0 version: 2.0.0 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 redis: specifier: 4.6.10 version: 4.6.10 @@ -9292,9 +9292,9 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} + engines: {node: '>=14'} hasBin: true dev: false diff --git a/test/types/jest.d.ts b/test/types/jest.d.ts index 4d42ef08868a253e926d1e2ff4d74c6d72e1141d..671fdc66b64bc351076eb2f4d452b775d2be1114 100644 --- a/test/types/jest.d.ts +++ b/test/types/jest.d.ts @@ -74,7 +74,9 @@ type JestPromiseMatchers<T> = { }; type JestExpect = { - <T = unknown>(actual: T): JestMatchers<void, T> & + <T = unknown>( + actual: T, + ): JestMatchers<void, T> & JestInverse<JestMatchers<void, T>> & JestPromiseMatchers<T>; addSnapshotSerializer: (arg: Plugin) => void; @@ -86,7 +88,10 @@ type JestExpect = { type JestItEach = Global.It['each']; interface JestEach extends JestItEach { - (strings: TemplateStringsArray, ...placeholders: any[]): ( + ( + strings: TemplateStringsArray, + ...placeholders: any[] + ): ( name: string, fn: (arg: any) => ReturnType<Global.TestFn>, timeout?: number, diff --git a/tools/generate-imports.mjs b/tools/generate-imports.mjs index a7c0738031128c5053470b677066d2ed9039a1ed..453e49a6c69a68905bcc922a4ad3db68514a6a32 100644 --- a/tools/generate-imports.mjs +++ b/tools/generate-imports.mjs @@ -193,9 +193,7 @@ await (async () => { await generateData(); await generateHash(); await Promise.all( - ( - await glob('lib/**/*.generated.ts') - ) + (await glob('lib/**/*.generated.ts')) .map((f) => upath.join(f)) .filter((f) => !newFiles.has(f)) .map(async (file) => {