Skip to content

Commit

Permalink
refactor: no implicit override (#11395)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
  • Loading branch information
JamieMagee and viceice committed Aug 23, 2021
1 parent 3505508 commit a6f4e99
Show file tree
Hide file tree
Showing 23 changed files with 60 additions and 47 deletions.
6 changes: 3 additions & 3 deletions lib/datasource/adoptium-java/index.ts
Expand Up @@ -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}`,
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/bitbucket-tags/index.ts
Expand Up @@ -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> {
Expand Down
6 changes: 3 additions & 3 deletions lib/datasource/cdnjs/index.ts
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions lib/datasource/clojure/index.ts
Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/dart/index.ts
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/galaxy-collection/index.ts
Expand Up @@ -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}`,
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/galaxy/index.ts
Expand Up @@ -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',
Expand Down
8 changes: 5 additions & 3 deletions lib/datasource/gradle-version/index.ts
Expand Up @@ -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)$'
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/helm/index.ts
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/orb/index.ts
Expand Up @@ -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}`,
Expand Down
6 changes: 3 additions & 3 deletions lib/datasource/ruby-version/index.ts
Expand Up @@ -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({
Expand Down
6 changes: 3 additions & 3 deletions lib/datasource/terraform-module/index.ts
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions lib/datasource/terraform-provider/index.ts
Expand Up @@ -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',
Expand All @@ -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}`,
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/bitbucket-server.ts
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/bitbucket.ts
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/gitea.ts
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/github.ts
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/gitlab.ts
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion lib/versioning/index.spec.ts
Expand Up @@ -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.');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/versioning/loose/utils.spec.ts
Expand Up @@ -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;
}

Expand Down
16 changes: 11 additions & 5 deletions lib/versioning/regex/index.ts
Expand Up @@ -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))
Expand Down
5 changes: 4 additions & 1 deletion tools/jest-gh-reporter.ts
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -11,6 +11,7 @@
"esModuleInterop": true,
"resolveJsonModule": false,
"noUnusedLocals": true,
"noImplicitOverride": true,
"experimentalDecorators": true,
"lib": ["es2018"],
"types": ["node", "jest", "jest-extended"],
Expand Down

0 comments on commit a6f4e99

Please sign in to comment.