Skip to content

Commit 902c91f

Browse files
authored
chore: enable typescript 4.3 option noImplicitOverride (open-telemetry#549)
1 parent c0ad001 commit 902c91f

File tree

23 files changed

+231
-144
lines changed

23 files changed

+231
-144
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# JavaScript, TypeScript, c, and h source files
55
*.js text eol=lf
66
*.ts text eol=lf
7+
*.tsx text eol=lf
78
*.h text eol=lf diff=cpp
89
*.c text eol=lf diff=cpp
910

plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ export const traceContextEnvironmentKey = '_X_AMZN_TRACE_ID';
7171
export class AwsLambdaInstrumentation extends InstrumentationBase {
7272
private _tracerProvider: TracerProvider | undefined;
7373

74-
constructor(protected _config: AwsLambdaInstrumentationConfig = {}) {
74+
constructor(protected override _config: AwsLambdaInstrumentationConfig = {}) {
7575
super('@opentelemetry/instrumentation-aws-lambda', VERSION, _config);
7676
}
7777

78-
setConfig(config: AwsLambdaInstrumentationConfig = {}) {
78+
override setConfig(config: AwsLambdaInstrumentationConfig = {}) {
7979
this._config = config;
8080
}
8181

@@ -221,7 +221,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase {
221221
};
222222
}
223223

224-
setTracerProvider(tracerProvider: TracerProvider) {
224+
override setTracerProvider(tracerProvider: TracerProvider) {
225225
super.setTracerProvider(tracerProvider);
226226
this._tracerProvider = tracerProvider;
227227
}

plugins/node/opentelemetry-instrumentation-bunyan/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ export class BunyanInstrumentation extends InstrumentationBase<
6767
];
6868
}
6969

70-
getConfig(): BunyanInstrumentationConfig {
70+
override getConfig(): BunyanInstrumentationConfig {
7171
return this._config;
7272
}
7373

74-
setConfig(config: BunyanInstrumentationConfig) {
74+
override setConfig(config: BunyanInstrumentationConfig) {
7575
this._config = config;
7676
}
7777

plugins/node/opentelemetry-instrumentation-dns/src/instrumentation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { VERSION } from './version';
3737
* Dns instrumentation for Opentelemetry
3838
*/
3939
export class DnsInstrumentation extends InstrumentationBase<Dns> {
40-
constructor(protected _config: DnsInstrumentationConfig = {}) {
40+
constructor(protected override _config: DnsInstrumentationConfig = {}) {
4141
super('@opentelemetry/instrumentation-dns', VERSION, _config);
4242
}
4343

plugins/node/opentelemetry-instrumentation-graphql/src/instrumentation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class GraphQLInstrumentation extends InstrumentationBase {
7777
return this._config as GraphQLInstrumentationParsedConfig;
7878
}
7979

80-
setConfig(config: GraphQLInstrumentationConfig & InstrumentationConfig = {}) {
80+
override setConfig(config: GraphQLInstrumentationConfig = {}) {
8181
this._config = Object.assign({}, DEFAULT_CONFIG, config);
8282
}
8383

plugins/node/opentelemetry-instrumentation-memcached/src/instrumentation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class Instrumentation extends InstrumentationBase<typeof Memcached> {
4343
);
4444
}
4545

46-
setConfig(config: InstrumentationConfig = {}) {
46+
override setConfig(config: InstrumentationConfig = {}) {
4747
this._config = Object.assign({}, Instrumentation.DEFAULT_CONFIG, config);
4848
}
4949

plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const supportedVersions = ['>=3.3 <4'];
4848
export class MongoDBInstrumentation extends InstrumentationBase<
4949
typeof mongodb
5050
> {
51-
constructor(protected _config: MongoDBInstrumentationConfig = {}) {
51+
constructor(protected override _config: MongoDBInstrumentationConfig = {}) {
5252
super('@opentelemetry/instrumentation-mongodb', VERSION, _config);
5353
}
5454

plugins/node/opentelemetry-instrumentation-mysql/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class MySQLInstrumentation extends InstrumentationBase<
3636
[SemanticAttributes.DB_SYSTEM]: MySQLInstrumentation.COMPONENT,
3737
};
3838

39-
constructor(protected _config: MySQLInstrumentationConfig = {}) {
40-
super('@opentelemetry/instrumentation-mysql', VERSION, _config);
39+
constructor(config?: MySQLInstrumentationConfig) {
40+
super('@opentelemetry/instrumentation-mysql', VERSION, config);
4141
}
4242

4343
protected init() {

plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export class MySQL2Instrumentation extends InstrumentationBase<
4141
[SemanticAttributes.DB_SYSTEM]: MySQL2Instrumentation.COMPONENT,
4242
};
4343

44-
constructor(protected _config: MySQL2InstrumentationConfig = {}) {
45-
super('@opentelemetry/instrumentation-mysql2', VERSION, _config);
44+
constructor(config?: MySQL2InstrumentationConfig) {
45+
super('@opentelemetry/instrumentation-mysql2', VERSION, config);
4646
}
4747

4848
protected init() {

plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Socket } from 'net';
3333
import { TLSSocket } from 'tls';
3434

3535
export class NetInstrumentation extends InstrumentationBase<Net> {
36-
constructor(protected _config: InstrumentationConfig = {}) {
36+
constructor(_config?: InstrumentationConfig) {
3737
super('@opentelemetry/instrumentation-net', VERSION, _config);
3838
}
3939

plugins/node/opentelemetry-instrumentation-pino/src/instrumentation.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,20 @@ export class PinoInstrumentation extends InstrumentationBase {
8282
];
8383
}
8484

85-
getConfig(): PinoInstrumentationConfig {
85+
override getConfig(): PinoInstrumentationConfig {
8686
return this._config;
8787
}
8888

89-
setConfig(config: PinoInstrumentationConfig) {
89+
override setConfig(config: PinoInstrumentationConfig) {
9090
this._config = config;
9191
}
9292

93-
enable() {
93+
override enable() {
9494
super.enable();
9595
this._isEnabled = true;
9696
}
9797

98-
disable() {
98+
override disable() {
9999
super.disable();
100100
this._isEnabled = false;
101101
}

plugins/node/opentelemetry-instrumentation-redis/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export class RedisInstrumentation extends InstrumentationBase<
3838
> {
3939
static readonly COMPONENT = 'redis';
4040

41-
constructor(protected _config: RedisInstrumentationConfig = {}) {
41+
constructor(protected override _config: RedisInstrumentationConfig = {}) {
4242
super('@opentelemetry/instrumentation-redis', VERSION, _config);
4343
}
4444

45-
setConfig(config: RedisInstrumentationConfig = {}) {
45+
override setConfig(config: RedisInstrumentationConfig = {}) {
4646
this._config = Object.assign({}, DEFAULT_CONFIG, config);
4747
}
4848

plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ export class WinstonInstrumentation extends InstrumentationBase {
102102
];
103103
}
104104

105-
getConfig(): WinstonInstrumentationConfig {
105+
override getConfig(): WinstonInstrumentationConfig {
106106
return this._config;
107107
}
108108

109-
setConfig(config: WinstonInstrumentationConfig) {
109+
override setConfig(config: WinstonInstrumentationConfig) {
110110
this._config = config;
111111
}
112112

plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export class DocumentLoadInstrumentation extends InstrumentationBase<unknown> {
4848
readonly component: string = 'document-load';
4949
readonly version: string = '1';
5050
moduleName = this.component;
51-
protected _config!: InstrumentationConfig;
5251

5352
/**
5453
*
@@ -235,7 +234,7 @@ export class DocumentLoadInstrumentation extends InstrumentationBase<unknown> {
235234
/**
236235
* implements enable function
237236
*/
238-
enable() {
237+
override enable() {
239238
// remove previously attached load to avoid adding the same event twice
240239
// in case of multiple enable calling.
241240
window.removeEventListener('load', this._onDocumentLoaded);
@@ -245,7 +244,7 @@ export class DocumentLoadInstrumentation extends InstrumentationBase<unknown> {
245244
/**
246245
* implements disable function
247246
*/
248-
disable() {
247+
override disable() {
249248
window.removeEventListener('load', this._onDocumentLoaded);
250249
}
251250
}

plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<unknown>
530530
/**
531531
* implements enable function
532532
*/
533-
enable() {
533+
override enable() {
534534
const ZoneWithPrototype = this.getZoneWithPrototype();
535535
api.diag.debug(
536536
'applying patch to',
@@ -599,7 +599,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<unknown>
599599
/**
600600
* implements unpatch function
601601
*/
602-
disable() {
602+
override disable() {
603603
const ZoneWithPrototype = this.getZoneWithPrototype();
604604
api.diag.debug(
605605
'removing patch from',
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import * as React from 'react';
218
import { BaseOpenTelemetryComponent } from '../../src';
319

420
export default class AllLifecycles extends BaseOpenTelemetryComponent {
5-
constructor(props: Readonly<any>){
6-
super(props);
7-
}
21+
constructor(props: Readonly<any>) {
22+
super(props);
23+
}
24+
25+
override componentDidMount() {}
826

9-
componentDidMount(){
10-
}
27+
override componentDidUpdate(prevProps: any) {}
1128

12-
componentDidUpdate(prevProps: any){
13-
}
29+
override shouldComponentUpdate(nextProps: any, nextState: any) {
30+
return true;
31+
}
1432

15-
shouldComponentUpdate(nextProps: any, nextState: any){
16-
return true;
17-
}
18-
19-
getSnapshotBeforeUpdate(prevProps: any, prevState: any){
20-
return null;
21-
}
33+
override getSnapshotBeforeUpdate(prevProps: any, prevState: any) {
34+
return null;
35+
}
2236

23-
render() {
24-
return(
25-
<div></div>
26-
);
27-
}
37+
override render() {
38+
return <div></div>;
39+
}
2840
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import * as React from 'react';
218
import { BaseOpenTelemetryComponent } from '../../src';
319

420
export default class MissingComponentDidMount extends BaseOpenTelemetryComponent {
5-
constructor(props: Readonly<any>){
6-
super(props);
7-
}
21+
constructor(props: Readonly<any>) {
22+
super(props);
23+
}
24+
25+
override componentDidUpdate(prevProps: any) {}
826

9-
componentDidUpdate(prevProps: any){
10-
}
27+
override shouldComponentUpdate(nextProps: any, nextState: any) {
28+
return true;
29+
}
1130

12-
shouldComponentUpdate(nextProps: any, nextState: any){
13-
return true;
14-
}
15-
16-
getSnapshotBeforeUpdate(prevProps: any, prevState: any){
17-
return null;
18-
}
31+
override getSnapshotBeforeUpdate(prevProps: any, prevState: any) {
32+
return null;
33+
}
1934

20-
render() {
21-
return(
22-
<div></div>
23-
);
24-
}
35+
override render() {
36+
return <div></div>;
37+
}
2538
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import * as React from 'react';
218
import { BaseOpenTelemetryComponent } from '../../src';
319

420
export default class MissingComponentDidUpdate extends BaseOpenTelemetryComponent {
5-
constructor(props: Readonly<any>){
6-
super(props);
7-
}
21+
constructor(props: Readonly<any>) {
22+
super(props);
23+
}
24+
25+
override componentDidMount() {}
826

9-
componentDidMount(){
10-
}
27+
override shouldComponentUpdate(nextProps: any, nextState: any) {
28+
return true;
29+
}
1130

12-
shouldComponentUpdate(nextProps: any, nextState: any){
13-
return true;
14-
}
15-
16-
getSnapshotBeforeUpdate(prevProps: any, prevState: any){
17-
return null;
18-
}
31+
override getSnapshotBeforeUpdate(prevProps: any, prevState: any) {
32+
return null;
33+
}
1934

20-
render() {
21-
return(
22-
<div></div>
23-
);
24-
}
35+
override render() {
36+
return <div></div>;
37+
}
2538
}

0 commit comments

Comments
 (0)