Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
lint: revert exact prop types changes
  • Loading branch information
logaretm committed Mar 10, 2026
commit dbf0ee57a89a50a26971c2ac18c5d23ec87cb4c2
1 change: 1 addition & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"no-unsafe-optional-chaining": "off",
"no-eval": "off",
"no-import-assign": "off",
"typescript/no-duplicate-type-constituents": "off",

// === Custom SDK rules (via JS plugin) ===
"sdk/no-eq-empty": "error"
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export declare const contextLinesIntegration: typeof clientSdk.contextLinesInteg
export declare const getDefaultIntegrations: (options: Options) => Integration[];
export declare const defaultStackParser: StackParser;

export declare function close(timeout?: number): PromiseLike<boolean>;
export declare function flush(timeout?: number): PromiseLike<boolean>;
export declare function close(timeout?: number | undefined): PromiseLike<boolean>;
export declare function flush(timeout?: number | undefined): PromiseLike<boolean>;

export declare const Span: clientSdk.Span;

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
* Receives an Event & EventHint as arguments.
* @returns {() => void} A function that, when executed, removes the registered callback.
*/
public on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint) => void): () => void;
public on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint | undefined) => void): () => void;

/**
* Register a callback for before sending a session or session aggregrates..
Expand All @@ -652,15 +652,15 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
* Receives an Event & EventHint as arguments.
* @returns {() => void} A function that, when executed, removes the registered callback.
*/
public on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint) => void): () => void;
public on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint | undefined) => void): () => void;

/**
* Register a callback for postprocessing an event,
* after it was passed to (global) event processors, before it is being sent.
* Receives an Event & EventHint as arguments.
* @returns {() => void} A function that, when executed, removes the registered callback.
*/
public on(hook: 'postprocessEvent', callback: (event: Event, hint?: EventHint) => void): () => void;
public on(hook: 'postprocessEvent', callback: (event: Event, hint?: EventHint | undefined) => void): () => void;

/**
* Register a callback for when an event has been sent.
Expand Down Expand Up @@ -1321,7 +1321,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
throw _makeDoNotSendEventError('An event processor returned `null`, will not send event.');
}

const isInternalException = (hint.data as { __sentry__?: boolean })?.__sentry__ === true;
const isInternalException = (hint.data as { __sentry__: boolean })?.__sentry__ === true;
if (isInternalException) {
return prepared;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tracing/sentryNonRecordingSpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class SentryNonRecordingSpan implements Span {
* @hidden
* @internal
*/
public recordException(_exception: unknown, _time?: number): void {
public recordException(_exception: unknown, _time?: number | undefined): void {
// noop
}
}
2 changes: 1 addition & 1 deletion packages/core/src/tracing/sentrySpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class SentrySpan implements Span {
* @hidden
* @internal
*/
public recordException(_exception: unknown, _time?: number): void {
public recordException(_exception: unknown, _time?: number | undefined): void {
// noop
}

Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/utils/hasSpansEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ declare const __SENTRY_TRACING__: boolean | undefined;
* @param maybeOptions An SDK options object to be passed to this function.
* If this option is not provided, the function will use the current client's options.
*/
export function hasSpansEnabled(maybeOptions?: Pick<CoreOptions, 'tracesSampleRate' | 'tracesSampler'>): boolean {
export function hasSpansEnabled(
maybeOptions?: Pick<CoreOptions, 'tracesSampleRate' | 'tracesSampler'> | undefined,
): boolean {
if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type PartialURL = {
};

interface URLwithCanParse extends URL {
canParse: (url: string, base?: string | URL) => boolean;
canParse: (url: string, base?: string | URL | undefined) => boolean;
}

// A subset of the URL object that is valid for relative URLs
Expand Down Expand Up @@ -60,7 +60,7 @@ export function isURLObjectRelative(url: URLObject): url is RelativeURL {
* @param url - The URL to parse
* @returns The parsed URL object or undefined if the URL is invalid
*/
export function parseStringToURLObject(url: string, urlBase?: string | URL): URLObject | undefined {
export function parseStringToURLObject(url: string, urlBase?: string | URL | undefined): URLObject | undefined {
const isRelative = url.indexOf('://') <= 0 && url.indexOf('//') !== 0;
const base = urlBase ?? (isRelative ? DEFAULT_BASE_URL : undefined);
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/deno/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DenoClient extends ServerRuntimeClient<DenoClientOptions> {

/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
public async close(timeout?: number): PromiseLike<boolean> {
public async close(timeout?: number | undefined): PromiseLike<boolean> {
if (this._logOnExitFlushListener) {
globalThis.removeEventListener('unload', this._logOnExitFlushListener);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class AsyncSession implements DebugSession {
//
}

public static async create(orDefault?: DebugSession): Promise<DebugSession> {
public static async create(orDefault?: DebugSession | undefined): Promise<DebugSession> {
if (orDefault) {
return orDefault;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/light/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class LightNodeClient extends ServerRuntimeClient<NodeClientOptions> {

/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
public async close(timeout?: number): PromiseLike<boolean> {
public async close(timeout?: number | undefined): PromiseLike<boolean> {
if (this._clientReportInterval) {
clearInterval(this._clientReportInterval);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/sdk/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class NodeClient extends ServerRuntimeClient<NodeClientOptions> {

/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
public async close(timeout?: number): PromiseLike<boolean> {
public async close(timeout?: number | undefined): PromiseLike<boolean> {
if (this._clientReportInterval) {
clearInterval(this._clientReportInterval);
}
Expand Down
Loading