Skip to content

Commit

Permalink
ignore Severity deprecation linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Apr 14, 2022
1 parent 6cd3203 commit caf44a3
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/browser/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class BrowserClient extends BaseClient<BrowserOptions> {
*/
public eventFromMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel = 'info',
hint?: EventHint,
): PromiseLike<Event> {
Expand Down
1 change: 1 addition & 0 deletions packages/browser/src/eventbuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export function eventFromException(
export function eventFromMessage(
stackParser: StackParser,
message: string,
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel = 'info',
hint?: EventHint,
attachStacktrace?: boolean,
Expand Down
1 change: 1 addition & 0 deletions packages/browser/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {
EventStatus,
Exception,
Response,
// eslint-disable-next-line deprecation/deprecation
Severity,
SeverityLevel,
StackFrame,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/baseclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export abstract class BaseClient<O extends Options> implements Client<O> {
*/
public captureMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel,
hint?: EventHint,
scope?: Scope,
Expand Down Expand Up @@ -693,6 +694,7 @@ export abstract class BaseClient<O extends Options> implements Client<O> {
*/
public abstract eventFromMessage(
_message: string,
// eslint-disable-next-line deprecation/deprecation
_level?: Severity | SeverityLevel,
_hint?: EventHint,
): PromiseLike<Event>;
Expand Down
6 changes: 5 additions & 1 deletion packages/core/test/mocks/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export class TestClient extends BaseClient<TestOptions> {
});
}

public eventFromMessage(message: string, level: Severity | SeverityLevel = 'info'): PromiseLike<Event> {
public eventFromMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel = 'info',
): PromiseLike<Event> {
return resolvedSyncPromise({ message, level });
}

Expand Down
7 changes: 6 additions & 1 deletion packages/hub/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ export class Hub implements HubInterface {
/**
* @inheritDoc
*/
public captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string {
public captureMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel,
hint?: EventHint,
): string {
const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
let finalHint = hint;

Expand Down
6 changes: 5 additions & 1 deletion packages/hub/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class Scope implements ScopeInterface {
protected _fingerprint?: string[];

/** Severity */
// eslint-disable-next-line deprecation/deprecation
protected _level?: Severity | SeverityLevel;

/** Transaction Name */
Expand Down Expand Up @@ -209,7 +210,10 @@ export class Scope implements ScopeInterface {
/**
* @inheritDoc
*/
public setLevel(level: Severity | SeverityLevel): this {
public setLevel(
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel,
): this {
this._level = level;
this._notifyScopeListeners();
return this;
Expand Down
6 changes: 5 additions & 1 deletion packages/minimal/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export function captureException(exception: any, captureContext?: CaptureContext
* @param Severity Define the level of the message.
* @returns The generated eventId.
*/
export function captureMessage(message: string, captureContext?: CaptureContext | Severity | SeverityLevel): string {
export function captureMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
captureContext?: CaptureContext | Severity | SeverityLevel,
): string {
const syntheticException = new Error(message);

// This is necessary to provide explicit scopes upgrade, without changing the original
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class NodeClient extends BaseClient<NodeOptions> {
*/
public eventFromMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel = 'info',
hint?: EventHint,
): PromiseLike<Event> {
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/eventbuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export function eventFromUnknownInput(stackParser: StackParser, exception: unkno
export function eventFromMessage(
stackParser: StackParser,
message: string,
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel = 'info',
hint?: EventHint,
attachStacktrace?: boolean,
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {
EventStatus,
Exception,
Response,
// eslint-disable-next-line deprecation/deprecation
Severity,
SeverityLevel,
StackFrame,
Expand Down
1 change: 1 addition & 0 deletions packages/tracing/src/index.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export {
EventStatus,
Exception,
Response,
// eslint-disable-next-line deprecation/deprecation
Severity,
SeverityLevel,
StackFrame,
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/breadcrumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Severity, SeverityLevel } from './severity';
/** JSDoc */
export interface Breadcrumb {
type?: string;
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel;
event_id?: string;
category?: string;
Expand Down
8 changes: 7 additions & 1 deletion packages/types/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface Client<O extends Options = Options> {
*/
captureMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel,
hint?: EventHint,
scope?: Scope,
Expand Down Expand Up @@ -104,7 +105,12 @@ export interface Client<O extends Options = Options> {
eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;

/** Creates an {@link Event} from primitive inputs to `captureMessage`. */
eventFromMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): PromiseLike<Event>;
eventFromMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel,
hint?: EventHint,
): PromiseLike<Event>;

/** Submits the event to Sentry */
sendEvent(event: Event): void;
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Event {
message?: string;
timestamp?: number;
start_timestamp?: number;
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel;
platform?: string;
logger?: string;
Expand Down
7 changes: 6 additions & 1 deletion packages/types/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ export interface Hub {
* @param hint May contain additional information about the original exception.
* @returns The generated eventId.
*/
captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string;
captureMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel,
hint?: EventHint,
): string;

/**
* Captures a manually created event and sends it to Sentry.
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export {
SessionFlusherLike,
} from './session';

// eslint-disable-next-line deprecation/deprecation
export { Severity, SeverityLevel } from './severity';
export { Span, SpanContext } from './span';
export { StackFrame } from './stackframe';
Expand Down
6 changes: 5 additions & 1 deletion packages/types/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type CaptureContext = Scope | Partial<ScopeContext> | ((scope: Scope) =>
/** JSDocs */
export interface ScopeContext {
user: User;
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel;
extra: Extras;
contexts: Contexts;
Expand Down Expand Up @@ -81,7 +82,10 @@ export interface Scope {
* Sets the level on the scope for future events.
* @param level string {@link SeverityLevel}
*/
setLevel(level: Severity | SeverityLevel): this;
setLevel(
// eslint-disable-next-line deprecation/deprecation
level: Severity | SeverityLevel,
): this;

/**
* Sets the transaction name on the scope for future events.
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/severity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable deprecation/deprecation */
import { Severity, SeverityLevel } from '@sentry/types';

// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either
Expand Down

0 comments on commit caf44a3

Please sign in to comment.