Skip to content

Commit 1f3b8fa

Browse files
committed
fix: fixing some of the linting issues & versions script
1 parent 28205a0 commit 1f3b8fa

File tree

22 files changed

+53
-26
lines changed

22 files changed

+53
-26
lines changed

packages/opentelemetry-test-utils/testUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
*/
1616

1717
import * as childProcess from 'child_process';
18+
// eslint-disable-next-line node/no-unpublished-import
1819
import { SpanKind, Attributes, Event, Span, Status } from '@opentelemetry/api';
1920
import * as assert from 'assert';
21+
/* eslint-disable node/no-unpublished-import */
2022
import { ReadableSpan } from '@opentelemetry/tracing';
2123
import {
2224
hrTimeToMilliseconds,
2325
hrTimeToMicroseconds,
2426
} from '@opentelemetry/core';
27+
/* esling-enable node/no-unpublished-import */
2528

2629
export function startDocker(db: 'redis' | 'mysql' | 'postgres') {
2730
let dockerRunCmd;

plugins/node/opentelemetry-plugin-dns/src/version.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
// this is autogenerated file, see scripts/version-update.js
1618
export const VERSION = '0.8.0';

plugins/node/opentelemetry-plugin-express/src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ export const isLayerIgnored = (
127127
return true;
128128
}
129129
}
130-
} catch (e) {}
130+
} catch (e) {
131+
/* catch block*/
132+
}
131133

132134
return false;
133135
};

plugins/node/opentelemetry-plugin-express/src/version.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
// this is autogenerated file, see scripts/version-update.js
1618
export const VERSION = '0.8.0';

plugins/node/opentelemetry-plugin-ioredis/src/ioredis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
import { BasePlugin } from '@opentelemetry/core';
1818
import * as ioredisTypes from 'ioredis';
1919
import * as shimmer from 'shimmer';
20-
import { IORedisPluginConfig } from './types';
20+
import { IoRedisPluginConfig } from './types';
2121
import { traceConnection, traceSendCommand } from './utils';
2222
import { VERSION } from './version';
2323

2424
export class IORedisPlugin extends BasePlugin<typeof ioredisTypes> {
2525
static readonly COMPONENT = 'ioredis';
2626
static readonly DB_TYPE = 'redis';
2727
readonly supportedVersions = ['>1 <5'];
28-
protected _config!: IORedisPluginConfig;
28+
protected _config!: IoRedisPluginConfig;
2929

3030
constructor(readonly moduleName: string) {
3131
super('@opentelemetry/plugin-ioredis', VERSION);

plugins/node/opentelemetry-plugin-ioredis/src/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import * as ioredisTypes from 'ioredis';
1818
import { PluginConfig } from '@opentelemetry/api';
1919

20-
export interface IORedisCommand {
20+
export interface IoRedisCommand {
2121
reject: (err: Error) => void;
2222
resolve: (result: {}) => void;
2323
promise: Promise<{}>;
@@ -26,7 +26,7 @@ export interface IORedisCommand {
2626
name: string;
2727
}
2828

29-
export interface IORedisPluginClientTypes {
29+
export interface IoRedisPluginClientTypes {
3030
// https://github.com/luin/ioredis/blob/master/API.md
3131
options: ioredisTypes.RedisOptions;
3232
}
@@ -39,14 +39,14 @@ export interface IORedisPluginClientTypes {
3939
* @returns serialized string that will be used as the db.statement attribute.
4040
*/
4141
export type DbStatementSerializer = (
42-
cmdName: IORedisCommand['name'],
43-
cmdArgs: IORedisCommand['args']
42+
cmdName: IoRedisCommand['name'],
43+
cmdArgs: IoRedisCommand['args']
4444
) => string;
4545

4646
/**
4747
* Options available for the IORedis Plugin (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-ioredis#ioredis-plugin-options))
4848
*/
49-
export interface IORedisPluginConfig extends PluginConfig {
49+
export interface IoRedisPluginConfig extends PluginConfig {
5050
/** Custom serializer function for the db.statement tag */
5151
dbStatementSerializer?: DbStatementSerializer;
5252
}

plugins/node/opentelemetry-plugin-ioredis/src/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
import * as ioredisTypes from 'ioredis';
1818
import { Tracer, SpanKind, Span, CanonicalCode } from '@opentelemetry/api';
1919
import {
20-
IORedisPluginClientTypes,
21-
IORedisCommand,
22-
IORedisPluginConfig,
20+
IoRedisPluginClientTypes,
21+
IoRedisCommand,
22+
IoRedisPluginConfig,
2323
DbStatementSerializer,
2424
} from './types';
2525
import { IORedisPlugin } from './ioredis';
@@ -38,7 +38,7 @@ const endSpan = (span: Span, err: NodeJS.ErrnoException | null | undefined) => {
3838
};
3939

4040
export const traceConnection = (tracer: Tracer, original: Function) => {
41-
return function (this: ioredisTypes.Redis & IORedisPluginClientTypes) {
41+
return function (this: ioredisTypes.Redis & IoRedisPluginClientTypes) {
4242
const span = tracer.startSpan('connect', {
4343
kind: SpanKind.CLIENT,
4444
attributes: {
@@ -76,13 +76,13 @@ const defaultDbStatementSerializer: DbStatementSerializer = (
7676
export const traceSendCommand = (
7777
tracer: Tracer,
7878
original: Function,
79-
config?: IORedisPluginConfig
79+
config?: IoRedisPluginConfig
8080
) => {
8181
const dbStatementSerializer =
8282
config?.dbStatementSerializer || defaultDbStatementSerializer;
8383
return function (
84-
this: ioredisTypes.Redis & IORedisPluginClientTypes,
85-
cmd?: IORedisCommand
84+
this: ioredisTypes.Redis & IoRedisPluginClientTypes,
85+
cmd?: IoRedisCommand
8686
) {
8787
if (arguments.length < 1 || typeof cmd !== 'object') {
8888
return original.apply(this, arguments);

plugins/node/opentelemetry-plugin-ioredis/src/version.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
// this is autogenerated file, see scripts/version-update.js
1618
export const VERSION = '0.8.0';

plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import * as assert from 'assert';
2727
import * as ioredisTypes from 'ioredis';
2828
import { IORedisPlugin, plugin } from '../src';
2929
import { AttributeNames } from '../src/enums';
30-
import { IORedisPluginConfig, DbStatementSerializer } from '../src/types';
30+
import { IoRedisPluginConfig, DbStatementSerializer } from '../src/types';
3131

3232
const memoryExporter = new InMemorySpanExporter();
3333

@@ -531,7 +531,7 @@ describe('ioredis', () => {
531531
`FOOBAR_${cmdName}: ${cmdArgs[0]}`;
532532
before(() => {
533533
plugin.disable();
534-
const config: IORedisPluginConfig = {
534+
const config: IoRedisPluginConfig = {
535535
dbStatementSerializer,
536536
};
537537
plugin.enable(ioredis, provider, new NoopLogger(), config);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class MongoDBPlugin extends BasePlugin<typeof mongodb> {
5858
shimmer.wrap(
5959
this._moduleExports.Server.prototype,
6060
// Forced to ignore due to incomplete typings
61-
// tslint:disable-next-line:ban-ts-ignore
61+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
6262
// @ts-ignore
6363
fn,
6464
this._getPatchCommand(fn)

0 commit comments

Comments
 (0)