Skip to content

Commit

Permalink
fix prettier and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk committed Jul 4, 2024
1 parent f6dd66e commit d807bbc
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
"singleQuote": true,
"arrowParens": "always"
}],
"node/no-deprecated-api": ["warn"],
"n/no-deprecated-api": ["warn"],
"header/header": [2, "block", [
"",
" * Copyright Splunk Inc.",
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"arrowParens": "always",
"trailingComma": "es5",
"singleQuote": true
}
1 change: 1 addition & 0 deletions src/instrumentations/external/sequelize/sequelize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export class SequelizeInstrumentation extends InstrumentationBase {
else tableName = extractTableFromQuery(statement);
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const attributes: Record<string, any> = {
[SemanticAttributes.DB_SYSTEM]: sequelizeInstance.getDialect(),
[SemanticAttributes.DB_USER]: config?.username,
Expand Down
2 changes: 2 additions & 0 deletions src/instrumentations/external/typeorm/typeorm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export class TypeormInstrumentation extends InstrumentationBase {
return original.apply(this, args);
}
const connectionOptions = this?.connection?.options ?? {};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const attributes: Record<string, any> = {
[SemanticAttributes.DB_SYSTEM]: connectionOptions.type,
[SemanticAttributes.DB_USER]: connectionOptions.username,
Expand Down Expand Up @@ -294,6 +295,7 @@ export class TypeormInstrumentation extends InstrumentationBase {
const operation = this.expressionMap.queryType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const connectionOptions: any = this.connection?.options;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const attributes: Record<string, any> = {
[SemanticAttributes.DB_SYSTEM]: connectionOptions.type,
[SemanticAttributes.DB_USER]: connectionOptions.username,
Expand Down
1 change: 0 additions & 1 deletion src/instrumentations/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function parseUrlParams(request: IncomingMessage) {

try {
// As long as Node <11 is supported, need to use the legacy API.
// eslint-disable-next-line node/no-deprecated-api
return Url.parse(request.url || '', true).query;

Check warning on line 48 in src/instrumentations/http.ts

View workflow job for this annotation

GitHub Actions / lint

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead
} catch (err) {
diag.debug(`error parsing url '${request.url}`, err);
Expand Down
1 change: 1 addition & 0 deletions src/tracing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ interface ShutDownableTracerProvider extends TracerProvider {
function isShutDownable(
tracerProvider: TracerProvider
): tracerProvider is ShutDownableTracerProvider {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return typeof (tracerProvider as any).shutdown === 'function';
}

Expand Down
1 change: 0 additions & 1 deletion src/tracing/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { B3Propagator, B3InjectEncoding } from '@opentelemetry/propagator-b3';

import { getInstrumentations } from '../instrumentations';
import { OTLPTraceExporter as OTLPHttpTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
// eslint-disable-next-line node/no-extraneous-import
import type * as OtlpGrpc from '@opentelemetry/exporter-trace-otlp-grpc';
import type * as grpc from '@grpc/grpc-js';
import { detect as detectResource } from '../resource';
Expand Down
3 changes: 3 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const formatStringSet = (set: Set<string> | string[]) => {
};

export function assertNoExtraneousProperties(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
obj: Record<string, any>,
expectedProps: string[]
) {
Expand Down Expand Up @@ -206,10 +207,12 @@ export function parseLogLevel(value: string | undefined): DiagLogLevel {
return DiagLogLevel.NONE;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function pick<T extends Record<string, any>, K extends string>(
obj: T,
keys: readonly K[]
): { [P in keyof T as P extends K ? P : never]: T[P] } {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result = {} as any;
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
Expand Down

0 comments on commit d807bbc

Please sign in to comment.