Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/core/src/types/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
* Just an Error object with arbitrary attributes attached to it.
*/
export interface ExtendedError extends Error {
// TODO: fix in v11, convert any to unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
[key: string]: unknown;
}
4 changes: 1 addition & 3 deletions packages/core/src/types/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import type { QueryParams } from './request';
* Data extracted from an incoming request to a node server
*/
export interface ExtractedNodeRequestData {
// TODO: fix in v11, convert any to unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
[key: string]: unknown;

/** Specific headers from the request */
headers?: { [key: string]: string };
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/types/samplingcontext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import type { SpanAttributes } from './span';
* Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
*/
export interface CustomSamplingContext {
// TODO: fix in v11, convert any to unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
[key: string]: unknown;
}

/**
Expand Down
8 changes: 2 additions & 6 deletions packages/core/src/types/stackframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ export interface StackFrame {
in_app?: boolean;
instruction_addr?: string;
addr_mode?: string;
// TODO: fix in v11, convert any to unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vars?: { [key: string]: any };
vars?: { [key: string]: unknown };
debug_id?: string;
// TODO: fix in v11, convert any to unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any
module_metadata?: any;
module_metadata?: Record<string, unknown>;
}
4 changes: 1 addition & 3 deletions packages/core/src/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
* An interface describing a user of an application or a handled request.
*/
export interface User {
// TODO: fix in v11, convert any to unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
[key: string]: unknown;
id?: string | number;
ip_address?: string | null;
email?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/aggregate-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function aggregateExceptionsFromError(
// Recursively call this function in order to walk down a chain of errors
if (isInstanceOf(error[key], Error)) {
applyExceptionGroupFieldsForParentException(exception, exceptionId, error);
const newException = exceptionFromErrorImplementation(parser, error[key] as Error);
const newException = exceptionFromErrorImplementation(parser, error[key]);
const newExceptionId = newExceptions.length;
applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);
newExceptions = aggregateExceptionsFromError(
Expand All @@ -78,7 +78,7 @@ function aggregateExceptionsFromError(
error.errors.forEach((childError, i) => {
if (isInstanceOf(childError, Error)) {
applyExceptionGroupFieldsForParentException(exception, exceptionId, error);
const newException = exceptionFromErrorImplementation(parser, childError as Error);
const newException = exceptionFromErrorImplementation(parser, childError);
const newExceptionId = newExceptions.length;
applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);
newExceptions = aggregateExceptionsFromError(
Expand Down
10 changes: 6 additions & 4 deletions packages/core/src/utils/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,13 @@ export function isSyntheticEvent(wat: unknown): boolean {
* @param base A constructor to be used in a check.
* @returns A boolean representing the result.
*/
// TODO: fix in v11, convert any to unknown
// export function isInstanceOf<T>(wat: unknown, base: { new (...args: any[]): T }): wat is T {
export function isInstanceOf<T>(wat: any, base: any): wat is T {
type Constructor<T> = { new (...args: never[]): T };

export function isInstanceOf<T>(wat: unknown, base: Constructor<T>): wat is T;
export function isInstanceOf(wat: unknown, base: unknown): boolean;
export function isInstanceOf<T>(wat: unknown, base: unknown): wat is T {
try {
return wat instanceof base;
return wat instanceof (base as Constructor<T>);
} catch {
return false;
}
Expand Down