Skip to content

Commit

Permalink
chore: enable typescript 4.3 option noImplicitOverride (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flarna committed Jul 12, 2021
1 parent c0ad001 commit 902c91f
Show file tree
Hide file tree
Showing 23 changed files with 231 additions and 144 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Expand Up @@ -4,6 +4,7 @@
# JavaScript, TypeScript, c, and h source files
*.js text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.h text eol=lf diff=cpp
*.c text eol=lf diff=cpp

Expand Down
Expand Up @@ -71,11 +71,11 @@ export const traceContextEnvironmentKey = '_X_AMZN_TRACE_ID';
export class AwsLambdaInstrumentation extends InstrumentationBase {
private _tracerProvider: TracerProvider | undefined;

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

setConfig(config: AwsLambdaInstrumentationConfig = {}) {
override setConfig(config: AwsLambdaInstrumentationConfig = {}) {
this._config = config;
}

Expand Down Expand Up @@ -221,7 +221,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase {
};
}

setTracerProvider(tracerProvider: TracerProvider) {
override setTracerProvider(tracerProvider: TracerProvider) {
super.setTracerProvider(tracerProvider);
this._tracerProvider = tracerProvider;
}
Expand Down
Expand Up @@ -67,11 +67,11 @@ export class BunyanInstrumentation extends InstrumentationBase<
];
}

getConfig(): BunyanInstrumentationConfig {
override getConfig(): BunyanInstrumentationConfig {
return this._config;
}

setConfig(config: BunyanInstrumentationConfig) {
override setConfig(config: BunyanInstrumentationConfig) {
this._config = config;
}

Expand Down
Expand Up @@ -37,7 +37,7 @@ import { VERSION } from './version';
* Dns instrumentation for Opentelemetry
*/
export class DnsInstrumentation extends InstrumentationBase<Dns> {
constructor(protected _config: DnsInstrumentationConfig = {}) {
constructor(protected override _config: DnsInstrumentationConfig = {}) {
super('@opentelemetry/instrumentation-dns', VERSION, _config);
}

Expand Down
Expand Up @@ -77,7 +77,7 @@ export class GraphQLInstrumentation extends InstrumentationBase {
return this._config as GraphQLInstrumentationParsedConfig;
}

setConfig(config: GraphQLInstrumentationConfig & InstrumentationConfig = {}) {
override setConfig(config: GraphQLInstrumentationConfig = {}) {
this._config = Object.assign({}, DEFAULT_CONFIG, config);
}

Expand Down
Expand Up @@ -43,7 +43,7 @@ export class Instrumentation extends InstrumentationBase<typeof Memcached> {
);
}

setConfig(config: InstrumentationConfig = {}) {
override setConfig(config: InstrumentationConfig = {}) {
this._config = Object.assign({}, Instrumentation.DEFAULT_CONFIG, config);
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ const supportedVersions = ['>=3.3 <4'];
export class MongoDBInstrumentation extends InstrumentationBase<
typeof mongodb
> {
constructor(protected _config: MongoDBInstrumentationConfig = {}) {
constructor(protected override _config: MongoDBInstrumentationConfig = {}) {
super('@opentelemetry/instrumentation-mongodb', VERSION, _config);
}

Expand Down
Expand Up @@ -36,8 +36,8 @@ export class MySQLInstrumentation extends InstrumentationBase<
[SemanticAttributes.DB_SYSTEM]: MySQLInstrumentation.COMPONENT,
};

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

protected init() {
Expand Down
Expand Up @@ -41,8 +41,8 @@ export class MySQL2Instrumentation extends InstrumentationBase<
[SemanticAttributes.DB_SYSTEM]: MySQL2Instrumentation.COMPONENT,
};

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

protected init() {
Expand Down
Expand Up @@ -33,7 +33,7 @@ import { Socket } from 'net';
import { TLSSocket } from 'tls';

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

Expand Down
Expand Up @@ -82,20 +82,20 @@ export class PinoInstrumentation extends InstrumentationBase {
];
}

getConfig(): PinoInstrumentationConfig {
override getConfig(): PinoInstrumentationConfig {
return this._config;
}

setConfig(config: PinoInstrumentationConfig) {
override setConfig(config: PinoInstrumentationConfig) {
this._config = config;
}

enable() {
override enable() {
super.enable();
this._isEnabled = true;
}

disable() {
override disable() {
super.disable();
this._isEnabled = false;
}
Expand Down
Expand Up @@ -38,11 +38,11 @@ export class RedisInstrumentation extends InstrumentationBase<
> {
static readonly COMPONENT = 'redis';

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

setConfig(config: RedisInstrumentationConfig = {}) {
override setConfig(config: RedisInstrumentationConfig = {}) {
this._config = Object.assign({}, DEFAULT_CONFIG, config);
}

Expand Down
Expand Up @@ -102,11 +102,11 @@ export class WinstonInstrumentation extends InstrumentationBase {
];
}

getConfig(): WinstonInstrumentationConfig {
override getConfig(): WinstonInstrumentationConfig {
return this._config;
}

setConfig(config: WinstonInstrumentationConfig) {
override setConfig(config: WinstonInstrumentationConfig) {
this._config = config;
}

Expand Down
Expand Up @@ -48,7 +48,6 @@ export class DocumentLoadInstrumentation extends InstrumentationBase<unknown> {
readonly component: string = 'document-load';
readonly version: string = '1';
moduleName = this.component;
protected _config!: InstrumentationConfig;

/**
*
Expand Down Expand Up @@ -235,7 +234,7 @@ export class DocumentLoadInstrumentation extends InstrumentationBase<unknown> {
/**
* implements enable function
*/
enable() {
override enable() {
// remove previously attached load to avoid adding the same event twice
// in case of multiple enable calling.
window.removeEventListener('load', this._onDocumentLoaded);
Expand All @@ -245,7 +244,7 @@ export class DocumentLoadInstrumentation extends InstrumentationBase<unknown> {
/**
* implements disable function
*/
disable() {
override disable() {
window.removeEventListener('load', this._onDocumentLoaded);
}
}
Expand Up @@ -530,7 +530,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<unknown>
/**
* implements enable function
*/
enable() {
override enable() {
const ZoneWithPrototype = this.getZoneWithPrototype();
api.diag.debug(
'applying patch to',
Expand Down Expand Up @@ -599,7 +599,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<unknown>
/**
* implements unpatch function
*/
disable() {
override disable() {
const ZoneWithPrototype = this.getZoneWithPrototype();
api.diag.debug(
'removing patch from',
Expand Down
@@ -1,28 +1,40 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as React from 'react';
import { BaseOpenTelemetryComponent } from '../../src';

export default class AllLifecycles extends BaseOpenTelemetryComponent {
constructor(props: Readonly<any>){
super(props);
}
constructor(props: Readonly<any>) {
super(props);
}

override componentDidMount() {}

componentDidMount(){
}
override componentDidUpdate(prevProps: any) {}

componentDidUpdate(prevProps: any){
}
override shouldComponentUpdate(nextProps: any, nextState: any) {
return true;
}

shouldComponentUpdate(nextProps: any, nextState: any){
return true;
}

getSnapshotBeforeUpdate(prevProps: any, prevState: any){
return null;
}
override getSnapshotBeforeUpdate(prevProps: any, prevState: any) {
return null;
}

render() {
return(
<div></div>
);
}
override render() {
return <div></div>;
}
}
@@ -1,25 +1,38 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as React from 'react';
import { BaseOpenTelemetryComponent } from '../../src';

export default class MissingComponentDidMount extends BaseOpenTelemetryComponent {
constructor(props: Readonly<any>){
super(props);
}
constructor(props: Readonly<any>) {
super(props);
}

override componentDidUpdate(prevProps: any) {}

componentDidUpdate(prevProps: any){
}
override shouldComponentUpdate(nextProps: any, nextState: any) {
return true;
}

shouldComponentUpdate(nextProps: any, nextState: any){
return true;
}

getSnapshotBeforeUpdate(prevProps: any, prevState: any){
return null;
}
override getSnapshotBeforeUpdate(prevProps: any, prevState: any) {
return null;
}

render() {
return(
<div></div>
);
}
override render() {
return <div></div>;
}
}
@@ -1,25 +1,38 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as React from 'react';
import { BaseOpenTelemetryComponent } from '../../src';

export default class MissingComponentDidUpdate extends BaseOpenTelemetryComponent {
constructor(props: Readonly<any>){
super(props);
}
constructor(props: Readonly<any>) {
super(props);
}

override componentDidMount() {}

componentDidMount(){
}
override shouldComponentUpdate(nextProps: any, nextState: any) {
return true;
}

shouldComponentUpdate(nextProps: any, nextState: any){
return true;
}

getSnapshotBeforeUpdate(prevProps: any, prevState: any){
return null;
}
override getSnapshotBeforeUpdate(prevProps: any, prevState: any) {
return null;
}

render() {
return(
<div></div>
);
}
override render() {
return <div></div>;
}
}

0 comments on commit 902c91f

Please sign in to comment.