diff --git a/lib/datasource/adoptium-java/index.ts b/lib/datasource/adoptium-java/index.ts index 0d51760f0d3c366a71f7aa449fc0a51019670184..ae380a9edfad48f9ecbcd97ab9b46f11bd1bef9d 100644 --- a/lib/datasource/adoptium-java/index.ts +++ b/lib/datasource/adoptium-java/index.ts @@ -13,11 +13,11 @@ export class AdoptiumJavaDatasource extends Datasource { super(datasource); } - customRegistrySupport = false; + override readonly customRegistrySupport = false; - defaultRegistryUrls = [defaultRegistryUrl]; + override readonly defaultRegistryUrls = [defaultRegistryUrl]; - caching = true; + override readonly caching = true; @cache({ namespace: `datasource-${datasource}`, diff --git a/lib/datasource/bitbucket-tags/index.ts b/lib/datasource/bitbucket-tags/index.ts index 33be94ef774df60439f3e337bff93888b7e738c1..59b98e44abb88e88289cae6adda3633e4c9c8f17 100644 --- a/lib/datasource/bitbucket-tags/index.ts +++ b/lib/datasource/bitbucket-tags/index.ts @@ -106,7 +106,7 @@ export class BitBucketTagsDatasource extends Datasource { key: ({ registryUrl, lookupName }: DigestConfig) => BitBucketTagsDatasource.getCacheKey(registryUrl, lookupName, 'digest'), }) - async getDigest( + override async getDigest( { lookupName: repo, registryUrl }: DigestConfig, newValue?: string ): Promise<string | null> { diff --git a/lib/datasource/cdnjs/index.ts b/lib/datasource/cdnjs/index.ts index 0944d32d39d94c95181bb293e3fa680567bcb982..cac132885f6c675dd3760acc265394f3038720f3 100644 --- a/lib/datasource/cdnjs/index.ts +++ b/lib/datasource/cdnjs/index.ts @@ -10,11 +10,11 @@ export class CdnJsDatasource extends Datasource { super(CdnJsDatasource.id); } - customRegistrySupport = false; + override readonly customRegistrySupport = false; - defaultRegistryUrls = ['https://api.cdnjs.com/']; + override readonly defaultRegistryUrls = ['https://api.cdnjs.com/']; - caching = true; + override readonly caching = true; // this.handleErrors will always throw // eslint-disable-next-line consistent-return diff --git a/lib/datasource/clojure/index.ts b/lib/datasource/clojure/index.ts index de4f1e148944d73445cc6c4f5a09242002b68f63..79b2c8cf034a46808c586b9f4f30c44d6381d658 100644 --- a/lib/datasource/clojure/index.ts +++ b/lib/datasource/clojure/index.ts @@ -10,11 +10,12 @@ export class ClojureDatasource extends Datasource { super(ClojureDatasource.id); } - readonly registryStrategy = 'merge'; + override readonly registryStrategy = 'merge'; - readonly customRegistrySupport = true; - - readonly defaultRegistryUrls = ['https://clojars.org/repo', MAVEN_REPO]; + override readonly defaultRegistryUrls = [ + 'https://clojars.org/repo', + MAVEN_REPO, + ]; // eslint-disable-next-line class-methods-use-this getReleases({ diff --git a/lib/datasource/dart/index.ts b/lib/datasource/dart/index.ts index eebf87e82b4228587c27027fb3a9a8a466e2e92d..1a29573116c6aab4f5ba3ecb61878dfa8dc422da 100644 --- a/lib/datasource/dart/index.ts +++ b/lib/datasource/dart/index.ts @@ -10,9 +10,9 @@ export class DartDatasource extends Datasource { super(DartDatasource.id); } - readonly customRegistrySupport = false; + override readonly customRegistrySupport = false; - readonly defaultRegistryUrls = ['https://pub.dartlang.org/']; + override readonly defaultRegistryUrls = ['https://pub.dartlang.org/']; async getReleases({ lookupName, diff --git a/lib/datasource/galaxy-collection/index.ts b/lib/datasource/galaxy-collection/index.ts index 856c85561a08f89f7cd2b308b15f17468607fbf4..8b57b2063eec68950e9152385665fcf6538720d7 100644 --- a/lib/datasource/galaxy-collection/index.ts +++ b/lib/datasource/galaxy-collection/index.ts @@ -17,9 +17,9 @@ export class GalaxyCollectionDatasource extends Datasource { super(GalaxyCollectionDatasource.id); } - readonly customRegistrySupport = false; + override readonly customRegistrySupport = false; - readonly defaultRegistryUrls = ['https://galaxy.ansible.com/']; + override readonly defaultRegistryUrls = ['https://galaxy.ansible.com/']; @cache({ namespace: `datasource-${GalaxyCollectionDatasource.id}`, diff --git a/lib/datasource/galaxy/index.ts b/lib/datasource/galaxy/index.ts index ad9c03595e7b84f822ae8bcbef23dee03cbbcdcb..960f3f56218e56ce899fec2b0518f3e3458d93bc 100644 --- a/lib/datasource/galaxy/index.ts +++ b/lib/datasource/galaxy/index.ts @@ -12,9 +12,9 @@ export class GalaxyDatasource extends Datasource { super(GalaxyDatasource.id); } - readonly customRegistrySupport = false; + override readonly customRegistrySupport = false; - readonly defaultRegistryUrls = ['https://galaxy.ansible.com/']; + override readonly defaultRegistryUrls = ['https://galaxy.ansible.com/']; @cache({ namespace: 'datasource-galaxy', diff --git a/lib/datasource/gradle-version/index.ts b/lib/datasource/gradle-version/index.ts index 56756a7e092b35ab5685814ea12248957c6f8ce0..63f3dba74b5da3c19b94a545767f98a1b0230323 100644 --- a/lib/datasource/gradle-version/index.ts +++ b/lib/datasource/gradle-version/index.ts @@ -12,11 +12,13 @@ export class GradleVersionDatasource extends Datasource { super(GradleVersionDatasource.id); } - readonly defaultRegistryUrls = ['https://services.gradle.org/versions/all']; + override readonly defaultRegistryUrls = [ + 'https://services.gradle.org/versions/all', + ]; - readonly defaultVersioning = gradleVersioning.id; + override readonly defaultVersioning = gradleVersioning.id; - readonly registryStrategy = 'merge'; + override readonly registryStrategy = 'merge'; private static readonly buildTimeRegex = regEx( '^(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\+\\d\\d\\d\\d)$' diff --git a/lib/datasource/helm/index.ts b/lib/datasource/helm/index.ts index 6cf0e412cbab43dcae12681cd0691deddcd25ae2..64e8ebabbc24a969cd65a0d235e5a6fcff11a0f6 100644 --- a/lib/datasource/helm/index.ts +++ b/lib/datasource/helm/index.ts @@ -14,9 +14,9 @@ export class HelmDatasource extends Datasource { super(HelmDatasource.id); } - readonly defaultRegistryUrls = ['https://charts.helm.sh/stable']; + override readonly defaultRegistryUrls = ['https://charts.helm.sh/stable']; - readonly defaultConfig = { + override readonly defaultConfig = { commitMessageTopic: 'Helm release {{depName}}', group: { commitMessageTopic: '{{{groupName}}} Helm releases', diff --git a/lib/datasource/orb/index.ts b/lib/datasource/orb/index.ts index 83da94996bb63ec0df0f002d31520ca9bf9c7171..59b9ff90b12d24125cd14de6b0cb0251790fb92a 100644 --- a/lib/datasource/orb/index.ts +++ b/lib/datasource/orb/index.ts @@ -24,9 +24,9 @@ export class OrbDatasource extends Datasource { super(OrbDatasource.id); } - customRegistrySupport = false; + override readonly customRegistrySupport = false; - defaultRegistryUrls = ['https://circleci.com/']; + override readonly defaultRegistryUrls = ['https://circleci.com/']; @cache({ namespace: `datasource-${OrbDatasource.id}`, diff --git a/lib/datasource/ruby-version/index.ts b/lib/datasource/ruby-version/index.ts index 9019d63c882ad0f560cdfcd53b481969c0c49aa2..c5c845b7b7031727510a9111a71ecba1f7a110c6 100644 --- a/lib/datasource/ruby-version/index.ts +++ b/lib/datasource/ruby-version/index.ts @@ -13,11 +13,11 @@ export class RubyVersionDatasource extends Datasource { super(RubyVersionDatasource.id); } - readonly defaultRegistryUrls = ['https://www.ruby-lang.org/']; + override readonly defaultRegistryUrls = ['https://www.ruby-lang.org/']; - readonly customRegistrySupport = false; + override readonly customRegistrySupport = false; - readonly defaultVersioning = rubyVersioningId; + override readonly defaultVersioning = rubyVersioningId; @cache({ namespace: `datasource-${RubyVersionDatasource.id}`, key: 'all' }) async getReleases({ diff --git a/lib/datasource/terraform-module/index.ts b/lib/datasource/terraform-module/index.ts index 6c3f329657ac0ceba3dc038c6fc910fb4a8f6280..3c2a9eca2b20e2f99d838be24e3bc158f7eb7e5d 100644 --- a/lib/datasource/terraform-module/index.ts +++ b/lib/datasource/terraform-module/index.ts @@ -8,15 +8,15 @@ import { TerraformDatasource } from './base'; import type { RegistryRepository, TerraformRelease } from './types'; export class TerraformModuleDatasource extends TerraformDatasource { - static readonly id = 'terraform-module'; + static override readonly id = 'terraform-module'; constructor() { super(TerraformModuleDatasource.id); } - readonly defaultRegistryUrls = ['https://registry.terraform.io']; + override readonly defaultRegistryUrls = ['https://registry.terraform.io']; - readonly defaultVersioning = hashicorpVersioning.id; + override readonly defaultVersioning = hashicorpVersioning.id; /** * This function will fetch a package from the specified Terraform registry and return all semver versions. diff --git a/lib/datasource/terraform-provider/index.ts b/lib/datasource/terraform-provider/index.ts index 4bd19dbd0a52f92946957ea6ffa0d9fd8d42e31c..1500d3b8af632d239fef0a8b72beebf07a663c82 100644 --- a/lib/datasource/terraform-provider/index.ts +++ b/lib/datasource/terraform-provider/index.ts @@ -16,7 +16,7 @@ import type { } from './types'; export class TerraformProviderDatasource extends TerraformDatasource { - static readonly id = 'terraform-provider'; + static override readonly id = 'terraform-provider'; static readonly defaultRegistryUrls = [ 'https://registry.terraform.io', @@ -29,12 +29,12 @@ export class TerraformProviderDatasource extends TerraformDatasource { super(TerraformProviderDatasource.id); } - readonly defaultRegistryUrls = + override readonly defaultRegistryUrls = TerraformProviderDatasource.defaultRegistryUrls; - readonly defaultVersioning = hashicorpVersioning.id; + override readonly defaultVersioning = hashicorpVersioning.id; - readonly registryStrategy = 'hunt'; + override readonly registryStrategy = 'hunt'; @cache({ namespace: `datasource-${TerraformProviderDatasource.id}`, diff --git a/lib/util/http/bitbucket-server.ts b/lib/util/http/bitbucket-server.ts index c3017256d73c2f51b4ea0fb4c362a4a60c538ae3..dd96385b99d0b1a46988c3f4e31ba98abf2bb764 100644 --- a/lib/util/http/bitbucket-server.ts +++ b/lib/util/http/bitbucket-server.ts @@ -12,7 +12,7 @@ export class BitbucketServerHttp extends Http { super(PLATFORM_TYPE_BITBUCKET_SERVER, options); } - protected request<T>( + protected override request<T>( path: string, options?: InternalHttpOptions ): Promise<HttpResponse<T> | null> { diff --git a/lib/util/http/bitbucket.ts b/lib/util/http/bitbucket.ts index db74f462b03d2caa8c948656f0ee7c0b317c24db..10f56e4a25664caed058a7d785ad7cc8942a785f 100644 --- a/lib/util/http/bitbucket.ts +++ b/lib/util/http/bitbucket.ts @@ -12,7 +12,7 @@ export class BitbucketHttp extends Http { super(PLATFORM_TYPE_BITBUCKET, options); } - protected request<T>( + protected override request<T>( url: string | URL, options?: InternalHttpOptions ): Promise<HttpResponse<T> | null> { diff --git a/lib/util/http/gitea.ts b/lib/util/http/gitea.ts index ab1e0622591efea4e8a55be4a58bcf5af97f8f59..5410284e3852eb1b0b0553815e39d68804f983a7 100644 --- a/lib/util/http/gitea.ts +++ b/lib/util/http/gitea.ts @@ -33,7 +33,7 @@ export class GiteaHttp extends Http<GiteaHttpOptions, GiteaHttpOptions> { super(PLATFORM_TYPE_GITEA, options); } - protected async request<T>( + protected override async request<T>( path: string, options?: InternalHttpOptions & GiteaHttpOptions ): Promise<HttpResponse<T> | null> { diff --git a/lib/util/http/github.ts b/lib/util/http/github.ts index 70d55b7022cc82fe6190672e5a96635217f6a341..722ea322a32cf91a06cc0976af6f429828c85dde 100644 --- a/lib/util/http/github.ts +++ b/lib/util/http/github.ts @@ -162,7 +162,7 @@ export class GithubHttp extends Http<GithubHttpOptions, GithubHttpOptions> { super(PLATFORM_TYPE_GITHUB, options); } - protected async request<T>( + protected override async request<T>( url: string | URL, options?: GithubInternalOptions & GithubHttpOptions, okToRetry = true diff --git a/lib/util/http/gitlab.ts b/lib/util/http/gitlab.ts index f93df7358a45e91be5d44c0099d6244ed3203d57..a9ca70f00c883d6b674211cf2a87c70ef4aeb16a 100644 --- a/lib/util/http/gitlab.ts +++ b/lib/util/http/gitlab.ts @@ -24,7 +24,7 @@ export class GitlabHttp extends Http<GitlabHttpOptions, GitlabHttpOptions> { super(PLATFORM_TYPE_GITLAB, options); } - protected async request<T>( + protected override async request<T>( url: string | URL, options?: GitlabInternalOptions & GitlabHttpOptions ): Promise<HttpResponse<T> | null> { diff --git a/lib/versioning/index.spec.ts b/lib/versioning/index.spec.ts index 9de3bba101e97444856d6eb2e2eff55a110021d8..92097568612a070718263e6add0d148cb808df8f 100644 --- a/lib/versioning/index.spec.ts +++ b/lib/versioning/index.spec.ts @@ -113,7 +113,7 @@ describe('versioning/index', () => { it('dummy', () => { class DummyScheme extends GenericVersioningApi { // eslint-disable-next-line class-methods-use-this - protected _compare(_version: string, _other: string): number { + protected override _compare(_version: string, _other: string): number { throw new Error('Method not implemented.'); } diff --git a/lib/versioning/loose/utils.spec.ts b/lib/versioning/loose/utils.spec.ts index 91b33aec2a5d39ee1dd8e2835de936215244acfb..0a2e2652ab98b3996352662f87324529a7d133b3 100644 --- a/lib/versioning/loose/utils.spec.ts +++ b/lib/versioning/loose/utils.spec.ts @@ -32,7 +32,7 @@ describe('versioning/loose/utils', () => { describe('GenericVersioningApi', () => { class DummyScheme extends GenericVersioningApi { // eslint-disable-next-line class-methods-use-this - protected _compare(_version: string, _other: string): number { + protected override _compare(_version: string, _other: string): number { return _version ? _version.localeCompare(_other) : 0; } diff --git a/lib/versioning/regex/index.ts b/lib/versioning/regex/index.ts index 43252b36ae101f758e5987e50f08091c47edbb8a..f597df18a8da167406a1c2adeabe308aba2d8f4a 100644 --- a/lib/versioning/regex/index.ts +++ b/lib/versioning/regex/index.ts @@ -92,31 +92,37 @@ export class RegExpVersioningApi extends GenericVersioningApi<RegExpVersion> { }; } - isCompatible(version: string, range: string): boolean { + override isCompatible(version: string, range: string): boolean { return ( this._parse(version).compatibility === this._parse(range).compatibility ); } - isLessThanRange(version: string, range: string): boolean { + override isLessThanRange(version: string, range: string): boolean { return ltr(asSemver(this._parse(version)), asSemver(this._parse(range))); } - getSatisfyingVersion(versions: string[], range: string): string | null { + override getSatisfyingVersion( + versions: string[], + range: string + ): string | null { return maxSatisfying( versions.map((v) => asSemver(this._parse(v))), asSemver(this._parse(range)) ); } - minSatisfyingVersion(versions: string[], range: string): string | null { + override minSatisfyingVersion( + versions: string[], + range: string + ): string | null { return minSatisfying( versions.map((v) => asSemver(this._parse(v))), asSemver(this._parse(range)) ); } - matches(version: string, range: string): boolean { + override matches(version: string, range: string): boolean { return satisfies( asSemver(this._parse(version)), asSemver(this._parse(range)) diff --git a/tools/jest-gh-reporter.ts b/tools/jest-gh-reporter.ts index 3112a8c88364199dcbbb37c13aa6b3d354235643..a6c154690b34b317506a1d979d3dab660defdec3 100644 --- a/tools/jest-gh-reporter.ts +++ b/tools/jest-gh-reporter.ts @@ -46,7 +46,10 @@ function getPos(msg: string): Record<string, string> { class GitHubReporter extends BaseReporter { // eslint-disable-next-line class-methods-use-this - onRunComplete(_contexts: Set<Context>, testResult: AggregatedResult): void { + override onRunComplete( + _contexts: Set<Context>, + testResult: AggregatedResult + ): void { try { if (getEnv('GITHUB_ACTIONS') !== 'true') { return; diff --git a/tsconfig.json b/tsconfig.json index f3cee72242a32ac3c27b08460c8d6e7e7a0641b1..920493bcb7b5e59d5b0230f45143cf1c25097080 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ "esModuleInterop": true, "resolveJsonModule": false, "noUnusedLocals": true, + "noImplicitOverride": true, "experimentalDecorators": true, "lib": ["es2018"], "types": ["node", "jest", "jest-extended"],