Skip to content

Commit d34c35c

Browse files
authored
lint: enable noImplicitOverride in tsc (#3143)
## Problem It's not always obvious that classes are overriding methods in a base class ## Solution Enforce usage of the override keyword
1 parent 77d0796 commit d34c35c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+102
-102
lines changed

src/apigateway/explorer/apiGatewayNodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ export class ApiGatewayNode extends AWSTreeNodeBase {
2424

2525
public constructor(
2626
private readonly partitionId: string,
27-
public readonly regionCode: string,
27+
public override readonly regionCode: string,
2828
private readonly client = new DefaultApiGatewayClient(regionCode)
2929
) {
3030
super('API Gateway', vscode.TreeItemCollapsibleState.Collapsed)
3131
this.apiNodes = new Map<string, RestApiNode>()
3232
}
3333

34-
public async getChildren(): Promise<AWSTreeNodeBase[]> {
34+
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
3535
return await makeChildrenNodes({
3636
getChildNodes: async () => {
3737
await this.updateChildren()

src/apigateway/explorer/apiNodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase'
88
import { RestApi } from 'aws-sdk/clients/apigateway'
99

1010
export class RestApiNode extends AWSTreeNodeBase implements AWSResourceNode {
11-
public id!: string
11+
public override id!: string
1212

1313
public constructor(
1414
public readonly parent: AWSTreeNodeBase,
1515
public readonly partitionId: string,
16-
public readonly regionCode: string,
16+
public override readonly regionCode: string,
1717
private api: RestApi
1818
) {
1919
super('')

src/apprunner/explorer/apprunnerNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ export class AppRunnerNode extends AWSTreeNodeBase {
2121
private readonly pollingNodes: Set<string> = new Set()
2222
private pollTimer?: NodeJS.Timeout
2323

24-
public constructor(public readonly regionCode: string, public readonly client: AppRunnerClient) {
24+
public constructor(public override readonly regionCode: string, public readonly client: AppRunnerClient) {
2525
super('App Runner', vscode.TreeItemCollapsibleState.Collapsed)
2626
this.contextValue = 'awsAppRunnerNode'
2727
}
2828

29-
public async getChildren(): Promise<AWSTreeNodeBase[]> {
29+
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
3030
return await makeChildrenNodes({
3131
getChildNodes: async () => {
3232
await this.updateChildren()

src/awsexplorer/regionNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const serviceCandidates = [
8585
*/
8686
export class RegionNode extends AWSTreeNodeBase {
8787
private region: Region
88-
public readonly regionCode: string
88+
public override readonly regionCode: string
8989

9090
public get regionName(): string {
9191
return this.region.name
@@ -99,7 +99,7 @@ export class RegionNode extends AWSTreeNodeBase {
9999
this.update(region)
100100
}
101101

102-
public async getChildren(): Promise<AWSTreeNodeBase[]> {
102+
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
103103
// Services that are candidates to add to the region explorer.
104104
// `serviceId`s are checked against ~/resources/endpoints.json to see whether or not the service is available in the given region.
105105
// If the service is available, we use the `createFn` to generate the node for the region.

src/cloudWatchLogs/explorer/cloudWatchLogsNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export abstract class CloudWatchLogsBase extends AWSTreeNodeBase {
2323

2424
public constructor(
2525
label: string,
26-
public readonly regionCode: string,
26+
public override readonly regionCode: string,
2727
protected readonly cloudwatchClient: DefaultCloudWatchLogsClient
2828
) {
2929
super(label, vscode.TreeItemCollapsibleState.Collapsed)
@@ -32,7 +32,7 @@ export abstract class CloudWatchLogsBase extends AWSTreeNodeBase {
3232

3333
protected abstract getLogGroups(): Promise<Map<string, CloudWatchLogs.LogGroup>>
3434

35-
public async getChildren(): Promise<AWSTreeNodeBase[]> {
35+
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
3636
return await makeChildrenNodes({
3737
getChildNodes: async () => {
3838
await this.updateChildren()

src/cloudWatchLogs/explorer/logGroupNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { localize } from '../../shared/utilities/vsCodeUtils'
1313
export const contextValueCloudwatchLog = 'awsCloudWatchLogNode'
1414

1515
export class LogGroupNode extends AWSTreeNodeBase implements AWSResourceNode {
16-
public constructor(public readonly regionCode: string, public logGroup: CloudWatchLogs.LogGroup) {
16+
public constructor(public override readonly regionCode: string, public logGroup: CloudWatchLogs.LogGroup) {
1717
super('')
1818
this.update(logGroup)
1919
this.iconPath = getIcon('aws-cloudwatch-log-group')

src/credentials/providers/sharedCredentialsProviderFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export class SharedCredentialsProviderFactory extends BaseCredentialsProviderFac
2727
}
2828
}
2929

30-
public getProviderType(): CredentialsProviderType | undefined {
30+
public override getProviderType(): CredentialsProviderType | undefined {
3131
return SharedCredentialsProvider.getProviderType()
3232
}
3333

34-
protected resetProviders() {
34+
protected override resetProviders() {
3535
this.loadedCredentialsModificationMillis = undefined
3636
this.loadedConfigModificationMillis = undefined
3737

src/dynamicResources/explorer/nodes/resourceNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class ResourceNode extends AWSTreeNodeBase {
1515
public constructor(
1616
public readonly parent: ResourceTypeNode,
1717
public readonly identifier: string,
18-
public contextValue?: string
18+
public override contextValue?: string
1919
) {
2020
super('')
2121
this.contextValue = contextValue ?? 'ResourceNode'

src/dynamicResources/explorer/nodes/resourceTypeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class ResourceTypeNode extends AWSTreeNodeBase implements LoadMoreNode {
6060
this.childContextValue = supportedOperations.join('') + contextValueResource
6161
}
6262

63-
public async getChildren(): Promise<AWSTreeNodeBase[]> {
63+
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
6464
if (!this.metadata.available) {
6565
return []
6666
}

src/dynamicResources/explorer/nodes/resourcesNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class ResourcesNode extends AWSTreeNodeBase {
3333
this.contextValue = 'resourcesRootNode'
3434
}
3535

36-
public async getChildren(): Promise<AWSTreeNodeBase[]> {
36+
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
3737
return await makeChildrenNodes({
3838
getChildNodes: async () => {
3939
await this.updateChildren()

0 commit comments

Comments
 (0)