10BC0 Merge branch 'remove-exports-class-logs' of github.com:svetlanabrenna… · open-telemetry/opentelemetry-js@c875d5b · GitHub
[go: up one dir, main page]

Skip to content

Commit c875d5b

Browse files
Merge branch 'remove-exports-class-logs' of github.com:svetlanabrennan/opentelemetry-js into remove-exports-class-logs
2 parents 3a347c4 + 9f67c85 commit c875d5b

File tree

74 files changed

+7586
-5636
lines changed

Some content is hidden

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

74 files changed

+7586
-5636
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ This minimum support level is subject to change as the project evolves and as th
146146
## TypeScript Support
147147

148148
OpenTelemetry JavaScript is built with TypeScript `v5.0.4`. If you have a TypeScript project (app, library, instrumentation, etc.)
149-
that depends on it we recomed using same or higher version to compile the project.
149+
that depends on it, we recommend using same or higher version to compile the project.
150150

151151
OpenTelemetry JavaScript will follows DefinitelyType's [support policy for TypeScript](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) which sets a support window of 2 years. Support for TypeScript versions older than 2 years will be dropped in minor releases of OpenTelemetry JavaScript.
152152

api/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ All notable changes to this project will be documented in this file.
99

1010
### :rocket: (Enhancement)
1111

12+
* feat(diag): change types in `DiagComponentLogger` from `any` to `unknown`[#5478](https://github.com/open-telemetry/opentelemetry-js/pull/5478) @loganrosen
13+
1214
### :bug: (Bug Fix)
1315

1416
### :books: (Refine Doc)

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"memfs": "3.5.3",
9393
"mocha": "11.1.0",
9494
"nyc": "17.1.0",
95-
"sinon": "15.1.2",
95+
"sinon": "18.0.1",
9696
"ts-loader": "9.5.2",
9797
"typescript": "5.0.4",
9898
"unionfs": "4.5.4",

api/src/diag/ComponentLogger.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,31 @@ export class DiagComponentLogger implements DiagLogger {
3333
this._namespace = props.namespace || 'DiagComponentLogger';
3434
}
3535

36-
public debug(...args: any[]): void {
36+
public debug(...args: unknown[]): void {
3737
return logProxy('debug', this._namespace, args);
3838
}
3939

40-
public error(...args: any[]): void {
40+
public error(...args: unknown[]): void {
4141
return logProxy('error', this._namespace, args);
4242
}
4343

44-
public info(...args: any[]): void {
44+
public info(...args: unknown[]): void {
4545
return logProxy('info', this._namespace, args);
4646
}
4747

48-
public warn(...args: any[]): void {
48+
public warn(...args: unknown[]): void {
4949
return logProxy('warn', this._namespace, args);
5050
}
5151

52-
public verbose(...args: any[]): void {
52+
public verbose(...args: unknown[]): void {
5353
return logProxy('verbose', this._namespace, args);
5454
}
5555
}
5656

5757
function logProxy(
5858
funcName: keyof DiagLogger,
5959
namespace: string,
60-
args: any
60+
args: unknown[]
6161
): void {
6262
const logger = getGlobal('diag');
6363
// shortcut if logger not set

api/src/propagation/TextMapPropagator.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { Context } from '../context/types';
2929
*
3030
* @since 1.0.0
3131
*/
32+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3233
export interface TextMapPropagator<Carrier = any> {
3334
/**
3435
* Injects values from a given `Context` into a carrier.
@@ -79,6 +80,7 @@ export interface TextMapPropagator<Carrier = any> {
7980
*
8081
* @since 1.0.0
8182
*/
83+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8284
export interface TextMapSetter<Carrier = any> {
8385
/**
8486
* Callback used to set a key/value pair on an object.
@@ -99,6 +101,7 @@ export interface TextMapSetter<Carrier = any> {
99101
*
100102
* @since 1.0.0
101103
*/
104+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
102105
export interface TextMapGetter<Carrier = any> {
103106
/**
104107
* Get a list of all keys available on the carrier.

api/src/trace/NoopTracer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ export class NoopTracer implements Tracer {
9999
}
100100
}
101101

102-
function isSpanContext(spanContext: any): spanContext is SpanContext {
102+
function isSpanContext(spanContext: unknown): spanContext is SpanContext {
103103
return (
104+
spanContext !== null &&
104105
typeof spanContext === 'object' &&
106+
'spanId' in spanContext &&
105107
typeof spanContext['spanId'] === 'string' &&
108+
'traceId' in spanContext &&
106109
typeof spanContext['traceId'] === 'string' &&
110+
'traceFlags' in spanContext &&
107111
typeof spanContext['traceFlags'] === 'number'
108112
);
109113
}

eslint.base.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
// Enable typescript-eslint for ts files.
3333
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
3434
parserOptions: {
35-
"project": "./tsconfig.json"
35+
"projectService": true
3636
},
3737
rules: {
3838
"@typescript-eslint/no-floating-promises": "error",
@@ -49,11 +49,7 @@ module.exports = {
4949
"@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}],
5050
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
5151
"@typescript-eslint/no-empty-function": ["off"],
52-
"@typescript-eslint/ban-types": ["warn", {
53-
"types": {
54-
"Function": null,
55-
}
56-
}],
52+
"@typescript-eslint/no-unsafe-function-type": ["warn"],
5753
"@typescript-eslint/no-shadow": ["warn"],
5854
"no-restricted-syntax": ["error", "ExportAllDeclaration"],
5955
"prefer-rest-params": "off",
@@ -64,20 +60,16 @@ module.exports = {
6460
// Enable typescript-eslint for ts files.
6561
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
6662
parserOptions: {
67-
"project": "./tsconfig.json"
63+
"projectService": true
6864
},
6965
rules: {
7066
"no-empty": "off",
7167
"@typescript-eslint/ban-ts-ignore": "off",
72-
"@typescript-eslint/ban-types": ["warn", {
73-
"types": {
74-
"Function": null,
75-
}
76-
}],
68+
"@typescript-eslint/no-unsafe-function-type": ["warn"],
7769
"@typescript-eslint/no-empty-function": "off",
7870
"@typescript-eslint/no-explicit-any": "off",
7971
"@typescript-eslint/no-unused-vars": "off",
80-
"@typescript-eslint/no-var-requires": "off",
72+
"@typescript-eslint/no-require-imports": "off",
8173
"@typescript-eslint/no-shadow": ["off"],
8274
"@typescript-eslint/no-floating-promises": ["off"],
8375
"@typescript-eslint/no-non-null-assertion": ["off"],

experimental/packages/exporter-logs-otlp-grpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"lerna": "6.6.2",
6060
"mocha": "11.1.0",
6161
"nyc": "17.1.0",
62-
"sinon": "15.1.2",
62+
"sinon": "18.0.1",
6363
"ts-loader": "9.5.2",
6464
"typescript": "5.0.4"
6565
},

experimental/packages/exporter-logs-otlp-http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lerna": "6.6.2",
9191
"mocha": "11.1.0",
9292
"nyc": "17.1.0",
93-
"sinon": "15.1.2",
93+
"sinon": "18.0.1",
9494
"ts-loader": "9.5.2",
9595
"typescript": "5.0.4",
9696
"webpack": "5.99.9",

experimental/packages/exporter-logs-otlp-proto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"lerna": "6.6.2",
8181
"mocha": "11.1.0",
8282
"nyc": "17.1.0",
83-
"sinon": "15.1.2",
83+
"sinon": "18.0.1",
8484
"ts-loader": "9.5.2",
8585
"typescript": "5.0.4",
8686
"webpack": "5.99.9",

0 commit comments

Comments
 (0)
0