diff --git a/packages/angular/src/errorhandler.ts b/packages/angular/src/errorhandler.ts index cf89b0e69eec..941029c2ff9f 100644 --- a/packages/angular/src/errorhandler.ts +++ b/packages/angular/src/errorhandler.ts @@ -1,5 +1,6 @@ import { HttpErrorResponse } from '@angular/common/http'; -import { ErrorHandler as AngularErrorHandler, Inject, Injectable } from '@angular/core'; +import type { ErrorHandler as AngularErrorHandler } from '@angular/core'; +import { Inject, Injectable } from '@angular/core'; import * as Sentry from '@sentry/browser'; import { captureException } from '@sentry/browser'; import { addExceptionMechanism, isString } from '@sentry/utils'; diff --git a/packages/angular/src/sdk.ts b/packages/angular/src/sdk.ts index 93b6148f2943..bd0cbd99747b 100644 --- a/packages/angular/src/sdk.ts +++ b/packages/angular/src/sdk.ts @@ -1,5 +1,6 @@ import { VERSION } from '@angular/core'; -import { BrowserOptions, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser'; +import type { BrowserOptions } from '@sentry/browser'; +import { init as browserInit, SDK_VERSION, setContext } from '@sentry/browser'; import { logger } from '@sentry/utils'; import { ANGULAR_MINIMUM_VERSION } from './constants'; diff --git a/packages/angular/src/tracing.ts b/packages/angular/src/tracing.ts index d2bf67900f3f..56c14b36f409 100644 --- a/packages/angular/src/tracing.ts +++ b/packages/angular/src/tracing.ts @@ -1,10 +1,13 @@ /* eslint-disable max-lines */ -import { AfterViewInit, Directive, Injectable, Input, NgModule, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRouteSnapshot, Event, NavigationEnd, NavigationStart, ResolveEnd, Router } from '@angular/router'; +import type { AfterViewInit, OnDestroy, OnInit } from '@angular/core'; +import { Directive, Injectable, Input, NgModule } from '@angular/core'; +import type { ActivatedRouteSnapshot, Event, Router } from '@angular/router'; +import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router'; import { getCurrentHub, WINDOW } from '@sentry/browser'; -import { Span, Transaction, TransactionContext } from '@sentry/types'; +import type { Span, Transaction, TransactionContext } from '@sentry/types'; import { logger, stripUrlQueryAndFragment, timestampWithMs } from '@sentry/utils'; -import { Observable, Subscription } from 'rxjs'; +import type { Observable } from 'rxjs'; +import { Subscription } from 'rxjs'; import { filter, tap } from 'rxjs/operators'; import { ANGULAR_INIT_OP, ANGULAR_OP, ANGULAR_ROUTING_OP } from './constants'; diff --git a/packages/angular/test/tracing.test.ts b/packages/angular/test/tracing.test.ts index d5a88c9bb082..18bc1324f1eb 100644 --- a/packages/angular/test/tracing.test.ts +++ b/packages/angular/test/tracing.test.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ActivatedRouteSnapshot } from '@angular/router'; -import { Hub } from '@sentry/types'; +import type { ActivatedRouteSnapshot } from '@angular/router'; +import type { Hub } from '@sentry/types'; import { instrumentAngularRouting, TraceClassDecorator, TraceDirective, TraceMethodDecorator } from '../src'; import { getParameterizedRouteFromSnapshot } from '../src/tracing'; diff --git a/packages/angular/test/utils/index.ts b/packages/angular/test/utils/index.ts index 0f4ff55b0b23..b15ad2028560 100644 --- a/packages/angular/test/utils/index.ts +++ b/packages/angular/test/utils/index.ts @@ -1,8 +1,10 @@ import { Component, NgModule } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { Router, Routes } from '@angular/router'; +import type { ComponentFixture } from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; +import type { Routes } from '@angular/router'; +import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { instrumentAngularRouting, TraceService } from '../../src'; diff --git a/packages/browser/src/client.ts b/packages/browser/src/client.ts index dbec43cd19cd..fe0265cfd98b 100644 --- a/packages/browser/src/client.ts +++ b/packages/browser/src/client.ts @@ -1,13 +1,21 @@ -import { BaseClient, getEnvelopeEndpointWithUrlEncodedAuth, Scope, SDK_VERSION } from '@sentry/core'; -import type { BrowserClientReplayOptions } from '@sentry/types'; -import { ClientOptions, Event, EventHint, Options, Severity, SeverityLevel } from '@sentry/types'; +import type { Scope } from '@sentry/core'; +import { BaseClient, getEnvelopeEndpointWithUrlEncodedAuth, SDK_VERSION } from '@sentry/core'; +import type { + BrowserClientReplayOptions, + ClientOptions, + Event, + EventHint, + Options, + Severity, + SeverityLevel, +} from '@sentry/types'; import { createClientReportEnvelope, dsnToString, logger, serializeEnvelope } from '@sentry/utils'; import { eventFromException, eventFromMessage } from './eventbuilder'; import { WINDOW } from './helpers'; -import { Breadcrumbs } from './integrations'; +import type { Breadcrumbs } from './integrations'; import { BREADCRUMB_INTEGRATION_ID } from './integrations/breadcrumbs'; -import { BrowserTransportOptions } from './transports/types'; +import type { BrowserTransportOptions } from './transports/types'; /** * Configuration options for the Sentry Browser SDK. * @see @sentry/types Options for more information. diff --git a/packages/browser/src/eventbuilder.ts b/packages/browser/src/eventbuilder.ts index d089a5b670e0..4db58b9b7b43 100644 --- a/packages/browser/src/eventbuilder.ts +++ b/packages/browser/src/eventbuilder.ts @@ -1,5 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types'; +import type { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types'; import { addExceptionMechanism, addExceptionTypeValue, diff --git a/packages/browser/src/helpers.ts b/packages/browser/src/helpers.ts index 7b56e30fa829..5f7b6cee7df3 100644 --- a/packages/browser/src/helpers.ts +++ b/packages/browser/src/helpers.ts @@ -1,5 +1,5 @@ import { captureException, withScope } from '@sentry/core'; -import { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types'; +import type { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types'; import { addExceptionMechanism, addExceptionTypeValue, diff --git a/packages/browser/src/integrations/breadcrumbs.ts b/packages/browser/src/integrations/breadcrumbs.ts index 8ffeb5a9f99d..b54aad03e9b2 100644 --- a/packages/browser/src/integrations/breadcrumbs.ts +++ b/packages/browser/src/integrations/breadcrumbs.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable max-lines */ import { getCurrentHub } from '@sentry/core'; -import { Event, Integration } from '@sentry/types'; +import type { Event, Integration } from '@sentry/types'; import { addInstrumentationHandler, getEventDescription, diff --git a/packages/browser/src/integrations/dedupe.ts b/packages/browser/src/integrations/dedupe.ts index aaaef31d7257..84d6d983812b 100644 --- a/packages/browser/src/integrations/dedupe.ts +++ b/packages/browser/src/integrations/dedupe.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types'; +import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types'; import { logger } from '@sentry/utils'; /** Deduplication filter */ diff --git a/packages/browser/src/integrations/globalhandlers.ts b/packages/browser/src/integrations/globalhandlers.ts index 79d5d3d6a444..5bfdc126a712 100644 --- a/packages/browser/src/integrations/globalhandlers.ts +++ b/packages/browser/src/integrations/globalhandlers.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { getCurrentHub } from '@sentry/core'; -import { Event, EventHint, Hub, Integration, Primitive, StackParser } from '@sentry/types'; +import type { Event, EventHint, Hub, Integration, Primitive, StackParser } from '@sentry/types'; import { addExceptionMechanism, addInstrumentationHandler, @@ -11,7 +11,7 @@ import { logger, } from '@sentry/utils'; -import { BrowserClient } from '../client'; +import type { BrowserClient } from '../client'; import { eventFromUnknownInput } from '../eventbuilder'; import { shouldIgnoreOnError } from '../helpers'; diff --git a/packages/browser/src/integrations/httpcontext.ts b/packages/browser/src/integrations/httpcontext.ts index 88f2873882d4..24b6df24312a 100644 --- a/packages/browser/src/integrations/httpcontext.ts +++ b/packages/browser/src/integrations/httpcontext.ts @@ -1,5 +1,5 @@ import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core'; -import { Event, Integration } from '@sentry/types'; +import type { Event, Integration } from '@sentry/types'; import { WINDOW } from '../helpers'; diff --git a/packages/browser/src/integrations/linkederrors.ts b/packages/browser/src/integrations/linkederrors.ts index 8fa4413f5a83..bb53d0210f96 100644 --- a/packages/browser/src/integrations/linkederrors.ts +++ b/packages/browser/src/integrations/linkederrors.ts @@ -1,8 +1,8 @@ import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core'; -import { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types'; +import type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types'; import { isInstanceOf } from '@sentry/utils'; -import { BrowserClient } from '../client'; +import type { BrowserClient } from '../client'; import { exceptionFromError } from '../eventbuilder'; const DEFAULT_KEY = 'cause'; diff --git a/packages/browser/src/integrations/trycatch.ts b/packages/browser/src/integrations/trycatch.ts index 2690b977ce80..d29be09a6a0b 100644 --- a/packages/browser/src/integrations/trycatch.ts +++ b/packages/browser/src/integrations/trycatch.ts @@ -1,4 +1,4 @@ -import { Integration, WrappedFunction } from '@sentry/types'; +import type { Integration, WrappedFunction } from '@sentry/types'; import { fill, getFunctionName, getOriginalFunction } from '@sentry/utils'; import { WINDOW, wrap } from '../helpers'; diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index 9b10074f8b51..c7f2ed74194a 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -1,8 +1,8 @@ +import type { Hub } from '@sentry/core'; import { getCurrentHub, getIntegrationsToSetup, getReportDialogEndpoint, - Hub, initAndBind, Integrations as CoreIntegrations, } from '@sentry/core'; @@ -14,8 +14,10 @@ import { supportsFetch, } from '@sentry/utils'; -import { BrowserClient, BrowserClientOptions, BrowserOptions } from './client'; -import { ReportDialogOptions, WINDOW, wrap as internalWrap } from './helpers'; +import type { BrowserClientOptions, BrowserOptions } from './client'; +import { BrowserClient } from './client'; +import type { ReportDialogOptions } from './helpers'; +import { WINDOW, wrap as internalWrap } from './helpers'; import { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations'; import { defaultStackParser } from './stack-parsers'; import { makeFetchTransport, makeXHRTransport } from './transports'; diff --git a/packages/browser/src/stack-parsers.ts b/packages/browser/src/stack-parsers.ts index eeb08c882d8c..7e77a6c0d8e3 100644 --- a/packages/browser/src/stack-parsers.ts +++ b/packages/browser/src/stack-parsers.ts @@ -1,4 +1,4 @@ -import { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types'; +import type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types'; import { createStackParser } from '@sentry/utils'; // global reference to slice diff --git a/packages/browser/src/transports/fetch.ts b/packages/browser/src/transports/fetch.ts index 5f64bcdde841..83b75c82ba39 100644 --- a/packages/browser/src/transports/fetch.ts +++ b/packages/browser/src/transports/fetch.ts @@ -1,9 +1,10 @@ import { createTransport } from '@sentry/core'; -import { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types'; +import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types'; import { rejectedSyncPromise } from '@sentry/utils'; -import { BrowserTransportOptions } from './types'; -import { clearCachedFetchImplementation, FetchImpl, getNativeFetchImplementation } from './utils'; +import type { BrowserTransportOptions } from './types'; +import type { FetchImpl } from './utils'; +import { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils'; /** * Creates a Transport that uses the Fetch API to send events to Sentry. diff --git a/packages/browser/src/transports/types.ts b/packages/browser/src/transports/types.ts index 4f4b7ef2c98a..e0ed666cc787 100644 --- a/packages/browser/src/transports/types.ts +++ b/packages/browser/src/transports/types.ts @@ -1,4 +1,4 @@ -import { BaseTransportOptions } from '@sentry/types'; +import type { BaseTransportOptions } from '@sentry/types'; export interface BrowserTransportOptions extends BaseTransportOptions { /** Fetch API init parameters. Used by the FetchTransport */ diff --git a/packages/browser/src/transports/xhr.ts b/packages/browser/src/transports/xhr.ts index b10ca4e2b7ca..8fae5dc8067e 100644 --- a/packages/browser/src/transports/xhr.ts +++ b/packages/browser/src/transports/xhr.ts @@ -1,8 +1,8 @@ import { createTransport } from '@sentry/core'; -import { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types'; +import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types'; import { SyncPromise } from '@sentry/utils'; -import { BrowserTransportOptions } from './types'; +import type { BrowserTransportOptions } from './types'; /** * The DONE ready state for XmlHttpRequest diff --git a/packages/browser/test/unit/eventbuilder.test.ts b/packages/browser/test/unit/eventbuilder.test.ts index 62a70a4b2740..ac9b564e99e0 100644 --- a/packages/browser/test/unit/eventbuilder.test.ts +++ b/packages/browser/test/unit/eventbuilder.test.ts @@ -1,4 +1,4 @@ -import { Client } from '@sentry/types'; +import type { Client } from '@sentry/types'; import { defaultStackParser } from '../../src'; import { eventFromPlainObject } from '../../src/eventbuilder'; diff --git a/packages/browser/test/unit/helper/browser-client-options.ts b/packages/browser/test/unit/helper/browser-client-options.ts index 9bdaf2518d40..8ca73faa2d23 100644 --- a/packages/browser/test/unit/helper/browser-client-options.ts +++ b/packages/browser/test/unit/helper/browser-client-options.ts @@ -1,7 +1,7 @@ import { createTransport } from '@sentry/core'; import { resolvedSyncPromise } from '@sentry/utils'; -import { BrowserClientOptions } from '../../../src/client'; +import type { BrowserClientOptions } from '../../../src/client'; export function getDefaultBrowserClientOptions(options: Partial = {}): BrowserClientOptions { return { diff --git a/packages/browser/test/unit/index.test.ts b/packages/browser/test/unit/index.test.ts index 8a59db3bdd46..8bc3ffab36e1 100644 --- a/packages/browser/test/unit/index.test.ts +++ b/packages/browser/test/unit/index.test.ts @@ -1,5 +1,6 @@ import { getReportDialogEndpoint, SDK_VERSION } from '@sentry/core'; +import type { Event } from '../../src'; import { addBreadcrumb, BrowserClient, @@ -7,7 +8,6 @@ import { captureException, captureMessage, configureScope, - Event, flush, getCurrentHub, init, diff --git a/packages/browser/test/unit/integrations/helpers.test.ts b/packages/browser/test/unit/integrations/helpers.test.ts index e17ef73d4e1c..a3fe734d79d4 100644 --- a/packages/browser/test/unit/integrations/helpers.test.ts +++ b/packages/browser/test/unit/integrations/helpers.test.ts @@ -1,4 +1,4 @@ -import { WrappedFunction } from '@sentry/types'; +import type { WrappedFunction } from '@sentry/types'; import { spy } from 'sinon'; import { wrap } from '../../../src/helpers'; diff --git a/packages/browser/test/unit/integrations/linkederrors.test.ts b/packages/browser/test/unit/integrations/linkederrors.test.ts index 1a80a86093b2..40738ca2af09 100644 --- a/packages/browser/test/unit/integrations/linkederrors.test.ts +++ b/packages/browser/test/unit/integrations/linkederrors.test.ts @@ -1,4 +1,4 @@ -import { Event as SentryEvent, Exception, ExtendedError } from '@sentry/types'; +import type { Event as SentryEvent, Exception, ExtendedError } from '@sentry/types'; import { BrowserClient } from '../../../src/client'; import * as LinkedErrorsModule from '../../../src/integrations/linkederrors'; diff --git a/packages/browser/test/unit/sdk.test.ts b/packages/browser/test/unit/sdk.test.ts index facf8f9f4aae..4afac502c562 100644 --- a/packages/browser/test/unit/sdk.test.ts +++ b/packages/browser/test/unit/sdk.test.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/unbound-method */ import { createTransport, Scope } from '@sentry/core'; import { MockIntegration } from '@sentry/core/test/lib/sdk.test'; -import { Client, Integration } from '@sentry/types'; +import type { Client, Integration } from '@sentry/types'; import { resolvedSyncPromise } from '@sentry/utils'; -import { BrowserOptions } from '../../src'; +import type { BrowserOptions } from '../../src'; import { init } from '../../src/sdk'; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/browser/test/unit/transports/fetch.test.ts b/packages/browser/test/unit/transports/fetch.test.ts index 624a3d1d007a..53ed5c34e21b 100644 --- a/packages/browser/test/unit/transports/fetch.test.ts +++ b/packages/browser/test/unit/transports/fetch.test.ts @@ -1,10 +1,10 @@ -import { EventEnvelope, EventItem } from '@sentry/types'; +import type { EventEnvelope, EventItem } from '@sentry/types'; import { createEnvelope, serializeEnvelope } from '@sentry/utils'; import { TextEncoder } from 'util'; import { makeFetchTransport } from '../../../src/transports/fetch'; -import { BrowserTransportOptions } from '../../../src/transports/types'; -import { FetchImpl } from '../../../src/transports/utils'; +import type { BrowserTransportOptions } from '../../../src/transports/types'; +import type { FetchImpl } from '../../../src/transports/utils'; const DEFAULT_FETCH_TRANSPORT_OPTIONS: BrowserTransportOptions = { url: 'https://sentry.io/api/42/store/?sentry_key=123&sentry_version=7', diff --git a/packages/browser/test/unit/transports/xhr.test.ts b/packages/browser/test/unit/transports/xhr.test.ts index 117edce8d2ea..07ca7f4e07dc 100644 --- a/packages/browser/test/unit/transports/xhr.test.ts +++ b/packages/browser/test/unit/transports/xhr.test.ts @@ -1,8 +1,8 @@ -import { EventEnvelope, EventItem } from '@sentry/types'; +import type { EventEnvelope, EventItem } from '@sentry/types'; import { createEnvelope, serializeEnvelope } from '@sentry/utils'; import { TextEncoder } from 'util'; -import { BrowserTransportOptions } from '../../../src/transports/types'; +import type { BrowserTransportOptions } from '../../../src/transports/types'; import { makeXHRTransport } from '../../../src/transports/xhr'; const DEFAULT_XHR_TRANSPORT_OPTIONS: BrowserTransportOptions = { diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index f454e148cc6c..7191871d9ec4 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -1,4 +1,4 @@ -import { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types'; +import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types'; import { dsnToString, makeDsn, urlEncode } from '@sentry/utils'; const SENTRY_API_VERSION = '7'; diff --git a/packages/core/src/baseclient.ts b/packages/core/src/baseclient.ts index eb674a46ab99..957e7f6321d2 100644 --- a/packages/core/src/baseclient.ts +++ b/packages/core/src/baseclient.ts @@ -1,5 +1,5 @@ /* eslint-disable max-lines */ -import { +import type { Client, ClientOptions, DataCategory, @@ -37,8 +37,9 @@ import { import { getEnvelopeEndpointWithUrlEncodedAuth } from './api'; import { createEventEnvelope, createSessionEnvelope } from './envelope'; -import { IntegrationIndex, setupIntegration, setupIntegrations } from './integration'; -import { Scope } from './scope'; +import type { IntegrationIndex } from './integration'; +import { setupIntegration, setupIntegrations } from './integration'; +import type { Scope } from './scope'; import { updateSession } from './session'; import { prepareEvent } from './utils/prepareEvent'; diff --git a/packages/core/src/envelope.ts b/packages/core/src/envelope.ts index 2ae474dd99b0..0a4cd6a87870 100644 --- a/packages/core/src/envelope.ts +++ b/packages/core/src/envelope.ts @@ -1,4 +1,4 @@ -import { +import type { DsnComponents, Event, EventEnvelope, diff --git a/packages/core/src/exports.ts b/packages/core/src/exports.ts index 97a70d327b8a..72a5f8587f94 100644 --- a/packages/core/src/exports.ts +++ b/packages/core/src/exports.ts @@ -1,4 +1,4 @@ -import { +import type { Breadcrumb, CaptureContext, CustomSamplingContext, @@ -13,8 +13,9 @@ import { User, } from '@sentry/types'; -import { getCurrentHub, Hub } from './hub'; -import { Scope } from './scope'; +import type { Hub } from './hub'; +import { getCurrentHub } from './hub'; +import type { Scope } from './scope'; // Note: All functions in this file are typed with a return value of `ReturnType`, // where HUB_FUNCTION is some method on the Hub class. diff --git a/packages/core/src/hub.ts b/packages/core/src/hub.ts index aa3a8015c0a0..dde906bffde5 100644 --- a/packages/core/src/hub.ts +++ b/packages/core/src/hub.ts @@ -1,5 +1,5 @@ /* eslint-disable max-lines */ -import { +import type { Breadcrumb, BreadcrumbHint, Client, diff --git a/packages/core/src/integration.ts b/packages/core/src/integration.ts index b8c9ef16da6d..77d232b00987 100644 --- a/packages/core/src/integration.ts +++ b/packages/core/src/integration.ts @@ -1,4 +1,4 @@ -import { Integration, Options } from '@sentry/types'; +import type { Integration, Options } from '@sentry/types'; import { arrayify, logger } from '@sentry/utils'; import { getCurrentHub } from './hub'; diff --git a/packages/core/src/integrations/functiontostring.ts b/packages/core/src/integrations/functiontostring.ts index 6eb1cdbda123..d26a49b99780 100644 --- a/packages/core/src/integrations/functiontostring.ts +++ b/packages/core/src/integrations/functiontostring.ts @@ -1,4 +1,4 @@ -import { Integration, WrappedFunction } from '@sentry/types'; +import type { Integration, WrappedFunction } from '@sentry/types'; import { getOriginalFunction } from '@sentry/utils'; let originalFunctionToString: () => void; diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index ca71d13873ce..047060ae4961 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; import { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils'; // "Script error." is hard coded into browsers for errors that it can't read. diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index 44d2d6d61a18..7143275baa8b 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -1,5 +1,5 @@ /* eslint-disable max-lines */ -import { +import type { Attachment, Breadcrumb, CaptureContext, diff --git a/packages/core/src/sdk.ts b/packages/core/src/sdk.ts index 16a64520ff48..7d2df2115ddd 100644 --- a/packages/core/src/sdk.ts +++ b/packages/core/src/sdk.ts @@ -1,4 +1,4 @@ -import { Client, ClientOptions } from '@sentry/types'; +import type { Client, ClientOptions } from '@sentry/types'; import { logger } from '@sentry/utils'; import { getCurrentHub } from './hub'; diff --git a/packages/core/src/session.ts b/packages/core/src/session.ts index c8cba3e30a04..2987f09addb5 100644 --- a/packages/core/src/session.ts +++ b/packages/core/src/session.ts @@ -1,4 +1,4 @@ -import { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types'; +import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types'; import { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils'; /** diff --git a/packages/core/src/sessionflusher.ts b/packages/core/src/sessionflusher.ts index 7b2bda98c4da..9b4579ade486 100644 --- a/packages/core/src/sessionflusher.ts +++ b/packages/core/src/sessionflusher.ts @@ -1,4 +1,10 @@ -import { AggregationCounts, Client, RequestSessionStatus, SessionAggregates, SessionFlusherLike } from '@sentry/types'; +import type { + AggregationCounts, + Client, + RequestSessionStatus, + SessionAggregates, + SessionFlusherLike, +} from '@sentry/types'; import { dropUndefinedKeys } from '@sentry/utils'; import { getCurrentHub } from './hub'; diff --git a/packages/core/src/transports/base.ts b/packages/core/src/transports/base.ts index 3c7603b024ff..4a3be77e8531 100644 --- a/packages/core/src/transports/base.ts +++ b/packages/core/src/transports/base.ts @@ -1,4 +1,4 @@ -import { +import type { Envelope, EnvelopeItem, EnvelopeItemType, @@ -10,6 +10,7 @@ import { TransportMakeRequestResponse, TransportRequestExecutor, } from '@sentry/types'; +import type { PromiseBuffer, RateLimits } from '@sentry/utils'; import { createEnvelope, envelopeItemTypeToDataCategory, @@ -17,8 +18,6 @@ import { isRateLimited, logger, makePromiseBuffer, - PromiseBuffer, - RateLimits, resolvedSyncPromise, SentryError, serializeEnvelope, diff --git a/packages/core/src/utils/prepareEvent.ts b/packages/core/src/utils/prepareEvent.ts index 1d23d4d89572..3aa0d86df3f6 100644 --- a/packages/core/src/utils/prepareEvent.ts +++ b/packages/core/src/utils/prepareEvent.ts @@ -1,4 +1,4 @@ -import { ClientOptions, Event, EventHint } from '@sentry/types'; +import type { ClientOptions, Event, EventHint } from '@sentry/types'; import { dateTimestampInSeconds, normalize, resolvedSyncPromise, truncate, uuid4 } from '@sentry/utils'; import { Scope } from '../scope'; diff --git a/packages/core/test/lib/api.test.ts b/packages/core/test/lib/api.test.ts index 752f23844aad..141301878a5d 100644 --- a/packages/core/test/lib/api.test.ts +++ b/packages/core/test/lib/api.test.ts @@ -1,5 +1,5 @@ /* eslint-disable deprecation/deprecation */ -import { ClientOptions, DsnComponents } from '@sentry/types'; +import type { ClientOptions, DsnComponents } from '@sentry/types'; import { makeDsn } from '@sentry/utils'; import { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from '../../src/api'; diff --git a/packages/core/test/lib/base.test.ts b/packages/core/test/lib/base.test.ts index 5b11e59fd7f3..c82014515067 100644 --- a/packages/core/test/lib/base.test.ts +++ b/packages/core/test/lib/base.test.ts @@ -1,4 +1,4 @@ -import { Event, Span } from '@sentry/types'; +import type { Event, Span } from '@sentry/types'; import { dsnToString, logger, SentryError, SyncPromise } from '@sentry/utils'; import { Hub, makeSession, Scope } from '../../src'; diff --git a/packages/core/test/lib/envelope.test.ts b/packages/core/test/lib/envelope.test.ts index ecd409b23041..9d24e1eef19e 100644 --- a/packages/core/test/lib/envelope.test.ts +++ b/packages/core/test/lib/envelope.test.ts @@ -1,4 +1,4 @@ -import { DsnComponents, DynamicSamplingContext, Event } from '@sentry/types'; +import type { DsnComponents, DynamicSamplingContext, Event } from '@sentry/types'; import { createEventEnvelope } from '../../src/envelope'; diff --git a/packages/core/test/lib/integration.test.ts b/packages/core/test/lib/integration.test.ts index 1b5b161b3d86..14b1697b9054 100644 --- a/packages/core/test/lib/integration.test.ts +++ b/packages/core/test/lib/integration.test.ts @@ -1,4 +1,4 @@ -import { Integration, Options } from '@sentry/types'; +import type { Integration, Options } from '@sentry/types'; import { getIntegrationsToSetup } from '../../src/integration'; diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index 8170e68d9cd5..ff9aca20270a 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -1,6 +1,7 @@ -import { Event, EventProcessor } from '@sentry/types'; +import type { Event, EventProcessor } from '@sentry/types'; -import { InboundFilters, InboundFiltersOptions } from '../../../src/integrations/inboundfilters'; +import type { InboundFiltersOptions } from '../../../src/integrations/inboundfilters'; +import { InboundFilters } from '../../../src/integrations/inboundfilters'; /** * Creates an instance of the InboundFilters integration and returns diff --git a/packages/core/test/lib/sdk.test.ts b/packages/core/test/lib/sdk.test.ts index 84dc75fbc3a2..c2838d7ed115 100644 --- a/packages/core/test/lib/sdk.test.ts +++ b/packages/core/test/lib/sdk.test.ts @@ -1,5 +1,5 @@ import { Scope } from '@sentry/core'; -import { Client, Integration } from '@sentry/types'; +import type { Client, Integration } from '@sentry/types'; import { installedIntegrations } from '../../src/integration'; import { initAndBind } from '../../src/sdk'; diff --git a/packages/core/test/lib/transports/base.test.ts b/packages/core/test/lib/transports/base.test.ts index 27f21b9391b1..4f4072803f7b 100644 --- a/packages/core/test/lib/transports/base.test.ts +++ b/packages/core/test/lib/transports/base.test.ts @@ -1,5 +1,6 @@ -import { AttachmentItem, EventEnvelope, EventItem, TransportMakeRequestResponse } from '@sentry/types'; -import { createEnvelope, PromiseBuffer, resolvedSyncPromise, serializeEnvelope } from '@sentry/utils'; +import type { AttachmentItem, EventEnvelope, EventItem, TransportMakeRequestResponse } from '@sentry/types'; +import type { PromiseBuffer } from '@sentry/utils'; +import { createEnvelope, resolvedSyncPromise, serializeEnvelope } from '@sentry/utils'; import { TextEncoder } from 'util'; import { createTransport } from '../../../src/transports/base'; diff --git a/packages/core/test/mocks/client.ts b/packages/core/test/mocks/client.ts index aec42264ff58..7ca980189e19 100644 --- a/packages/core/test/mocks/client.ts +++ b/packages/core/test/mocks/client.ts @@ -1,4 +1,13 @@ -import { ClientOptions, Event, EventHint, Integration, Outcome, Session, Severity, SeverityLevel } from '@sentry/types'; +import type { + ClientOptions, + Event, + EventHint, + Integration, + Outcome, + Session, + Severity, + SeverityLevel, +} from '@sentry/types'; import { resolvedSyncPromise } from '@sentry/utils'; import { TextEncoder } from 'util'; diff --git a/packages/core/test/mocks/integration.ts b/packages/core/test/mocks/integration.ts index ff15be3f2c4d..ff01158b0632 100644 --- a/packages/core/test/mocks/integration.ts +++ b/packages/core/test/mocks/integration.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Integration } from '@sentry/types'; +import type { Event, EventProcessor, Integration } from '@sentry/types'; import { configureScope, getCurrentHub } from '../../src'; diff --git a/packages/core/test/mocks/transport.ts b/packages/core/test/mocks/transport.ts index 0541dab4a77d..2559e6e2cf2e 100644 --- a/packages/core/test/mocks/transport.ts +++ b/packages/core/test/mocks/transport.ts @@ -1,4 +1,4 @@ -import { Transport } from '@sentry/types'; +import type { Transport } from '@sentry/types'; import { SyncPromise } from '@sentry/utils'; import { TextEncoder } from 'util'; diff --git a/packages/eslint-config-sdk/src/index.js b/packages/eslint-config-sdk/src/index.js index a405a12fc4bb..4076f507c4b3 100644 --- a/packages/eslint-config-sdk/src/index.js +++ b/packages/eslint-config-sdk/src/index.js @@ -55,6 +55,8 @@ module.exports = { // in SDKs, we should make sure that we are correctly preserving class scope. '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + // Private and protected members of a class should be prefixed with a leading underscore. // typeLike declarations (class, interface, typeAlias, enum, typeParameter) should be // PascalCase. diff --git a/packages/gatsby/src/sdk.ts b/packages/gatsby/src/sdk.ts index d3a7cac50a1f..6f4f8a110e3f 100644 --- a/packages/gatsby/src/sdk.ts +++ b/packages/gatsby/src/sdk.ts @@ -1,7 +1,7 @@ import { init as reactInit, SDK_VERSION } from '@sentry/react'; import { getIntegrationsFromOptions } from './utils/integrations'; -import { GatsbyOptions } from './utils/types'; +import type { GatsbyOptions } from './utils/types'; /** * Inits the Sentry Gatsby SDK. diff --git a/packages/gatsby/src/utils/integrations.ts b/packages/gatsby/src/utils/integrations.ts index 3d6f725e3666..96cabb33bb68 100644 --- a/packages/gatsby/src/utils/integrations.ts +++ b/packages/gatsby/src/utils/integrations.ts @@ -1,7 +1,7 @@ import * as Tracing from '@sentry/tracing'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; -import { GatsbyOptions } from './types'; +import type { GatsbyOptions } from './types'; type UserFnIntegrations = (integrations: Integration[]) => Integration[]; export type UserIntegrations = Integration[] | UserFnIntegrations; diff --git a/packages/gatsby/src/utils/types.ts b/packages/gatsby/src/utils/types.ts index 936a5b3c6ae6..87ba3f7caf46 100644 --- a/packages/gatsby/src/utils/types.ts +++ b/packages/gatsby/src/utils/types.ts @@ -1,3 +1,3 @@ -import { BrowserOptions } from '@sentry/react'; +import type { BrowserOptions } from '@sentry/react'; export type GatsbyOptions = BrowserOptions; diff --git a/packages/gatsby/test/sdk.test.ts b/packages/gatsby/test/sdk.test.ts index a1e60c59fd06..1c4342a13a4b 100644 --- a/packages/gatsby/test/sdk.test.ts +++ b/packages/gatsby/test/sdk.test.ts @@ -1,10 +1,10 @@ import { init, SDK_VERSION } from '@sentry/react'; import { Integrations } from '@sentry/tracing'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { init as gatsbyInit } from '../src/sdk'; -import { UserIntegrations } from '../src/utils/integrations'; -import { GatsbyOptions } from '../src/utils/types'; +import type { UserIntegrations } from '../src/utils/integrations'; +import type { GatsbyOptions } from '../src/utils/types'; jest.mock('@sentry/react', () => { const actual = jest.requireActual('@sentry/react'); diff --git a/packages/hub/test/exports.test.ts b/packages/hub/test/exports.test.ts index a0fabf8061f6..967448a05d4a 100644 --- a/packages/hub/test/exports.test.ts +++ b/packages/hub/test/exports.test.ts @@ -1,5 +1,6 @@ /* eslint-disable deprecation/deprecation */ +import type { Scope } from '../src'; import { captureEvent, captureException, @@ -7,7 +8,6 @@ import { configureScope, getCurrentHub, getHubFromCarrier, - Scope, setContext, setExtra, setExtras, diff --git a/packages/hub/test/hub.test.ts b/packages/hub/test/hub.test.ts index c97670c0e7cb..08b876174eb7 100644 --- a/packages/hub/test/hub.test.ts +++ b/packages/hub/test/hub.test.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/unbound-method */ /* eslint-disable deprecation/deprecation */ -import { Client, Event, EventType } from '@sentry/types'; +import type { Client, Event, EventType } from '@sentry/types'; import { getCurrentHub, Hub, Scope } from '../src'; diff --git a/packages/hub/test/scope.test.ts b/packages/hub/test/scope.test.ts index 468d29dee030..d2686afb6477 100644 --- a/packages/hub/test/scope.test.ts +++ b/packages/hub/test/scope.test.ts @@ -1,6 +1,6 @@ /* eslint-disable deprecation/deprecation */ -import { Event, EventHint, RequestSessionStatus } from '@sentry/types'; +import type { Event, EventHint, RequestSessionStatus } from '@sentry/types'; import { GLOBAL_OBJ } from '@sentry/utils'; import { addGlobalEventProcessor, Scope } from '../src'; diff --git a/packages/hub/test/session.test.ts b/packages/hub/test/session.test.ts index 9de03fa34940..fd8a1a58c359 100644 --- a/packages/hub/test/session.test.ts +++ b/packages/hub/test/session.test.ts @@ -1,6 +1,6 @@ /* eslint-disable deprecation/deprecation */ -import { SessionContext } from '@sentry/types'; +import type { SessionContext } from '@sentry/types'; import { timestampInSeconds } from '@sentry/utils'; import { closeSession, makeSession, updateSession } from '../src'; diff --git a/packages/hub/test/sessionflusher.test.ts b/packages/hub/test/sessionflusher.test.ts index b743eeca1e70..0079e56087b4 100644 --- a/packages/hub/test/sessionflusher.test.ts +++ b/packages/hub/test/sessionflusher.test.ts @@ -1,6 +1,6 @@ /* eslint-disable deprecation/deprecation */ -import { Client } from '@sentry/types'; +import type { Client } from '@sentry/types'; import { SessionFlusher } from '../src'; diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 9117874b84a4..d9377403dbf4 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -13,6 +13,9 @@ "lint": "run-s lint:prettier lint:eslint", "lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish", "lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"", + "fix": "run-s fix:eslint fix:prettier", + "fix:eslint": "eslint . --format stylish --fix", + "fix:prettier": "prettier --write \"{suites,utils}/**/*.ts\"", "type-check": "tsc", "pretest": "yarn clean && yarn type-check", "test": "playwright test ./suites", diff --git a/packages/integration-tests/playwright.config.ts b/packages/integration-tests/playwright.config.ts index 4ae274b13f22..39c4dd6a213e 100644 --- a/packages/integration-tests/playwright.config.ts +++ b/packages/integration-tests/playwright.config.ts @@ -1,4 +1,4 @@ -import { PlaywrightTestConfig } from '@playwright/test'; +import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { retries: 2, diff --git a/packages/integration-tests/suites/integrations/httpclient/fetch/test.ts b/packages/integration-tests/suites/integrations/httpclient/fetch/test.ts index d399dd209a84..3b845c8a8029 100644 --- a/packages/integration-tests/suites/integrations/httpclient/fetch/test.ts +++ b/packages/integration-tests/suites/integrations/httpclient/fetch/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/integrations/httpclient/xhr/test.ts b/packages/integration-tests/suites/integrations/httpclient/xhr/test.ts index 72167f73ca2b..a6dfcc755ae0 100644 --- a/packages/integration-tests/suites/integrations/httpclient/xhr/test.ts +++ b/packages/integration-tests/suites/integrations/httpclient/xhr/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/addBreadcrumb/empty_obj/test.ts b/packages/integration-tests/suites/public-api/addBreadcrumb/empty_obj/test.ts index 3fea4283b71e..47435f3d57be 100644 --- a/packages/integration-tests/suites/public-api/addBreadcrumb/empty_obj/test.ts +++ b/packages/integration-tests/suites/public-api/addBreadcrumb/empty_obj/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts b/packages/integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts index d864be4f9073..bbaafa997fda 100644 --- a/packages/integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts +++ b/packages/integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts b/packages/integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts index 224d4dba0932..d6a24b8cc167 100644 --- a/packages/integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts +++ b/packages/integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/addBreadcrumb/undefined_arg/test.ts b/packages/integration-tests/suites/public-api/addBreadcrumb/undefined_arg/test.ts index 5e5ec669a7dc..ec04b9027783 100644 --- a/packages/integration-tests/suites/public-api/addBreadcrumb/undefined_arg/test.ts +++ b/packages/integration-tests/suites/public-api/addBreadcrumb/undefined_arg/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/captureException/empty_obj/test.ts b/packages/integration-tests/suites/public-api/captureException/empty_obj/test.ts index a41fdcc6a6e1..6ce86bfe7aeb 100644 --- a/packages/integration-tests/suites/public-api/captureException/empty_obj/test.ts +++ b/packages/integration-tests/suites/public-api/captureException/empty_obj/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/captureException/simple_error/test.ts b/packages/integration-tests/suites/public-api/captureException/simple_error/test.ts index 49627e826726..7e884c6eb6dc 100644 --- a/packages/integration-tests/suites/public-api/captureException/simple_error/test.ts +++ b/packages/integration-tests/suites/public-api/captureException/simple_error/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/captureException/undefined_arg/test.ts b/packages/integration-tests/suites/public-api/captureException/undefined_arg/test.ts index 52e2ef5c21f8..5bf560e93707 100644 --- a/packages/integration-tests/suites/public-api/captureException/undefined_arg/test.ts +++ b/packages/integration-tests/suites/public-api/captureException/undefined_arg/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/captureMessage/simple_message/test.ts b/packages/integration-tests/suites/public-api/captureMessage/simple_message/test.ts index cfd5580653ac..60cc4a19f089 100644 --- a/packages/integration-tests/suites/public-api/captureMessage/simple_message/test.ts +++ b/packages/integration-tests/suites/public-api/captureMessage/simple_message/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts b/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts index da17ff07a77e..1422ed64bf31 100644 --- a/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts +++ b/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/configureScope/clear_scope/test.ts b/packages/integration-tests/suites/public-api/configureScope/clear_scope/test.ts index e86d5e11aef6..02a82ffef26d 100644 --- a/packages/integration-tests/suites/public-api/configureScope/clear_scope/test.ts +++ b/packages/integration-tests/suites/public-api/configureScope/clear_scope/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/configureScope/set_properties/test.ts b/packages/integration-tests/suites/public-api/configureScope/set_properties/test.ts index 992dd7c31043..ba31c0ca18e7 100644 --- a/packages/integration-tests/suites/public-api/configureScope/set_properties/test.ts +++ b/packages/integration-tests/suites/public-api/configureScope/set_properties/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/init/console/test.ts b/packages/integration-tests/suites/public-api/init/console/test.ts index 1f71332533c8..5fc32e430caf 100644 --- a/packages/integration-tests/suites/public-api/init/console/test.ts +++ b/packages/integration-tests/suites/public-api/init/console/test.ts @@ -1,5 +1,6 @@ /* eslint-disable no-console */ -import { ConsoleMessage, expect } from '@playwright/test'; +import type { ConsoleMessage } from '@playwright/test'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../../../utils/fixtures'; diff --git a/packages/integration-tests/suites/public-api/instrumentation/eventListener/test.ts b/packages/integration-tests/suites/public-api/instrumentation/eventListener/test.ts index 71eb3e7023b3..8d821a14906e 100644 --- a/packages/integration-tests/suites/public-api/instrumentation/eventListener/test.ts +++ b/packages/integration-tests/suites/public-api/instrumentation/eventListener/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setContext/multiple_contexts/test.ts b/packages/integration-tests/suites/public-api/setContext/multiple_contexts/test.ts index 6d00519cbad4..d1e85f49cf27 100644 --- a/packages/integration-tests/suites/public-api/setContext/multiple_contexts/test.ts +++ b/packages/integration-tests/suites/public-api/setContext/multiple_contexts/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setContext/non_serializable_context/test.ts b/packages/integration-tests/suites/public-api/setContext/non_serializable_context/test.ts index 54fea2c68908..3c6d17dbdb03 100644 --- a/packages/integration-tests/suites/public-api/setContext/non_serializable_context/test.ts +++ b/packages/integration-tests/suites/public-api/setContext/non_serializable_context/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setContext/simple_context/test.ts b/packages/integration-tests/suites/public-api/setContext/simple_context/test.ts index a39f838f5b18..37e91dbf314d 100644 --- a/packages/integration-tests/suites/public-api/setContext/simple_context/test.ts +++ b/packages/integration-tests/suites/public-api/setContext/simple_context/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setExtra/multiple_extras/test.ts b/packages/integration-tests/suites/public-api/setExtra/multiple_extras/test.ts index 82a2b4ce21e5..17e5fa9790c7 100644 --- a/packages/integration-tests/suites/public-api/setExtra/multiple_extras/test.ts +++ b/packages/integration-tests/suites/public-api/setExtra/multiple_extras/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setExtra/non_serializable_extra/test.ts b/packages/integration-tests/suites/public-api/setExtra/non_serializable_extra/test.ts index 168bfc88e2c5..67b2e9cd162c 100644 --- a/packages/integration-tests/suites/public-api/setExtra/non_serializable_extra/test.ts +++ b/packages/integration-tests/suites/public-api/setExtra/non_serializable_extra/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setExtra/simple_extra/test.ts b/packages/integration-tests/suites/public-api/setExtra/simple_extra/test.ts index 95a6184e95a9..3f77998cd758 100644 --- a/packages/integration-tests/suites/public-api/setExtra/simple_extra/test.ts +++ b/packages/integration-tests/suites/public-api/setExtra/simple_extra/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setExtras/consecutive_calls/test.ts b/packages/integration-tests/suites/public-api/setExtras/consecutive_calls/test.ts index 641325affa34..9caae5b0bc7c 100644 --- a/packages/integration-tests/suites/public-api/setExtras/consecutive_calls/test.ts +++ b/packages/integration-tests/suites/public-api/setExtras/consecutive_calls/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setExtras/multiple_extras/test.ts b/packages/integration-tests/suites/public-api/setExtras/multiple_extras/test.ts index 1e238739d8a1..fdea76a5344a 100644 --- a/packages/integration-tests/suites/public-api/setExtras/multiple_extras/test.ts +++ b/packages/integration-tests/suites/public-api/setExtras/multiple_extras/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setTag/with_non_primitives/test.ts b/packages/integration-tests/suites/public-api/setTag/with_non_primitives/test.ts index e4a1f9b19bd4..3eff6ec07858 100644 --- a/packages/integration-tests/suites/public-api/setTag/with_non_primitives/test.ts +++ b/packages/integration-tests/suites/public-api/setTag/with_non_primitives/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setTag/with_primitives/test.ts b/packages/integration-tests/suites/public-api/setTag/with_primitives/test.ts index ba2b648ad913..915c39a51596 100644 --- a/packages/integration-tests/suites/public-api/setTag/with_primitives/test.ts +++ b/packages/integration-tests/suites/public-api/setTag/with_primitives/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setTags/with_non_primitives/test.ts b/packages/integration-tests/suites/public-api/setTags/with_non_primitives/test.ts index e4a1f9b19bd4..3eff6ec07858 100644 --- a/packages/integration-tests/suites/public-api/setTags/with_non_primitives/test.ts +++ b/packages/integration-tests/suites/public-api/setTags/with_non_primitives/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setTags/with_primitives/test.ts b/packages/integration-tests/suites/public-api/setTags/with_primitives/test.ts index ba2b648ad913..915c39a51596 100644 --- a/packages/integration-tests/suites/public-api/setTags/with_primitives/test.ts +++ b/packages/integration-tests/suites/public-api/setTags/with_primitives/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setUser/unset_user/test.ts b/packages/integration-tests/suites/public-api/setUser/unset_user/test.ts index 2aed7beb60aa..193a10b8677d 100644 --- a/packages/integration-tests/suites/public-api/setUser/unset_user/test.ts +++ b/packages/integration-tests/suites/public-api/setUser/unset_user/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/setUser/update_user/test.ts b/packages/integration-tests/suites/public-api/setUser/update_user/test.ts index fa846f0221c2..f673280d5c0b 100644 --- a/packages/integration-tests/suites/public-api/setUser/update_user/test.ts +++ b/packages/integration-tests/suites/public-api/setUser/update_user/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/startTransaction/basic_usage/test.ts b/packages/integration-tests/suites/public-api/startTransaction/basic_usage/test.ts index 144f0ae29211..7b42d280248d 100644 --- a/packages/integration-tests/suites/public-api/startTransaction/basic_usage/test.ts +++ b/packages/integration-tests/suites/public-api/startTransaction/basic_usage/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/startTransaction/circular_data/test.ts b/packages/integration-tests/suites/public-api/startTransaction/circular_data/test.ts index 7ad0ec532fb7..88ed63b08864 100644 --- a/packages/integration-tests/suites/public-api/startTransaction/circular_data/test.ts +++ b/packages/integration-tests/suites/public-api/startTransaction/circular_data/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/startTransaction/setMeasurement/test.ts b/packages/integration-tests/suites/public-api/startTransaction/setMeasurement/test.ts index e91231093bf3..fecda098bf43 100644 --- a/packages/integration-tests/suites/public-api/startTransaction/setMeasurement/test.ts +++ b/packages/integration-tests/suites/public-api/startTransaction/setMeasurement/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/public-api/withScope/nested_scopes/test.ts b/packages/integration-tests/suites/public-api/withScope/nested_scopes/test.ts index 1cc024e799fc..415a173bc64f 100644 --- a/packages/integration-tests/suites/public-api/withScope/nested_scopes/test.ts +++ b/packages/integration-tests/suites/public-api/withScope/nested_scopes/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/sessions/start-session/test.ts b/packages/integration-tests/suites/sessions/start-session/test.ts index e4469bd369c1..8a48f161c93b 100644 --- a/packages/integration-tests/suites/sessions/start-session/test.ts +++ b/packages/integration-tests/suites/sessions/start-session/test.ts @@ -1,5 +1,6 @@ -import { expect, Route } from '@playwright/test'; -import { SessionContext } from '@sentry/types'; +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { SessionContext } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/sessions/update-session/test.ts b/packages/integration-tests/suites/sessions/update-session/test.ts index 9634e66c360e..5ce88e4bdc0e 100644 --- a/packages/integration-tests/suites/sessions/update-session/test.ts +++ b/packages/integration-tests/suites/sessions/update-session/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { SessionContext } from '@sentry/types'; +import type { SessionContext } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts b/packages/integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts index 3f1e01f88070..cd79799df328 100644 --- a/packages/integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts +++ b/packages/integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts b/packages/integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts index 4c3e7cfe067e..ce2142169bdc 100644 --- a/packages/integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts +++ b/packages/integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts b/packages/integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts index 1c30a04cd4fc..e7a9f452fe6a 100644 --- a/packages/integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts +++ b/packages/integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-custom/test.ts b/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-custom/test.ts index 8a50d643e0c9..8b201b7d7bbf 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-custom/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-custom/test.ts @@ -1,5 +1,6 @@ -import { expect, JSHandle } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { JSHandle } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts b/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts index 80e99b0ede13..690e6e857409 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/interactions/test.ts b/packages/integration-tests/suites/tracing/browsertracing/interactions/test.ts index 9f12b2e76e6d..b9a70ebda3ec 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/interactions/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/interactions/test.ts @@ -1,5 +1,6 @@ -import { expect, Route } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest, getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/long-tasks-disabled/test.ts b/packages/integration-tests/suites/tracing/browsertracing/long-tasks-disabled/test.ts index a8c8c2b16798..c392258570d9 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/long-tasks-disabled/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/long-tasks-disabled/test.ts @@ -1,5 +1,6 @@ -import { expect, Route } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/long-tasks-enabled/test.ts b/packages/integration-tests/suites/tracing/browsertracing/long-tasks-enabled/test.ts index 83bb5911586a..a91e68c8d1bf 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/long-tasks-enabled/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/long-tasks-enabled/test.ts @@ -1,5 +1,6 @@ -import { expect, Route } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/meta/test.ts b/packages/integration-tests/suites/tracing/browsertracing/meta/test.ts index 88ae1cd331d4..c447f41c8660 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/meta/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/meta/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event, EventEnvelopeHeaders } from '@sentry/types'; +import type { Event, EventEnvelopeHeaders } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { envelopeHeaderRequestParser, getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/navigation/test.ts b/packages/integration-tests/suites/tracing/browsertracing/navigation/test.ts index e8e6cbd3fc78..77157951f494 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/navigation/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/navigation/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/pageload/test.ts b/packages/integration-tests/suites/tracing/browsertracing/pageload/test.ts index 6c5877c62e57..fc7de0b067b7 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/pageload/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/pageload/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargets/test.ts b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargets/test.ts index 5281b549454c..ca1deada91d0 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargets/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargets/test.ts @@ -1,4 +1,5 @@ -import { expect, Request } from '@playwright/test'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../../../../utils/fixtures'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/test.ts b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/test.ts index e39093012d9e..6e3fea23e09b 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/test.ts @@ -1,4 +1,5 @@ -import { expect, Request } from '@playwright/test'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../../../../utils/fixtures'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/test.ts b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/test.ts index bc54b6bb0687..0983c53a5622 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/test.ts @@ -1,4 +1,5 @@ -import { expect, Request } from '@playwright/test'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../../../../utils/fixtures'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsMatch/test.ts b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsMatch/test.ts index 3fe23f53e37c..c046912e6621 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsMatch/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsMatch/test.ts @@ -1,4 +1,5 @@ -import { expect, Request } from '@playwright/test'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../../../../utils/fixtures'; diff --git a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsNoMatch/test.ts b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsNoMatch/test.ts index 50bce1fdc8fa..0767ced38bb5 100644 --- a/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsNoMatch/test.ts +++ b/packages/integration-tests/suites/tracing/browsertracing/tracePropagationTargets/defaultTargetsNoMatch/test.ts @@ -1,4 +1,5 @@ -import { expect, Request } from '@playwright/test'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../../../../utils/fixtures'; diff --git a/packages/integration-tests/suites/tracing/envelope-header-transaction-name/test.ts b/packages/integration-tests/suites/tracing/envelope-header-transaction-name/test.ts index 7ef6bd4304e1..8d5b75e4907c 100644 --- a/packages/integration-tests/suites/tracing/envelope-header-transaction-name/test.ts +++ b/packages/integration-tests/suites/tracing/envelope-header-transaction-name/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { EventEnvelopeHeaders } from '@sentry/types'; +import type { EventEnvelopeHeaders } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { envelopeHeaderRequestParser, getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/envelope-header/test.ts b/packages/integration-tests/suites/tracing/envelope-header/test.ts index fef9ae14a8fb..b70ae62b4903 100644 --- a/packages/integration-tests/suites/tracing/envelope-header/test.ts +++ b/packages/integration-tests/suites/tracing/envelope-header/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { EventEnvelopeHeaders } from '@sentry/types'; +import type { EventEnvelopeHeaders } from '@sentry/types'; import { sentryTest } from '../../../utils/fixtures'; import { envelopeHeaderRequestParser, getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/connection-rtt/test.ts b/packages/integration-tests/suites/tracing/metrics/connection-rtt/test.ts index e64fd704682d..273609e97d15 100644 --- a/packages/integration-tests/suites/tracing/metrics/connection-rtt/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/connection-rtt/test.ts @@ -1,5 +1,6 @@ -import { expect, Page } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Page } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts b/packages/integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts index 475ea7fa4840..8b8ca6b0f7b8 100644 --- a/packages/integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts b/packages/integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts index abf9c3c06d16..83ae9580d84d 100644 --- a/packages/integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts @@ -1,5 +1,6 @@ -import { expect, Route } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/web-vitals-cls/test.ts b/packages/integration-tests/suites/tracing/metrics/web-vitals-cls/test.ts index f8848891a39c..41bf941f10d3 100644 --- a/packages/integration-tests/suites/tracing/metrics/web-vitals-cls/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/web-vitals-cls/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts b/packages/integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts index ff3f125fcf10..966760096add 100644 --- a/packages/integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/web-vitals-fp-fcp/test.ts b/packages/integration-tests/suites/tracing/metrics/web-vitals-fp-fcp/test.ts index 8162523542ba..b120e580a55c 100644 --- a/packages/integration-tests/suites/tracing/metrics/web-vitals-fp-fcp/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/web-vitals-fp-fcp/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts b/packages/integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts index 01a8b5c2e268..28b85d518e80 100644 --- a/packages/integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts @@ -1,5 +1,6 @@ -import { expect, Route } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/test.ts b/packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/test.ts index 4259c4a034be..81d5f1f7430e 100644 --- a/packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/test.ts +++ b/packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/request/fetch/test.ts b/packages/integration-tests/suites/tracing/request/fetch/test.ts index 2ccf9633507a..a5b8185e20f1 100644 --- a/packages/integration-tests/suites/tracing/request/fetch/test.ts +++ b/packages/integration-tests/suites/tracing/request/fetch/test.ts @@ -1,5 +1,6 @@ -import { expect, Request } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/suites/tracing/request/xhr/test.ts b/packages/integration-tests/suites/tracing/request/xhr/test.ts index a16c0893b0e7..39b2a37749b8 100644 --- a/packages/integration-tests/suites/tracing/request/xhr/test.ts +++ b/packages/integration-tests/suites/tracing/request/xhr/test.ts @@ -1,5 +1,6 @@ -import { expect, Request } from '@playwright/test'; -import { Event } from '@sentry/types'; +import type { Request } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; diff --git a/packages/integration-tests/utils/generatePlugin.ts b/packages/integration-tests/utils/generatePlugin.ts index ebd57bf2cfb6..3e00d97f7803 100644 --- a/packages/integration-tests/utils/generatePlugin.ts +++ b/packages/integration-tests/utils/generatePlugin.ts @@ -1,8 +1,8 @@ -import { Package } from '@sentry/types'; +import type { Package } from '@sentry/types'; import { readdirSync, readFileSync } from 'fs'; import HtmlWebpackPlugin, { createHtmlTagObject } from 'html-webpack-plugin'; import path from 'path'; -import { Compiler } from 'webpack'; +import type { Compiler } from 'webpack'; const PACKAGES_DIR = '../../packages'; diff --git a/packages/integration-tests/utils/helpers.ts b/packages/integration-tests/utils/helpers.ts index 9bacf6e9fbde..12078c09039e 100644 --- a/packages/integration-tests/utils/helpers.ts +++ b/packages/integration-tests/utils/helpers.ts @@ -1,5 +1,5 @@ -import { Page, Request } from '@playwright/test'; -import { Event, EventEnvelopeHeaders } from '@sentry/types'; +import type { Page, Request } from '@playwright/test'; +import type { Event, EventEnvelopeHeaders } from '@sentry/types'; const envelopeUrlRegex = /\.sentry\.io\/api\/\d+\/envelope\//; diff --git a/packages/integration-tests/webpack.config.ts b/packages/integration-tests/webpack.config.ts index ff065a044208..ddf31bc897c4 100644 --- a/packages/integration-tests/webpack.config.ts +++ b/packages/integration-tests/webpack.config.ts @@ -1,4 +1,4 @@ -import { Configuration } from 'webpack'; +import type { Configuration } from 'webpack'; const config = function (userConfig: Record): Configuration { return { diff --git a/packages/integrations/src/captureconsole.ts b/packages/integrations/src/captureconsole.ts index ea9f2df40837..980bc74dcad6 100644 --- a/packages/integrations/src/captureconsole.ts +++ b/packages/integrations/src/captureconsole.ts @@ -1,4 +1,4 @@ -import { EventProcessor, Hub, Integration } from '@sentry/types'; +import type { EventProcessor, Hub, Integration } from '@sentry/types'; import { CONSOLE_LEVELS, fill, GLOBAL_OBJ, safeJoin, severityLevelFromString } from '@sentry/utils'; /** Send Console API calls as Sentry Events */ diff --git a/packages/integrations/src/debug.ts b/packages/integrations/src/debug.ts index efa1beba35c9..950610e531a0 100644 --- a/packages/integrations/src/debug.ts +++ b/packages/integrations/src/debug.ts @@ -1,4 +1,4 @@ -import { Event, EventHint, EventProcessor, Hub, Integration } from '@sentry/types'; +import type { Event, EventHint, EventProcessor, Hub, Integration } from '@sentry/types'; import { consoleSandbox } from '@sentry/utils'; interface DebugOptions { diff --git a/packages/integrations/src/dedupe.ts b/packages/integrations/src/dedupe.ts index bd615fc084d2..625cc88f504a 100644 --- a/packages/integrations/src/dedupe.ts +++ b/packages/integrations/src/dedupe.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types'; +import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types'; import { logger } from '@sentry/utils'; /** Deduplication filter */ diff --git a/packages/integrations/src/extraerrordata.ts b/packages/integrations/src/extraerrordata.ts index ef4e6d49393f..8e694b20f2c1 100644 --- a/packages/integrations/src/extraerrordata.ts +++ b/packages/integrations/src/extraerrordata.ts @@ -1,4 +1,4 @@ -import { Contexts, Event, EventHint, EventProcessor, ExtendedError, Hub, Integration } from '@sentry/types'; +import type { Contexts, Event, EventHint, EventProcessor, ExtendedError, Hub, Integration } from '@sentry/types'; import { addNonEnumerableProperty, isError, isPlainObject, logger, normalize } from '@sentry/utils'; /** JSDoc */ diff --git a/packages/integrations/src/httpclient.ts b/packages/integrations/src/httpclient.ts index 8792ca5901fc..8fab1825fa03 100644 --- a/packages/integrations/src/httpclient.ts +++ b/packages/integrations/src/httpclient.ts @@ -1,4 +1,4 @@ -import { Event as SentryEvent, EventProcessor, Hub, Integration } from '@sentry/types'; +import type { Event as SentryEvent, EventProcessor, Hub, Integration } from '@sentry/types'; import { addExceptionMechanism, fill, GLOBAL_OBJ, logger, supportsNativeFetch } from '@sentry/utils'; export type HttpStatusCodeRange = [number, number] | number; diff --git a/packages/integrations/src/offline.ts b/packages/integrations/src/offline.ts index 2f2029b67336..e20ea96d8e14 100644 --- a/packages/integrations/src/offline.ts +++ b/packages/integrations/src/offline.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { Event, EventProcessor, Hub, Integration } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration } from '@sentry/types'; import { GLOBAL_OBJ, logger, normalize, uuid4 } from '@sentry/utils'; import localForage from 'localforage'; diff --git a/packages/integrations/src/reportingobserver.ts b/packages/integrations/src/reportingobserver.ts index 4b8a7d92881c..87f8763cb28a 100644 --- a/packages/integrations/src/reportingobserver.ts +++ b/packages/integrations/src/reportingobserver.ts @@ -1,4 +1,4 @@ -import { EventProcessor, Hub, Integration } from '@sentry/types'; +import type { EventProcessor, Hub, Integration } from '@sentry/types'; import { GLOBAL_OBJ, supportsReportingObserver } from '@sentry/utils'; const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window; diff --git a/packages/integrations/src/rewriteframes.ts b/packages/integrations/src/rewriteframes.ts index b5b830eb557e..afe084f50411 100644 --- a/packages/integrations/src/rewriteframes.ts +++ b/packages/integrations/src/rewriteframes.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Hub, Integration, StackFrame, Stacktrace } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration, StackFrame, Stacktrace } from '@sentry/types'; import { basename, relative } from '@sentry/utils'; type StackFrameIteratee = (frame: StackFrame) => StackFrame; diff --git a/packages/integrations/src/sessiontiming.ts b/packages/integrations/src/sessiontiming.ts index 0e45588e0f31..269ca4148ac2 100644 --- a/packages/integrations/src/sessiontiming.ts +++ b/packages/integrations/src/sessiontiming.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Hub, Integration } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration } from '@sentry/types'; /** This function adds duration since Sentry was initialized till the time event was sent */ export class SessionTiming implements Integration { diff --git a/packages/integrations/src/transaction.ts b/packages/integrations/src/transaction.ts index e6d0ac24f770..8fbd52a8a871 100644 --- a/packages/integrations/src/transaction.ts +++ b/packages/integrations/src/transaction.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; /** Add node transaction to the event */ export class Transaction implements Integration { diff --git a/packages/integrations/test/captureconsole.test.ts b/packages/integrations/test/captureconsole.test.ts index 34b715cfc7a1..6ff08df2e46f 100644 --- a/packages/integrations/test/captureconsole.test.ts +++ b/packages/integrations/test/captureconsole.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/unbound-method */ -import { Event, Hub, Integration } from '@sentry/types'; +import type { Event, Hub, Integration } from '@sentry/types'; import { CaptureConsole } from '../src/captureconsole'; diff --git a/packages/integrations/test/debug.test.ts b/packages/integrations/test/debug.test.ts index eed7e52d509e..268c03dcc4d5 100644 --- a/packages/integrations/test/debug.test.ts +++ b/packages/integrations/test/debug.test.ts @@ -1,4 +1,4 @@ -import { EventProcessor, Integration } from '@sentry/types'; +import type { EventProcessor, Integration } from '@sentry/types'; import { Debug } from '../src/debug'; diff --git a/packages/integrations/test/dedupe.test.ts b/packages/integrations/test/dedupe.test.ts index 8bc354ffa620..33704907dc83 100644 --- a/packages/integrations/test/dedupe.test.ts +++ b/packages/integrations/test/dedupe.test.ts @@ -1,4 +1,4 @@ -import { Event as SentryEvent, Exception, StackFrame, Stacktrace } from '@sentry/types'; +import type { Event as SentryEvent, Exception, StackFrame, Stacktrace } from '@sentry/types'; import { _shouldDropEvent } from '../src/dedupe'; diff --git a/packages/integrations/test/extraerrordata.test.ts b/packages/integrations/test/extraerrordata.test.ts index 68e38720f761..2ecee1faae19 100644 --- a/packages/integrations/test/extraerrordata.test.ts +++ b/packages/integrations/test/extraerrordata.test.ts @@ -1,4 +1,4 @@ -import { Event as SentryEvent, ExtendedError } from '@sentry/types'; +import type { Event as SentryEvent, ExtendedError } from '@sentry/types'; import { ExtraErrorData } from '../src/extraerrordata'; diff --git a/packages/integrations/test/offline.test.ts b/packages/integrations/test/offline.test.ts index 02e9ccf4457c..d7ca8099be31 100644 --- a/packages/integrations/test/offline.test.ts +++ b/packages/integrations/test/offline.test.ts @@ -1,7 +1,8 @@ import { WINDOW } from '@sentry/browser'; -import { Event, EventProcessor, Hub, Integration, IntegrationClass } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration, IntegrationClass } from '@sentry/types'; -import { Item, Offline } from '../src/offline'; +import type { Item } from '../src/offline'; +import { Offline } from '../src/offline'; // mock localforage methods jest.mock('localforage', () => ({ diff --git a/packages/integrations/test/reportingobserver.test.ts b/packages/integrations/test/reportingobserver.test.ts index 91547d5572f8..1298fb617e56 100644 --- a/packages/integrations/test/reportingobserver.test.ts +++ b/packages/integrations/test/reportingobserver.test.ts @@ -1,4 +1,4 @@ -import { Hub, Integration } from '@sentry/types'; +import type { Hub, Integration } from '@sentry/types'; import { ReportingObserver } from '../src/reportingobserver'; diff --git a/packages/integrations/test/rewriteframes.test.ts b/packages/integrations/test/rewriteframes.test.ts index 78aeec7949d4..b19e70143273 100644 --- a/packages/integrations/test/rewriteframes.test.ts +++ b/packages/integrations/test/rewriteframes.test.ts @@ -1,4 +1,4 @@ -import { Event, StackFrame } from '@sentry/types'; +import type { Event, StackFrame } from '@sentry/types'; import { RewriteFrames } from '../src/rewriteframes'; diff --git a/packages/nextjs/src/client/index.ts b/packages/nextjs/src/client/index.ts index 08f5b113ba74..3ea78374290d 100644 --- a/packages/nextjs/src/client/index.ts +++ b/packages/nextjs/src/client/index.ts @@ -1,7 +1,8 @@ import { RewriteFrames } from '@sentry/integrations'; -import { BrowserOptions, configureScope, init as reactInit, Integrations } from '@sentry/react'; +import type { BrowserOptions } from '@sentry/react'; +import { configureScope, init as reactInit, Integrations } from '@sentry/react'; import { BrowserTracing, defaultRequestInstrumentationOptions, hasTracingEnabled } from '@sentry/tracing'; -import { EventProcessor } from '@sentry/types'; +import type { EventProcessor } from '@sentry/types'; import { buildMetadata } from '../common/metadata'; import { addOrUpdateIntegration } from '../common/userIntegrations'; diff --git a/packages/nextjs/src/client/performance.ts b/packages/nextjs/src/client/performance.ts index 39c52f15356f..2212092d5045 100644 --- a/packages/nextjs/src/client/performance.ts +++ b/packages/nextjs/src/client/performance.ts @@ -1,6 +1,6 @@ import { getCurrentHub } from '@sentry/core'; import { WINDOW } from '@sentry/react'; -import { Primitive, TraceparentData, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; +import type { Primitive, TraceparentData, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; import { baggageHeaderToDynamicSamplingContext, extractTraceparentData, diff --git a/packages/nextjs/src/client/tunnelRoute.ts b/packages/nextjs/src/client/tunnelRoute.ts index 29ad48325bb9..81f9f936cc82 100644 --- a/packages/nextjs/src/client/tunnelRoute.ts +++ b/packages/nextjs/src/client/tunnelRoute.ts @@ -1,4 +1,4 @@ -import { BrowserOptions } from '@sentry/react'; +import type { BrowserOptions } from '@sentry/react'; import { dsnFromString, logger } from '@sentry/utils'; const globalWithInjectedValues = global as typeof global & { diff --git a/packages/nextjs/src/common/_error.ts b/packages/nextjs/src/common/_error.ts index 6508eb39ba6e..624aabdb3b98 100644 --- a/packages/nextjs/src/common/_error.ts +++ b/packages/nextjs/src/common/_error.ts @@ -1,6 +1,6 @@ import { captureException, getCurrentHub, withScope } from '@sentry/core'; import { addExceptionMechanism } from '@sentry/utils'; -import { NextPageContext } from 'next'; +import type { NextPageContext } from 'next'; type ContextOrProps = { req?: NextPageContext['req']; diff --git a/packages/nextjs/src/common/metadata.ts b/packages/nextjs/src/common/metadata.ts index 7985ad6aa9cb..9216c6eaec07 100644 --- a/packages/nextjs/src/common/metadata.ts +++ b/packages/nextjs/src/common/metadata.ts @@ -1,5 +1,5 @@ import { SDK_VERSION } from '@sentry/core'; -import { Options, SdkInfo } from '@sentry/types'; +import type { Options, SdkInfo } from '@sentry/types'; const PACKAGE_NAME_PREFIX = 'npm:@sentry/'; diff --git a/packages/nextjs/src/common/userIntegrations.ts b/packages/nextjs/src/common/userIntegrations.ts index 3f84a58fa41b..119d5db500dd 100644 --- a/packages/nextjs/src/common/userIntegrations.ts +++ b/packages/nextjs/src/common/userIntegrations.ts @@ -1,4 +1,4 @@ -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; export type UserIntegrationsFunction = (integrations: Integration[]) => Integration[]; export type UserIntegrations = Integration[] | UserIntegrationsFunction; diff --git a/packages/nextjs/src/config/loaders/prefixLoader.ts b/packages/nextjs/src/config/loaders/prefixLoader.ts index f5aa562b5290..19e728f3b6b3 100644 --- a/packages/nextjs/src/config/loaders/prefixLoader.ts +++ b/packages/nextjs/src/config/loaders/prefixLoader.ts @@ -2,7 +2,7 @@ import { escapeStringForRegex } from '@sentry/utils'; import * as fs from 'fs'; import * as path from 'path'; -import { LoaderThis } from './types'; +import type { LoaderThis } from './types'; type LoaderOptions = { templatePrefix: string; diff --git a/packages/nextjs/src/config/loaders/valueInjectionLoader.ts b/packages/nextjs/src/config/loaders/valueInjectionLoader.ts index be8340dccdf3..6a645b0e798d 100644 --- a/packages/nextjs/src/config/loaders/valueInjectionLoader.ts +++ b/packages/nextjs/src/config/loaders/valueInjectionLoader.ts @@ -1,4 +1,4 @@ -import { LoaderThis } from './types'; +import type { LoaderThis } from './types'; type LoaderOptions = { values: Record; diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index 6a815664e527..b79243627432 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -1,6 +1,6 @@ -import { GLOBAL_OBJ } from '@sentry/utils'; -import { SentryCliPluginOptions } from '@sentry/webpack-plugin'; -import { WebpackPluginInstance } from 'webpack'; +import type { GLOBAL_OBJ } from '@sentry/utils'; +import type { SentryCliPluginOptions } from '@sentry/webpack-plugin'; +import type { WebpackPluginInstance } from 'webpack'; export type SentryWebpackPluginOptions = SentryCliPluginOptions; export type SentryWebpackPlugin = WebpackPluginInstance & { options: SentryWebpackPluginOptions }; diff --git a/packages/nextjs/src/server/index.ts b/packages/nextjs/src/server/index.ts index 0bba16aa970c..340f4100d611 100644 --- a/packages/nextjs/src/server/index.ts +++ b/packages/nextjs/src/server/index.ts @@ -1,14 +1,17 @@ -import { Carrier, getHubFromCarrier, getMainCarrier } from '@sentry/core'; +import type { Carrier } from '@sentry/core'; +import { getHubFromCarrier, getMainCarrier } from '@sentry/core'; import { RewriteFrames } from '@sentry/integrations'; -import { configureScope, getCurrentHub, init as nodeInit, Integrations, NodeOptions } from '@sentry/node'; +import type { NodeOptions } from '@sentry/node'; +import { configureScope, getCurrentHub, init as nodeInit, Integrations } from '@sentry/node'; import { hasTracingEnabled } from '@sentry/tracing'; -import { EventProcessor } from '@sentry/types'; +import type { EventProcessor } from '@sentry/types'; import { escapeStringForRegex, logger } from '@sentry/utils'; import * as domainModule from 'domain'; import * as path from 'path'; import { buildMetadata } from '../common/metadata'; -import { addOrUpdateIntegration, IntegrationWithExclusionOption } from '../common/userIntegrations'; +import type { IntegrationWithExclusionOption } from '../common/userIntegrations'; +import { addOrUpdateIntegration } from '../common/userIntegrations'; import { isBuild } from './utils/isBuild'; export * from '@sentry/node'; diff --git a/packages/nextjs/src/server/utils/responseEnd.ts b/packages/nextjs/src/server/utils/responseEnd.ts index 82b6fb69ea28..ee2d9f803d3b 100644 --- a/packages/nextjs/src/server/utils/responseEnd.ts +++ b/packages/nextjs/src/server/utils/responseEnd.ts @@ -1,9 +1,9 @@ import { flush } from '@sentry/node'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { fill, logger } from '@sentry/utils'; -import { ServerResponse } from 'http'; +import type { ServerResponse } from 'http'; -import { ResponseEndMethod, WrappedResponseEndMethod } from '../types'; +import type { ResponseEndMethod, WrappedResponseEndMethod } from '../types'; /** * Wrap `res.end()` so that it closes the transaction and flushes events before letting the request finish. diff --git a/packages/nextjs/src/server/utils/wrapperUtils.ts b/packages/nextjs/src/server/utils/wrapperUtils.ts index 8883f1163f57..ae05b3f16b8d 100644 --- a/packages/nextjs/src/server/utils/wrapperUtils.ts +++ b/packages/nextjs/src/server/utils/wrapperUtils.ts @@ -1,9 +1,9 @@ import { captureException, getCurrentHub, startTransaction } from '@sentry/core'; import { getActiveTransaction } from '@sentry/tracing'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { baggageHeaderToDynamicSamplingContext, extractTraceparentData } from '@sentry/utils'; import * as domain from 'domain'; -import { IncomingMessage, ServerResponse } from 'http'; +import type { IncomingMessage, ServerResponse } from 'http'; import { platformSupportsStreaming } from './platformSupportsStreaming'; import { autoEndTransactionOnResponseEnd, flushQueue } from './responseEnd'; diff --git a/packages/nextjs/src/server/withSentryAPI.ts b/packages/nextjs/src/server/withSentryAPI.ts index acb15a4c5514..5d5180dd741e 100644 --- a/packages/nextjs/src/server/withSentryAPI.ts +++ b/packages/nextjs/src/server/withSentryAPI.ts @@ -1,6 +1,6 @@ import { captureException, getCurrentHub, startTransaction } from '@sentry/node'; import { extractTraceparentData, hasTracingEnabled } from '@sentry/tracing'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { addExceptionMechanism, baggageHeaderToDynamicSamplingContext, diff --git a/packages/nextjs/src/server/withSentryGetServerSideProps.ts b/packages/nextjs/src/server/withSentryGetServerSideProps.ts index 76c8b848712a..1f41e91ab3e9 100644 --- a/packages/nextjs/src/server/withSentryGetServerSideProps.ts +++ b/packages/nextjs/src/server/withSentryGetServerSideProps.ts @@ -1,6 +1,6 @@ import { hasTracingEnabled } from '@sentry/tracing'; import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; -import { GetServerSideProps } from 'next'; +import type { GetServerSideProps } from 'next'; import { isBuild } from './utils/isBuild'; import { diff --git a/packages/nextjs/src/server/withSentryGetStaticProps.ts b/packages/nextjs/src/server/withSentryGetStaticProps.ts index 7220480b4117..96e6f2b81db9 100644 --- a/packages/nextjs/src/server/withSentryGetStaticProps.ts +++ b/packages/nextjs/src/server/withSentryGetStaticProps.ts @@ -1,4 +1,4 @@ -import { GetStaticProps } from 'next'; +import type { GetStaticProps } from 'next'; import { isBuild } from './utils/isBuild'; import { callDataFetcherTraced, withErrorInstrumentation } from './utils/wrapperUtils'; diff --git a/packages/nextjs/src/server/withSentryServerSideAppGetInitialProps.ts b/packages/nextjs/src/server/withSentryServerSideAppGetInitialProps.ts index 89ed3af12dc7..1508661db73e 100644 --- a/packages/nextjs/src/server/withSentryServerSideAppGetInitialProps.ts +++ b/packages/nextjs/src/server/withSentryServerSideAppGetInitialProps.ts @@ -1,6 +1,6 @@ import { hasTracingEnabled } from '@sentry/tracing'; import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; -import App from 'next/app'; +import type App from 'next/app'; import { isBuild } from './utils/isBuild'; import { diff --git a/packages/nextjs/src/server/withSentryServerSideDocumentGetInitialProps.ts b/packages/nextjs/src/server/withSentryServerSideDocumentGetInitialProps.ts index d08222b6064c..95c45da095aa 100644 --- a/packages/nextjs/src/server/withSentryServerSideDocumentGetInitialProps.ts +++ b/packages/nextjs/src/server/withSentryServerSideDocumentGetInitialProps.ts @@ -1,5 +1,5 @@ import { hasTracingEnabled } from '@sentry/tracing'; -import Document from 'next/document'; +import type Document from 'next/document'; import { isBuild } from './utils/isBuild'; import { withErrorInstrumentation, withTracedServerSideDataFetcher } from './utils/wrapperUtils'; diff --git a/packages/nextjs/src/server/withSentryServerSideErrorGetInitialProps.ts b/packages/nextjs/src/server/withSentryServerSideErrorGetInitialProps.ts index a0cadad23fa3..8208c46762a9 100644 --- a/packages/nextjs/src/server/withSentryServerSideErrorGetInitialProps.ts +++ b/packages/nextjs/src/server/withSentryServerSideErrorGetInitialProps.ts @@ -1,7 +1,7 @@ import { hasTracingEnabled } from '@sentry/tracing'; import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; -import { NextPageContext } from 'next'; -import { ErrorProps } from 'next/error'; +import type { NextPageContext } from 'next'; +import type { ErrorProps } from 'next/error'; import { isBuild } from './utils/isBuild'; import { diff --git a/packages/nextjs/src/server/withSentryServerSideGetInitialProps.ts b/packages/nextjs/src/server/withSentryServerSideGetInitialProps.ts index d3760d792b9d..9cf7cef3db03 100644 --- a/packages/nextjs/src/server/withSentryServerSideGetInitialProps.ts +++ b/packages/nextjs/src/server/withSentryServerSideGetInitialProps.ts @@ -1,6 +1,6 @@ import { hasTracingEnabled } from '@sentry/tracing'; import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; -import { NextPage } from 'next'; +import type { NextPage } from 'next'; import { isBuild } from './utils/isBuild'; import { diff --git a/packages/nextjs/test/clientSdk.test.ts b/packages/nextjs/test/clientSdk.test.ts index 4a7577c21a33..044da248dc41 100644 --- a/packages/nextjs/test/clientSdk.test.ts +++ b/packages/nextjs/test/clientSdk.test.ts @@ -2,12 +2,12 @@ import { BaseClient, getCurrentHub } from '@sentry/core'; import * as SentryReact from '@sentry/react'; import { WINDOW } from '@sentry/react'; import { Integrations as TracingIntegrations } from '@sentry/tracing'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { logger } from '@sentry/utils'; import { JSDOM } from 'jsdom'; import { init, Integrations, nextRouterInstrumentation } from '../src/client'; -import { UserIntegrationsFunction } from '../src/common/userIntegrations'; +import type { UserIntegrationsFunction } from '../src/common/userIntegrations'; const { BrowserTracing } = TracingIntegrations; diff --git a/packages/nextjs/test/config/fixtures.ts b/packages/nextjs/test/config/fixtures.ts index 9accd4a0ba64..8edf88a8caf9 100644 --- a/packages/nextjs/test/config/fixtures.ts +++ b/packages/nextjs/test/config/fixtures.ts @@ -1,4 +1,4 @@ -import { +import type { BuildContext, EntryPropertyFunction, ExportedNextConfig, diff --git a/packages/nextjs/test/config/testUtils.ts b/packages/nextjs/test/config/testUtils.ts index 889ac4bb54da..74f854fa08b8 100644 --- a/packages/nextjs/test/config/testUtils.ts +++ b/packages/nextjs/test/config/testUtils.ts @@ -1,6 +1,6 @@ -import { WebpackPluginInstance } from 'webpack'; +import type { WebpackPluginInstance } from 'webpack'; -import { +import type { BuildContext, EntryPropertyFunction, ExportedNextConfig, @@ -9,7 +9,8 @@ import { WebpackConfigObject, WebpackConfigObjectWithModuleRules, } from '../../src/config/types'; -import { constructWebpackConfigFunction, SentryWebpackPlugin } from '../../src/config/webpack'; +import type { SentryWebpackPlugin } from '../../src/config/webpack'; +import { constructWebpackConfigFunction } from '../../src/config/webpack'; import { withSentryConfig } from '../../src/config/withSentryConfig'; import { defaultRuntimePhase, defaultsObject } from './fixtures'; diff --git a/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts b/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts index bd8314663bb7..220e041c3fda 100644 --- a/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts +++ b/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; -import { BuildContext, ExportedNextConfig } from '../../../src/config/types'; +import type { BuildContext, ExportedNextConfig } from '../../../src/config/types'; import { getUserConfigFile, getWebpackPluginOptions, SentryWebpackPlugin } from '../../../src/config/webpack'; import { clientBuildContext, diff --git a/packages/nextjs/test/config/withSentry.test.ts b/packages/nextjs/test/config/withSentry.test.ts index 0ff2dca6018f..6cbf4ac02c09 100644 --- a/packages/nextjs/test/config/withSentry.test.ts +++ b/packages/nextjs/test/config/withSentry.test.ts @@ -1,7 +1,7 @@ import * as hub from '@sentry/core'; import * as Sentry from '@sentry/node'; -import { Client, ClientOptions } from '@sentry/types'; -import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'; +import type { Client, ClientOptions } from '@sentry/types'; +import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'; import { withSentry } from '../../src/server'; import type { AugmentedNextApiResponse, WrappedNextApiHandler } from '../../src/server/types'; diff --git a/packages/nextjs/test/config/wrappers.test.ts b/packages/nextjs/test/config/wrappers.test.ts index ba742869ac49..8edf2de57567 100644 --- a/packages/nextjs/test/config/wrappers.test.ts +++ b/packages/nextjs/test/config/wrappers.test.ts @@ -1,6 +1,6 @@ import * as SentryCore from '@sentry/core'; import * as SentryTracing from '@sentry/tracing'; -import { IncomingMessage, ServerResponse } from 'http'; +import type { IncomingMessage, ServerResponse } from 'http'; import { withSentryGetServerSideProps, withSentryServerSideGetInitialProps } from '../../src/server'; diff --git a/packages/nextjs/test/performance/client.test.ts b/packages/nextjs/test/performance/client.test.ts index 1cd7d0e787a7..0b3ae0e7437e 100644 --- a/packages/nextjs/test/performance/client.test.ts +++ b/packages/nextjs/test/performance/client.test.ts @@ -1,7 +1,7 @@ import { WINDOW } from '@sentry/react'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { JSDOM } from 'jsdom'; -import { NEXT_DATA as NextData } from 'next/dist/next-server/lib/utils'; +import type { NEXT_DATA as NextData } from 'next/dist/next-server/lib/utils'; import { default as Router } from 'next/router'; import { nextRouterInstrumentation } from '../../src/client/performance'; diff --git a/packages/nextjs/test/serverSdk.test.ts b/packages/nextjs/test/serverSdk.test.ts index 56ef03377df6..1a32551317e5 100644 --- a/packages/nextjs/test/serverSdk.test.ts +++ b/packages/nextjs/test/serverSdk.test.ts @@ -1,6 +1,6 @@ import * as SentryNode from '@sentry/node'; import { getCurrentHub, NodeClient } from '@sentry/node'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { GLOBAL_OBJ, logger } from '@sentry/utils'; import * as domain from 'domain'; diff --git a/packages/nextjs/test/types/next.config.ts b/packages/nextjs/test/types/next.config.ts index a447cb167249..36e50a276125 100644 --- a/packages/nextjs/test/types/next.config.ts +++ b/packages/nextjs/test/types/next.config.ts @@ -1,4 +1,4 @@ -import { NextConfig } from 'next'; +import type { NextConfig } from 'next'; import { withSentryConfig } from '../../src/config/withSentryConfig'; diff --git a/packages/nextjs/test/utils/tunnelRoute.test.ts b/packages/nextjs/test/utils/tunnelRoute.test.ts index ae9b085da7ca..0e0a6d48f47c 100644 --- a/packages/nextjs/test/utils/tunnelRoute.test.ts +++ b/packages/nextjs/test/utils/tunnelRoute.test.ts @@ -1,4 +1,4 @@ -import { BrowserOptions } from '@sentry/react'; +import type { BrowserOptions } from '@sentry/react'; import { applyTunnelRouteOption } from '../../src/client/tunnelRoute'; diff --git a/packages/nextjs/test/utils/userIntegrations.test.ts b/packages/nextjs/test/utils/userIntegrations.test.ts index 7a5d8d879fa1..431caa4071a3 100644 --- a/packages/nextjs/test/utils/userIntegrations.test.ts +++ b/packages/nextjs/test/utils/userIntegrations.test.ts @@ -1,5 +1,8 @@ -import type { IntegrationWithExclusionOption as Integration } from '../../src/common/userIntegrations'; -import { addOrUpdateIntegration, UserIntegrations } from '../../src/common/userIntegrations'; +import type { + IntegrationWithExclusionOption as Integration, + UserIntegrations, +} from '../../src/common/userIntegrations'; +import { addOrUpdateIntegration } from '../../src/common/userIntegrations'; type MockIntegrationOptions = { name: string; diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-assign/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-assign/test.ts index 2d51f934b7f4..65aea16c60a1 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-assign/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-assign/test.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('Should not overwrite baggage if the incoming request already has Sentry baggage data.', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '..')}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/test.ts index 2650f1d7afc2..71defa704bba 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/test.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('should attach a `baggage` header to an outgoing request.', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '.')}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/test.ts index 3de98d14bf06..0c2c2d39c606 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/test.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('should ignore sentry-values in `baggage` header of a third party vendor and overwrite them with incoming DSC', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '.')}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/test.ts index 2f88610509c5..65d1d3d64c10 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/test.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('should merge `baggage` header of a third party vendor with the Sentry DSC baggage items', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '.')}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/test.ts index d698fd2b7aa6..28e72d92ebe1 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/test.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('Includes transaction in baggage if the transaction name is parameterized', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '.')}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts index 366051b9cac8..cb90133b043f 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts @@ -2,7 +2,7 @@ import { TRACEPARENT_REGEXP } from '@sentry/utils'; import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('Should assign `sentry-trace` header which sets parent trace id of an outgoing request.', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '..')}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts index bd4e29e7a807..aeccfd23a2e5 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts @@ -2,7 +2,7 @@ import { TRACEPARENT_REGEXP } from '@sentry/utils'; import * as path from 'path'; import { TestEnv } from '../../../../utils/index'; -import { TestAPIResponse } from '../server'; +import type { TestAPIResponse } from '../server'; test('should attach a `sentry-trace` header to an outgoing request.', async () => { const env = await TestEnv.init(__dirname, `${path.resolve(__dirname, '..')}/server.ts`); diff --git a/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts b/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts index 37f155e534a6..6603202a3013 100644 --- a/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts +++ b/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import * as childProcess from 'child_process'; import * as path from 'path'; diff --git a/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts b/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts index 63c82f7b4054..4891187a10d4 100644 --- a/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts +++ b/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { assertSentryEvent, TestEnv } from '../../../../utils'; diff --git a/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts b/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts index aaf53e26d83f..51ad8a30af17 100644 --- a/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts +++ b/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { assertSentryEvent, TestEnv } from '../../../../utils'; diff --git a/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts b/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts index 03c8727d3b7e..85f29fdab4dc 100644 --- a/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts +++ b/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { assertSentryEvent, TestEnv } from '../../../../utils'; diff --git a/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts b/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts index 94758652bbfb..89c1128fefb0 100644 --- a/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts +++ b/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { assertSentryEvent, TestEnv } from '../../../../utils'; diff --git a/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts b/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts index 1945608623f2..46d4c5180526 100644 --- a/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts +++ b/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { assertSentryEvent, TestEnv } from '../../../../utils'; diff --git a/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts b/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts index a9dcdcf7bd9d..21c842e6a6f7 100644 --- a/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts +++ b/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { assertSentryEvent, TestEnv } from '../../../../utils'; diff --git a/packages/node-integration-tests/utils/index.ts b/packages/node-integration-tests/utils/index.ts index 0be096fc65c5..a46e76621e07 100644 --- a/packages/node-integration-tests/utils/index.ts +++ b/packages/node-integration-tests/utils/index.ts @@ -1,11 +1,12 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import * as Sentry from '@sentry/node'; -import { EnvelopeItemType } from '@sentry/types'; +import type { EnvelopeItemType } from '@sentry/types'; import { logger, parseSemver } from '@sentry/utils'; -import axios, { AxiosRequestConfig } from 'axios'; -import { Express } from 'express'; -import * as http from 'http'; -import { AddressInfo } from 'net'; +import type { AxiosRequestConfig } from 'axios'; +import axios from 'axios'; +import type { Express } from 'express'; +import type * as http from 'http'; +import type { AddressInfo } from 'net'; import nock from 'nock'; import * as path from 'path'; diff --git a/packages/node/src/client.ts b/packages/node/src/client.ts index 66dc8fb4ce27..0b3a925d775e 100644 --- a/packages/node/src/client.ts +++ b/packages/node/src/client.ts @@ -1,11 +1,12 @@ -import { BaseClient, Scope, SDK_VERSION, SessionFlusher } from '@sentry/core'; -import { Event, EventHint, Severity, SeverityLevel } from '@sentry/types'; +import type { Scope } from '@sentry/core'; +import { BaseClient, SDK_VERSION, SessionFlusher } from '@sentry/core'; +import type { Event, EventHint, Severity, SeverityLevel } from '@sentry/types'; import { logger, resolvedSyncPromise } from '@sentry/utils'; import * as os from 'os'; import { TextEncoder } from 'util'; import { eventFromMessage, eventFromUnknownInput } from './eventbuilder'; -import { NodeClientOptions } from './types'; +import type { NodeClientOptions } from './types'; /** * The Sentry Node SDK Client. diff --git a/packages/node/src/eventbuilder.ts b/packages/node/src/eventbuilder.ts index 3d97d2a602ab..f2bb1443a40f 100644 --- a/packages/node/src/eventbuilder.ts +++ b/packages/node/src/eventbuilder.ts @@ -1,5 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import { +import type { Event, EventHint, Exception, diff --git a/packages/node/src/handlers.ts b/packages/node/src/handlers.ts index a5e5ff3b6f11..1dfd8e4e27c9 100644 --- a/packages/node/src/handlers.ts +++ b/packages/node/src/handlers.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { captureException, getCurrentHub, startTransaction, withScope } from '@sentry/core'; -import { Span } from '@sentry/types'; +import type { Span } from '@sentry/types'; +import type { AddRequestDataToEventOptions } from '@sentry/utils'; import { - AddRequestDataToEventOptions, addRequestDataToTransaction, baggageHeaderToDynamicSamplingContext, dropUndefinedKeys, @@ -12,9 +12,9 @@ import { logger, } from '@sentry/utils'; import * as domain from 'domain'; -import * as http from 'http'; +import type * as http from 'http'; -import { NodeClient } from './client'; +import type { NodeClient } from './client'; import { extractRequestData } from './requestdata'; // TODO (v8 / XXX) Remove this import import type { ParseRequestOptions } from './requestDataDeprecated'; diff --git a/packages/node/src/integrations/console.ts b/packages/node/src/integrations/console.ts index 9b032c75cced..da0b684c4992 100644 --- a/packages/node/src/integrations/console.ts +++ b/packages/node/src/integrations/console.ts @@ -1,5 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { fill, severityLevelFromString } from '@sentry/utils'; import * as util from 'util'; diff --git a/packages/node/src/integrations/context.ts b/packages/node/src/integrations/context.ts index c0991720d76e..33282d992716 100644 --- a/packages/node/src/integrations/context.ts +++ b/packages/node/src/integrations/context.ts @@ -1,5 +1,5 @@ /* eslint-disable max-lines */ -import { +import type { AppContext, Contexts, CultureContext, diff --git a/packages/node/src/integrations/contextlines.ts b/packages/node/src/integrations/contextlines.ts index cad196342f28..aa41ae68cdd8 100644 --- a/packages/node/src/integrations/contextlines.ts +++ b/packages/node/src/integrations/contextlines.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Integration, StackFrame } from '@sentry/types'; +import type { Event, EventProcessor, Integration, StackFrame } from '@sentry/types'; import { addContextToFrame } from '@sentry/utils'; import { readFile } from 'fs'; import { LRUMap } from 'lru_map'; diff --git a/packages/node/src/integrations/http.ts b/packages/node/src/integrations/http.ts index 9fbc79c335b4..867c6ad9df24 100644 --- a/packages/node/src/integrations/http.ts +++ b/packages/node/src/integrations/http.ts @@ -1,5 +1,6 @@ -import { getCurrentHub, Hub } from '@sentry/core'; -import { EventProcessor, Integration, Span, TracePropagationTargets } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { EventProcessor, Integration, Span, TracePropagationTargets } from '@sentry/types'; import { dynamicSamplingContextToSentryBaggageHeader, fill, @@ -7,18 +8,12 @@ import { parseSemver, stringMatchesSomePattern, } from '@sentry/utils'; -import * as http from 'http'; -import * as https from 'https'; +import type * as http from 'http'; +import type * as https from 'https'; -import { NodeClient } from '../client'; -import { - cleanSpanDescription, - extractUrl, - isSentryRequest, - normalizeRequestArgs, - RequestMethod, - RequestMethodArgs, -} from './utils/http'; +import type { NodeClient } from '../client'; +import type { RequestMethod, RequestMethodArgs } from './utils/http'; +import { cleanSpanDescription, extractUrl, isSentryRequest, normalizeRequestArgs } from './utils/http'; const NODE_VERSION = parseSemver(process.versions.node); diff --git a/packages/node/src/integrations/linkederrors.ts b/packages/node/src/integrations/linkederrors.ts index 1b0a6bf12565..e2894a128be5 100644 --- a/packages/node/src/integrations/linkederrors.ts +++ b/packages/node/src/integrations/linkederrors.ts @@ -1,8 +1,8 @@ import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core'; -import { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types'; +import type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types'; import { isInstanceOf, resolvedSyncPromise, SyncPromise } from '@sentry/utils'; -import { NodeClient } from '../client'; +import type { NodeClient } from '../client'; import { exceptionFromError } from '../eventbuilder'; import { ContextLines } from './contextlines'; diff --git a/packages/node/src/integrations/localvariables.ts b/packages/node/src/integrations/localvariables.ts index fc82e1a611f0..785c0fc74713 100644 --- a/packages/node/src/integrations/localvariables.ts +++ b/packages/node/src/integrations/localvariables.ts @@ -1,4 +1,4 @@ -import { +import type { ClientOptions, Event, EventProcessor, @@ -8,7 +8,8 @@ import { StackFrame, StackParser, } from '@sentry/types'; -import { Debugger, InspectorNotification, Runtime, Session } from 'inspector'; +import type { Debugger, InspectorNotification, Runtime } from 'inspector'; +import { Session } from 'inspector'; import { LRUMap } from 'lru_map'; export interface DebugSession { diff --git a/packages/node/src/integrations/modules.ts b/packages/node/src/integrations/modules.ts index 5140c5ee253a..376c0b0144f6 100644 --- a/packages/node/src/integrations/modules.ts +++ b/packages/node/src/integrations/modules.ts @@ -1,4 +1,4 @@ -import { EventProcessor, Hub, Integration } from '@sentry/types'; +import type { EventProcessor, Hub, Integration } from '@sentry/types'; import { existsSync, readFileSync } from 'fs'; import { dirname, join } from 'path'; diff --git a/packages/node/src/integrations/onuncaughtexception.ts b/packages/node/src/integrations/onuncaughtexception.ts index e97796a3a33c..2d10ae61d696 100644 --- a/packages/node/src/integrations/onuncaughtexception.ts +++ b/packages/node/src/integrations/onuncaughtexception.ts @@ -1,8 +1,9 @@ -import { getCurrentHub, Scope } from '@sentry/core'; -import { Integration } from '@sentry/types'; +import type { Scope } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { Integration } from '@sentry/types'; import { logger } from '@sentry/utils'; -import { NodeClient } from '../client'; +import type { NodeClient } from '../client'; import { logAndExitProcess } from './utils/errorhandling'; type OnFatalErrorHandler = (firstError: Error, secondError?: Error) => void; diff --git a/packages/node/src/integrations/onunhandledrejection.ts b/packages/node/src/integrations/onunhandledrejection.ts index 2ba9a3d8f205..aa3916931ba7 100644 --- a/packages/node/src/integrations/onunhandledrejection.ts +++ b/packages/node/src/integrations/onunhandledrejection.ts @@ -1,5 +1,6 @@ -import { getCurrentHub, Scope } from '@sentry/core'; -import { Integration } from '@sentry/types'; +import type { Scope } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { Integration } from '@sentry/types'; import { consoleSandbox } from '@sentry/utils'; import { logAndExitProcess } from './utils/errorhandling'; diff --git a/packages/node/src/integrations/requestdata.ts b/packages/node/src/integrations/requestdata.ts index ec091d6907f7..2994b797b221 100644 --- a/packages/node/src/integrations/requestdata.ts +++ b/packages/node/src/integrations/requestdata.ts @@ -1,10 +1,11 @@ // TODO (v8 or v9): Whenever this becomes a default integration for `@sentry/browser`, move this to `@sentry/core`. For // now, we leave it in `@sentry/integrations` so that it doesn't contribute bytes to our CDN bundles. -import { Event, EventProcessor, Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types'; import { extractPathForTransaction } from '@sentry/utils'; -import { addRequestDataToEvent, AddRequestDataToEventOptions, TransactionNamingScheme } from '../requestdata'; +import type { AddRequestDataToEventOptions, TransactionNamingScheme } from '../requestdata'; +import { addRequestDataToEvent } from '../requestdata'; export type RequestDataIntegrationOptions = { /** diff --git a/packages/node/src/integrations/utils/errorhandling.ts b/packages/node/src/integrations/utils/errorhandling.ts index 912b01c55ba9..e4c7a14924a1 100644 --- a/packages/node/src/integrations/utils/errorhandling.ts +++ b/packages/node/src/integrations/utils/errorhandling.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '@sentry/core'; import { logger } from '@sentry/utils'; -import { NodeClient } from '../../client'; +import type { NodeClient } from '../../client'; const DEFAULT_SHUTDOWN_TIMEOUT = 2000; diff --git a/packages/node/src/integrations/utils/http.ts b/packages/node/src/integrations/utils/http.ts index 067b2db2da9e..1281f9d6329d 100644 --- a/packages/node/src/integrations/utils/http.ts +++ b/packages/node/src/integrations/utils/http.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '@sentry/core'; import { parseSemver } from '@sentry/utils'; -import * as http from 'http'; -import * as https from 'https'; +import type * as http from 'http'; +import type * as https from 'https'; import { URL } from 'url'; const NODE_VERSION = parseSemver(process.versions.node); diff --git a/packages/node/src/requestDataDeprecated.ts b/packages/node/src/requestDataDeprecated.ts index 7e7ce5c5d241..2a45e71f8e47 100644 --- a/packages/node/src/requestDataDeprecated.ts +++ b/packages/node/src/requestDataDeprecated.ts @@ -6,13 +6,10 @@ /* eslint-disable deprecation/deprecation */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Event, ExtractedNodeRequestData, PolymorphicRequest } from '@sentry/types'; +import type { Event, ExtractedNodeRequestData, PolymorphicRequest } from '@sentry/types'; -import { - addRequestDataToEvent, - AddRequestDataToEventOptions, - extractRequestData as _extractRequestData, -} from './requestdata'; +import type { AddRequestDataToEventOptions } from './requestdata'; +import { addRequestDataToEvent, extractRequestData as _extractRequestData } from './requestdata'; /** * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead. diff --git a/packages/node/src/requestdata.ts b/packages/node/src/requestdata.ts index d72880df9680..d13aa78700f2 100644 --- a/packages/node/src/requestdata.ts +++ b/packages/node/src/requestdata.ts @@ -1,4 +1,10 @@ -import { Event, ExtractedNodeRequestData, PolymorphicRequest, Transaction, TransactionSource } from '@sentry/types'; +import type { + Event, + ExtractedNodeRequestData, + PolymorphicRequest, + Transaction, + TransactionSource, +} from '@sentry/types'; import { isPlainObject, isString, normalize, stripUrlQueryAndFragment } from '@sentry/utils'; import * as cookie from 'cookie'; import * as url from 'url'; diff --git a/packages/node/src/sdk.ts b/packages/node/src/sdk.ts index d70d8ec73180..71ae258826c8 100644 --- a/packages/node/src/sdk.ts +++ b/packages/node/src/sdk.ts @@ -7,7 +7,7 @@ import { Integrations as CoreIntegrations, setHubOnCarrier, } from '@sentry/core'; -import { SessionStatus, StackParser } from '@sentry/types'; +import type { SessionStatus, StackParser } from '@sentry/types'; import { createStackParser, GLOBAL_OBJ, @@ -32,7 +32,7 @@ import { } from './integrations'; import { getModule } from './module'; import { makeNodeTransport } from './transports'; -import { NodeClientOptions, NodeOptions } from './types'; +import type { NodeClientOptions, NodeOptions } from './types'; export const defaultIntegrations = [ // Common diff --git a/packages/node/src/transports/http-module.ts b/packages/node/src/transports/http-module.ts index d3856bcb4b8e..64b255cc869c 100644 --- a/packages/node/src/transports/http-module.ts +++ b/packages/node/src/transports/http-module.ts @@ -1,7 +1,7 @@ -import { IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'http'; -import { RequestOptions as HTTPSRequestOptions } from 'https'; -import { Writable } from 'stream'; -import { URL } from 'url'; +import type { IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'http'; +import type { RequestOptions as HTTPSRequestOptions } from 'https'; +import type { Writable } from 'stream'; +import type { URL } from 'url'; export type HTTPModuleRequestOptions = HTTPRequestOptions | HTTPSRequestOptions | string | URL; diff --git a/packages/node/src/transports/http.ts b/packages/node/src/transports/http.ts index 8116f194cd6b..a16f78e79a6f 100644 --- a/packages/node/src/transports/http.ts +++ b/packages/node/src/transports/http.ts @@ -1,5 +1,5 @@ import { createTransport } from '@sentry/core'; -import { +import type { BaseTransportOptions, Transport, TransportMakeRequestResponse, @@ -12,7 +12,7 @@ import { Readable } from 'stream'; import { URL } from 'url'; import { createGzip } from 'zlib'; -import { HTTPModule } from './http-module'; +import type { HTTPModule } from './http-module'; export interface NodeTransportOptions extends BaseTransportOptions { /** Define custom headers */ diff --git a/packages/node/src/types.ts b/packages/node/src/types.ts index 7b71d7bab988..6acdbb4b2566 100644 --- a/packages/node/src/types.ts +++ b/packages/node/src/types.ts @@ -1,6 +1,6 @@ -import { ClientOptions, Options, TracePropagationTargets } from '@sentry/types'; +import type { ClientOptions, Options, TracePropagationTargets } from '@sentry/types'; -import { NodeTransportOptions } from './transports'; +import type { NodeTransportOptions } from './transports'; export interface BaseNodeOptions { /** diff --git a/packages/node/test/client.test.ts b/packages/node/test/client.test.ts index a219a307f9d9..a996b5408288 100644 --- a/packages/node/test/client.test.ts +++ b/packages/node/test/client.test.ts @@ -1,5 +1,5 @@ import { Scope, SessionFlusher } from '@sentry/core'; -import { Event, EventHint } from '@sentry/types'; +import type { Event, EventHint } from '@sentry/types'; import * as os from 'os'; import { NodeClient } from '../src'; diff --git a/packages/node/test/context-lines.test.ts b/packages/node/test/context-lines.test.ts index 2b0fef8206b8..de6f6f382cd8 100644 --- a/packages/node/test/context-lines.test.ts +++ b/packages/node/test/context-lines.test.ts @@ -1,4 +1,4 @@ -import { StackFrame } from '@sentry/types'; +import type { StackFrame } from '@sentry/types'; import * as fs from 'fs'; import { parseStackFrames } from '../src/eventbuilder'; diff --git a/packages/node/test/eventbuilders.test.ts b/packages/node/test/eventbuilders.test.ts index 49f8e8156c5c..46dfc02a3c33 100644 --- a/packages/node/test/eventbuilders.test.ts +++ b/packages/node/test/eventbuilders.test.ts @@ -1,4 +1,4 @@ -import { Client } from '@sentry/types'; +import type { Client } from '@sentry/types'; import { defaultStackParser, Scope } from '../src'; import { eventFromUnknownInput } from '../src/eventbuilder'; diff --git a/packages/node/test/handlers.test.ts b/packages/node/test/handlers.test.ts index 1bf422f59621..9145305d6c1f 100644 --- a/packages/node/test/handlers.test.ts +++ b/packages/node/test/handlers.test.ts @@ -1,7 +1,7 @@ import * as sentryCore from '@sentry/core'; import { Hub, makeMain, Scope } from '@sentry/core'; import { Transaction } from '@sentry/tracing'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { SentryError } from '@sentry/utils'; import * as http from 'http'; diff --git a/packages/node/test/helper/node-client-options.ts b/packages/node/test/helper/node-client-options.ts index d6973e4a437d..9103174ad813 100644 --- a/packages/node/test/helper/node-client-options.ts +++ b/packages/node/test/helper/node-client-options.ts @@ -1,7 +1,7 @@ import { createTransport } from '@sentry/core'; import { resolvedSyncPromise } from '@sentry/utils'; -import { NodeClientOptions } from '../../src/types'; +import type { NodeClientOptions } from '../../src/types'; export function getDefaultNodeClientOptions(options: Partial = {}): NodeClientOptions { return { diff --git a/packages/node/test/index.test.ts b/packages/node/test/index.test.ts index d345998d3628..6ca834874d2e 100644 --- a/packages/node/test/index.test.ts +++ b/packages/node/test/index.test.ts @@ -1,22 +1,21 @@ import { getMainCarrier, initAndBind, SDK_VERSION } from '@sentry/core'; -import { EventHint, Integration } from '@sentry/types'; +import type { EventHint, Integration } from '@sentry/types'; import * as domain from 'domain'; +import type { Event, Scope } from '../src'; import { addBreadcrumb, captureEvent, captureException, captureMessage, configureScope, - Event, getCurrentHub, init, NodeClient, - Scope, } from '../src'; import { ContextLines, LinkedErrors } from '../src/integrations'; import { defaultStackParser } from '../src/sdk'; -import { NodeClientOptions } from '../src/types'; +import type { NodeClientOptions } from '../src/types'; import { getDefaultNodeClientOptions } from './helper/node-client-options'; jest.mock('@sentry/core', () => { diff --git a/packages/node/test/integrations/http.test.ts b/packages/node/test/integrations/http.test.ts index c717550710cf..ab2370ec19c6 100644 --- a/packages/node/test/integrations/http.test.ts +++ b/packages/node/test/integrations/http.test.ts @@ -1,17 +1,18 @@ import * as sentryCore from '@sentry/core'; import { Hub } from '@sentry/core'; -import { addExtensionMethods, Span, TRACEPARENT_REGEXP, Transaction } from '@sentry/tracing'; -import { TransactionContext } from '@sentry/types'; +import type { Span, Transaction } from '@sentry/tracing'; +import { addExtensionMethods, TRACEPARENT_REGEXP } from '@sentry/tracing'; +import type { TransactionContext } from '@sentry/types'; import { logger, parseSemver } from '@sentry/utils'; import * as http from 'http'; import * as https from 'https'; import * as HttpsProxyAgent from 'https-proxy-agent'; import * as nock from 'nock'; -import { Breadcrumb } from '../../src'; +import type { Breadcrumb } from '../../src'; import { NodeClient } from '../../src/client'; import { Http as HttpIntegration } from '../../src/integrations/http'; -import { NodeClientOptions } from '../../src/types'; +import type { NodeClientOptions } from '../../src/types'; import { getDefaultNodeClientOptions } from '../helper/node-client-options'; const NODE_VERSION = parseSemver(process.versions.node); diff --git a/packages/node/test/integrations/linkederrors.test.ts b/packages/node/test/integrations/linkederrors.test.ts index 390a847eea34..6582c0f6e9e5 100644 --- a/packages/node/test/integrations/linkederrors.test.ts +++ b/packages/node/test/integrations/linkederrors.test.ts @@ -1,6 +1,7 @@ -import { ExtendedError } from '@sentry/types'; +import type { ExtendedError } from '@sentry/types'; -import { Event, NodeClient } from '../../src'; +import type { Event } from '../../src'; +import { NodeClient } from '../../src'; import { LinkedErrors } from '../../src/integrations/linkederrors'; import { defaultStackParser as stackParser } from '../../src/sdk'; import { getDefaultNodeClientOptions } from '../helper/node-client-options'; diff --git a/packages/node/test/integrations/localvariables.test.ts b/packages/node/test/integrations/localvariables.test.ts index a9756e11d623..5324c2908b0f 100644 --- a/packages/node/test/integrations/localvariables.test.ts +++ b/packages/node/test/integrations/localvariables.test.ts @@ -1,9 +1,10 @@ -import { ClientOptions, EventProcessor } from '@sentry/types'; -import { Debugger, InspectorNotification } from 'inspector'; -import { LRUMap } from 'lru_map'; +import type { ClientOptions, EventProcessor } from '@sentry/types'; +import type { Debugger, InspectorNotification } from 'inspector'; +import type { LRUMap } from 'lru_map'; import { defaultStackParser } from '../../src'; -import { DebugSession, FrameVariables, LocalVariables } from '../../src/integrations/localvariables'; +import type { DebugSession, FrameVariables } from '../../src/integrations/localvariables'; +import { LocalVariables } from '../../src/integrations/localvariables'; import { getDefaultNodeClientOptions } from '../../test/helper/node-client-options'; interface ThrowOn { diff --git a/packages/node/test/integrations/requestdata.test.ts b/packages/node/test/integrations/requestdata.test.ts index 270c04cdfa86..91d9870f8292 100644 --- a/packages/node/test/integrations/requestdata.test.ts +++ b/packages/node/test/integrations/requestdata.test.ts @@ -1,10 +1,11 @@ import { getCurrentHub, Hub, makeMain } from '@sentry/core'; -import { Event, EventProcessor, PolymorphicRequest } from '@sentry/types'; +import type { Event, EventProcessor, PolymorphicRequest } from '@sentry/types'; import * as http from 'http'; import { NodeClient } from '../../src/client'; import { requestHandler } from '../../src/handlers'; -import { RequestData, RequestDataIntegrationOptions } from '../../src/integrations/requestdata'; +import type { RequestDataIntegrationOptions } from '../../src/integrations/requestdata'; +import { RequestData } from '../../src/integrations/requestdata'; import * as requestDataModule from '../../src/requestdata'; import { getDefaultNodeClientOptions } from '../helper/node-client-options'; diff --git a/packages/node/test/requestdata.test.ts b/packages/node/test/requestdata.test.ts index 9c79f2cd59bd..744cc9077c37 100644 --- a/packages/node/test/requestdata.test.ts +++ b/packages/node/test/requestdata.test.ts @@ -2,20 +2,17 @@ // TODO (v8 / #5257): Remove everything related to the deprecated functions -import { Event, PolymorphicRequest, TransactionSource, User } from '@sentry/types'; -import * as net from 'net'; +import type { Event, PolymorphicRequest, TransactionSource, User } from '@sentry/types'; +import type * as net from 'net'; +import type { AddRequestDataToEventOptions } from '../src/requestdata'; import { addRequestDataToEvent, - AddRequestDataToEventOptions, extractPathForTransaction, extractRequestData as newExtractRequestData, } from '../src/requestdata'; -import { - ExpressRequest, - extractRequestData as oldExtractRequestData, - parseRequest, -} from '../src/requestDataDeprecated'; +import type { ExpressRequest } from '../src/requestDataDeprecated'; +import { extractRequestData as oldExtractRequestData, parseRequest } from '../src/requestDataDeprecated'; // TODO (v8 / #5257): Remove `describe.each` wrapper, remove `formatArgs` wrapper, reformat args in tests, and use only // `addRequestDataToEvent` diff --git a/packages/node/test/sdk.test.ts b/packages/node/test/sdk.test.ts index 48e5accee439..abd0265b62c4 100644 --- a/packages/node/test/sdk.test.ts +++ b/packages/node/test/sdk.test.ts @@ -1,4 +1,4 @@ -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { init } from '../src/sdk'; import * as sdk from '../src/sdk'; diff --git a/packages/node/test/transports/http.test.ts b/packages/node/test/transports/http.test.ts index 80ab74b9f673..d03e917c4f42 100644 --- a/packages/node/test/transports/http.test.ts +++ b/packages/node/test/transports/http.test.ts @@ -1,5 +1,5 @@ import { createTransport } from '@sentry/core'; -import { EventEnvelope, EventItem } from '@sentry/types'; +import type { EventEnvelope, EventItem } from '@sentry/types'; import { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, serializeEnvelope } from '@sentry/utils'; import * as http from 'http'; import { TextEncoder } from 'util'; diff --git a/packages/node/test/transports/https.test.ts b/packages/node/test/transports/https.test.ts index 77286e32cbb6..d43b8306bed0 100644 --- a/packages/node/test/transports/https.test.ts +++ b/packages/node/test/transports/https.test.ts @@ -1,12 +1,12 @@ import { createTransport } from '@sentry/core'; -import { EventEnvelope, EventItem } from '@sentry/types'; +import type { EventEnvelope, EventItem } from '@sentry/types'; import { createEnvelope, serializeEnvelope } from '@sentry/utils'; import * as http from 'http'; import * as https from 'https'; import { TextEncoder } from 'util'; import { makeNodeTransport } from '../../src/transports'; -import { HTTPModule, HTTPModuleRequestIncomingMessage } from '../../src/transports/http-module'; +import type { HTTPModule, HTTPModuleRequestIncomingMessage } from '../../src/transports/http-module'; import testServerCerts from './test-server-certs'; const textEncoder = new TextEncoder(); diff --git a/packages/opentelemetry-node/src/propagator.ts b/packages/opentelemetry-node/src/propagator.ts index 039dcc04a30d..913e1ac218df 100644 --- a/packages/opentelemetry-node/src/propagator.ts +++ b/packages/opentelemetry-node/src/propagator.ts @@ -1,13 +1,5 @@ -import { - Baggage, - Context, - isSpanContextValid, - propagation, - TextMapGetter, - TextMapSetter, - trace, - TraceFlags, -} from '@opentelemetry/api'; +import type { Baggage, Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api'; +import { isSpanContextValid, propagation, trace, TraceFlags } from '@opentelemetry/api'; import { isTracingSuppressed, W3CBaggagePropagator } from '@opentelemetry/core'; import { baggageHeaderToDynamicSamplingContext, diff --git a/packages/opentelemetry-node/src/spanprocessor.ts b/packages/opentelemetry-node/src/spanprocessor.ts index 04cd452a1a82..8aac3e1c53be 100644 --- a/packages/opentelemetry-node/src/spanprocessor.ts +++ b/packages/opentelemetry-node/src/spanprocessor.ts @@ -1,8 +1,9 @@ -import { Context, trace } from '@opentelemetry/api'; -import { Span as OtelSpan, SpanProcessor as OtelSpanProcessor } from '@opentelemetry/sdk-trace-base'; +import type { Context } from '@opentelemetry/api'; +import { trace } from '@opentelemetry/api'; +import type { Span as OtelSpan, SpanProcessor as OtelSpanProcessor } from '@opentelemetry/sdk-trace-base'; import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core'; import { Transaction } from '@sentry/tracing'; -import { DynamicSamplingContext, Span as SentrySpan, TraceparentData, TransactionContext } from '@sentry/types'; +import type { DynamicSamplingContext, Span as SentrySpan, TraceparentData, TransactionContext } from '@sentry/types'; import { logger } from '@sentry/utils'; import { SENTRY_DYNAMIC_SAMPLING_CONTEXT_KEY, SENTRY_TRACE_PARENT_CONTEXT_KEY } from './constants'; diff --git a/packages/opentelemetry-node/src/utils/is-sentry-request.ts b/packages/opentelemetry-node/src/utils/is-sentry-request.ts index 1a504f3c3820..b02e3b4cb588 100644 --- a/packages/opentelemetry-node/src/utils/is-sentry-request.ts +++ b/packages/opentelemetry-node/src/utils/is-sentry-request.ts @@ -1,4 +1,4 @@ -import { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; +import type { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { getCurrentHub } from '@sentry/core'; diff --git a/packages/opentelemetry-node/src/utils/map-otel-status.ts b/packages/opentelemetry-node/src/utils/map-otel-status.ts index 869d80862d13..789cd7706622 100644 --- a/packages/opentelemetry-node/src/utils/map-otel-status.ts +++ b/packages/opentelemetry-node/src/utils/map-otel-status.ts @@ -1,6 +1,6 @@ -import { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; +import type { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; -import { SpanStatusType as SentryStatus } from '@sentry/tracing'; +import type { SpanStatusType as SentryStatus } from '@sentry/tracing'; // canonicalCodesHTTPMap maps some HTTP codes to Sentry's span statuses. See possible mapping in https://develop.sentry.dev/sdk/event-payloads/span/ const canonicalCodesHTTPMap: Record = { diff --git a/packages/opentelemetry-node/src/utils/parse-otel-span-description.ts b/packages/opentelemetry-node/src/utils/parse-otel-span-description.ts index d95fc7028223..396e37a29ced 100644 --- a/packages/opentelemetry-node/src/utils/parse-otel-span-description.ts +++ b/packages/opentelemetry-node/src/utils/parse-otel-span-description.ts @@ -1,7 +1,8 @@ -import { AttributeValue, SpanKind } from '@opentelemetry/api'; -import { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; +import type { AttributeValue } from '@opentelemetry/api'; +import { SpanKind } from '@opentelemetry/api'; +import type { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; -import { TransactionSource } from '@sentry/types'; +import type { TransactionSource } from '@sentry/types'; interface SpanDescription { op: string | undefined; diff --git a/packages/opentelemetry-node/test/propagator.test.ts b/packages/opentelemetry-node/test/propagator.test.ts index ec7a047d7735..27c633e61c06 100644 --- a/packages/opentelemetry-node/test/propagator.test.ts +++ b/packages/opentelemetry-node/test/propagator.test.ts @@ -9,7 +9,7 @@ import { import { suppressTracing } from '@opentelemetry/core'; import { Hub, makeMain } from '@sentry/core'; import { addExtensionMethods, Transaction } from '@sentry/tracing'; -import { TransactionContext } from '@sentry/types'; +import type { TransactionContext } from '@sentry/types'; import { SENTRY_BAGGAGE_HEADER, diff --git a/packages/opentelemetry-node/test/spanprocessor.test.ts b/packages/opentelemetry-node/test/spanprocessor.test.ts index bd970bb737fd..d07c0b950f64 100644 --- a/packages/opentelemetry-node/test/spanprocessor.test.ts +++ b/packages/opentelemetry-node/test/spanprocessor.test.ts @@ -1,12 +1,13 @@ -import * as OpenTelemetry from '@opentelemetry/api'; +import type * as OpenTelemetry from '@opentelemetry/api'; import { SpanKind } from '@opentelemetry/api'; import { Resource } from '@opentelemetry/resources'; -import { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; +import type { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { SemanticAttributes, SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; import { createTransport, Hub, makeMain } from '@sentry/core'; import { NodeClient } from '@sentry/node'; -import { addExtensionMethods, Span as SentrySpan, SpanStatusType, Transaction } from '@sentry/tracing'; +import type { SpanStatusType } from '@sentry/tracing'; +import { addExtensionMethods, Span as SentrySpan, Transaction } from '@sentry/tracing'; import { resolvedSyncPromise } from '@sentry/utils'; import { SENTRY_SPAN_PROCESSOR_MAP, SentrySpanProcessor } from '../src/spanprocessor'; diff --git a/packages/react/src/errorboundary.tsx b/packages/react/src/errorboundary.tsx index 7aae1fbf6d08..907f7e029314 100644 --- a/packages/react/src/errorboundary.tsx +++ b/packages/react/src/errorboundary.tsx @@ -1,4 +1,5 @@ -import { captureException, ReportDialogOptions, Scope, showReportDialog, withScope } from '@sentry/browser'; +import type { ReportDialogOptions, Scope} from '@sentry/browser'; +import { captureException, showReportDialog, withScope } from '@sentry/browser'; import { isError, logger } from '@sentry/utils'; import hoistNonReactStatics from 'hoist-non-react-statics'; import * as React from 'react'; diff --git a/packages/react/src/profiler.tsx b/packages/react/src/profiler.tsx index 3f8f397f5ad9..d4c0f0a277e4 100644 --- a/packages/react/src/profiler.tsx +++ b/packages/react/src/profiler.tsx @@ -1,7 +1,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { getCurrentHub, Hub } from '@sentry/browser'; -import { Span, Transaction } from '@sentry/types'; +import type { Hub } from '@sentry/browser'; +import { getCurrentHub } from '@sentry/browser'; +import type { Span, Transaction } from '@sentry/types'; import { timestampWithMs } from '@sentry/utils'; import hoistNonReactStatics from 'hoist-non-react-statics'; import * as React from 'react'; diff --git a/packages/react/src/reactrouter.tsx b/packages/react/src/reactrouter.tsx index bad84fabf5a8..bfe89afd0890 100644 --- a/packages/react/src/reactrouter.tsx +++ b/packages/react/src/reactrouter.tsx @@ -1,9 +1,9 @@ import { WINDOW } from '@sentry/browser'; -import { Transaction, TransactionSource } from '@sentry/types'; +import type { Transaction, TransactionSource } from '@sentry/types'; import hoistNonReactStatics from 'hoist-non-react-statics'; import * as React from 'react'; -import { Action, Location, ReactRouterInstrumentation } from './types'; +import type { Action, Location, ReactRouterInstrumentation } from './types'; // We need to disable eslint no-explict-any because any is required for the // react-router typings. diff --git a/packages/react/src/reactrouterv3.ts b/packages/react/src/reactrouterv3.ts index e916784ede4e..4d12b3581e53 100644 --- a/packages/react/src/reactrouterv3.ts +++ b/packages/react/src/reactrouterv3.ts @@ -1,7 +1,7 @@ import { WINDOW } from '@sentry/browser'; -import { Primitive, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; +import type { Primitive, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; -import { Location, ReactRouterInstrumentation } from './types'; +import type { Location, ReactRouterInstrumentation } from './types'; // Many of the types below had to be mocked out to prevent typescript issues // these types are required for correct functionality. diff --git a/packages/react/src/reactrouterv6.tsx b/packages/react/src/reactrouterv6.tsx index 47db243cd8ab..877cd770dc7a 100644 --- a/packages/react/src/reactrouterv6.tsx +++ b/packages/react/src/reactrouterv6.tsx @@ -2,12 +2,12 @@ // https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536 import { WINDOW } from '@sentry/browser'; -import { Transaction, TransactionContext, TransactionSource } from '@sentry/types'; +import type { Transaction, TransactionContext, TransactionSource } from '@sentry/types'; import { getNumberOfUrlSegments, logger } from '@sentry/utils'; import hoistNonReactStatics from 'hoist-non-react-statics'; import React from 'react'; -import { +import type { Action, AgnosticDataRouteMatch, CreateRouterFunction, diff --git a/packages/react/src/redux.ts b/packages/react/src/redux.ts index 35f5348c5e08..5ef64a3d2522 100644 --- a/packages/react/src/redux.ts +++ b/packages/react/src/redux.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { configureScope } from '@sentry/browser'; -import { Scope } from '@sentry/types'; +import type { Scope } from '@sentry/types'; interface Action { type: T; diff --git a/packages/react/src/sdk.ts b/packages/react/src/sdk.ts index 038a509c03d7..e224d72945bb 100644 --- a/packages/react/src/sdk.ts +++ b/packages/react/src/sdk.ts @@ -1,4 +1,5 @@ -import { BrowserOptions, init as browserInit, SDK_VERSION } from '@sentry/browser'; +import type { BrowserOptions } from '@sentry/browser'; +import { init as browserInit, SDK_VERSION } from '@sentry/browser'; /** * Inits the React SDK diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index 57b2814463ec..0b908a800ff7 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -1,6 +1,6 @@ // Disabling `no-explicit-any` for the whole file as `any` has became common requirement. /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Transaction, TransactionContext } from '@sentry/types'; +import type { Transaction, TransactionContext } from '@sentry/types'; export type Action = 'PUSH' | 'REPLACE' | 'POP'; diff --git a/packages/react/test/errorboundary.test.tsx b/packages/react/test/errorboundary.test.tsx index 7b0c25dc311a..d37a1de49116 100644 --- a/packages/react/test/errorboundary.test.tsx +++ b/packages/react/test/errorboundary.test.tsx @@ -3,9 +3,10 @@ import { fireEvent, render, screen } from '@testing-library/react'; import * as React from 'react'; import { useState } from 'react'; +import type { + ErrorBoundaryProps} from '../src/errorboundary'; import { ErrorBoundary, - ErrorBoundaryProps, isAtLeastReact17, UNKNOWN_COMPONENT, withErrorBoundary, diff --git a/packages/react/test/profiler.test.tsx b/packages/react/test/profiler.test.tsx index 96988f24b44b..20dc1f2962c5 100644 --- a/packages/react/test/profiler.test.tsx +++ b/packages/react/test/profiler.test.tsx @@ -1,4 +1,4 @@ -import { SpanContext } from '@sentry/types'; +import type { SpanContext } from '@sentry/types'; import { render } from '@testing-library/react'; import { renderHook } from '@testing-library/react-hooks'; import * as React from 'react'; diff --git a/packages/react/test/reactrouterv3.test.tsx b/packages/react/test/reactrouterv3.test.tsx index 336f52b74268..a4cbe463adbc 100644 --- a/packages/react/test/reactrouterv3.test.tsx +++ b/packages/react/test/reactrouterv3.test.tsx @@ -2,7 +2,8 @@ import { act, render } from '@testing-library/react'; import * as React from 'react'; import { createMemoryHistory, createRoutes, IndexRoute, match, Route, Router } from 'react-router-3'; -import { Match, reactRouterV3Instrumentation, Route as RouteType } from '../src/reactrouterv3'; +import type { Match, Route as RouteType } from '../src/reactrouterv3'; +import { reactRouterV3Instrumentation } from '../src/reactrouterv3'; // Have to manually set types because we are using package-alias declare module 'react-router-3' { diff --git a/packages/react/test/reactrouterv4.test.tsx b/packages/react/test/reactrouterv4.test.tsx index 7e2dfd14a763..343f78c175e5 100644 --- a/packages/react/test/reactrouterv4.test.tsx +++ b/packages/react/test/reactrouterv4.test.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { matchPath, Route, Router, Switch } from 'react-router-4'; import { reactRouterV4Instrumentation, withSentryRouting } from '../src'; -import { RouteConfig } from '../src/reactrouter'; +import type { RouteConfig } from '../src/reactrouter'; describe('React Router v4', () => { function createInstrumentation(_opts?: { diff --git a/packages/react/test/reactrouterv5.test.tsx b/packages/react/test/reactrouterv5.test.tsx index f37dc10edea7..568e630ccc25 100644 --- a/packages/react/test/reactrouterv5.test.tsx +++ b/packages/react/test/reactrouterv5.test.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { matchPath, Route, Router, Switch } from 'react-router-5'; import { reactRouterV5Instrumentation, withSentryRouting } from '../src'; -import { RouteConfig } from '../src/reactrouter'; +import type { RouteConfig } from '../src/reactrouter'; describe('React Router v5', () => { function createInstrumentation(_opts?: { diff --git a/packages/react/test/reactrouterv6.4.test.tsx b/packages/react/test/reactrouterv6.4.test.tsx index aeb7953ea1ab..0863535b38d5 100644 --- a/packages/react/test/reactrouterv6.4.test.tsx +++ b/packages/react/test/reactrouterv6.4.test.tsx @@ -13,7 +13,7 @@ import { } from 'react-router-6.4'; import { reactRouterV6Instrumentation,wrapCreateBrowserRouter } from '../src'; -import { CreateRouterFunction } from '../src/types'; +import type { CreateRouterFunction } from '../src/types'; beforeAll(() => { // @ts-ignore need to override global Request because it's not in the jest environment (even with an diff --git a/packages/react/test/redux.test.ts b/packages/react/test/redux.test.ts index 9be231adaddb..bf9fc31853c4 100644 --- a/packages/react/test/redux.test.ts +++ b/packages/react/test/redux.test.ts @@ -1,5 +1,5 @@ import * as Sentry from '@sentry/browser'; -import { Scope } from '@sentry/types'; +import type { Scope } from '@sentry/types'; import * as Redux from 'redux'; import { createReduxEnhancer } from '../src/redux'; diff --git a/packages/remix/src/index.client.tsx b/packages/remix/src/index.client.tsx index 68e6c2027141..22d9ce73fe82 100644 --- a/packages/remix/src/index.client.tsx +++ b/packages/remix/src/index.client.tsx @@ -2,7 +2,7 @@ import { configureScope, init as reactInit, Integrations } from '@sentry/react'; import { buildMetadata } from './utils/metadata'; -import { RemixOptions } from './utils/remixOptions'; +import type { RemixOptions } from './utils/remixOptions'; export { remixRouterInstrumentation, withSentry } from './performance/client'; export { BrowserTracing } from '@sentry/tracing'; export * from '@sentry/react'; diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 2576c9a293f1..b2ad73866fde 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -4,7 +4,7 @@ import { logger } from '@sentry/utils'; import { instrumentServer } from './utils/instrumentServer'; import { buildMetadata } from './utils/metadata'; -import { RemixOptions } from './utils/remixOptions'; +import type { RemixOptions } from './utils/remixOptions'; export { ErrorBoundary, withErrorBoundary } from '@sentry/react'; export { remixRouterInstrumentation, withSentry } from './performance/client'; diff --git a/packages/remix/src/index.types.ts b/packages/remix/src/index.types.ts index 0d3e8a8633a1..079f524e3b61 100644 --- a/packages/remix/src/index.types.ts +++ b/packages/remix/src/index.types.ts @@ -9,7 +9,7 @@ import type { Integration, StackParser } from '@sentry/types'; import * as clientSdk from './index.client'; import * as serverSdk from './index.server'; -import { RemixOptions } from './utils/remixOptions'; +import type { RemixOptions } from './utils/remixOptions'; /** Initializes Sentry Remix SDK */ export declare function init(options: RemixOptions): void; diff --git a/packages/remix/src/performance/client.tsx b/packages/remix/src/performance/client.tsx index 2308c64d0727..0f88a67c2592 100644 --- a/packages/remix/src/performance/client.tsx +++ b/packages/remix/src/performance/client.tsx @@ -1,5 +1,6 @@ -import { ErrorBoundaryProps, WINDOW, withErrorBoundary } from '@sentry/react'; -import { Transaction, TransactionContext } from '@sentry/types'; +import type { ErrorBoundaryProps} from '@sentry/react'; +import { WINDOW, withErrorBoundary } from '@sentry/react'; +import type { Transaction, TransactionContext } from '@sentry/types'; import { logger } from '@sentry/utils'; import * as React from 'react'; diff --git a/packages/remix/src/utils/instrumentServer.ts b/packages/remix/src/utils/instrumentServer.ts index 4aee67a174b4..d80158a7b4bd 100644 --- a/packages/remix/src/utils/instrumentServer.ts +++ b/packages/remix/src/utils/instrumentServer.ts @@ -1,7 +1,8 @@ /* eslint-disable max-lines */ -import { captureException, getCurrentHub, Hub } from '@sentry/node'; +import type { Hub } from '@sentry/node'; +import { captureException, getCurrentHub } from '@sentry/node'; import { getActiveTransaction, hasTracingEnabled } from '@sentry/tracing'; -import { Transaction, TransactionSource, WrappedFunction } from '@sentry/types'; +import type { Transaction, TransactionSource, WrappedFunction } from '@sentry/types'; import { addExceptionMechanism, baggageHeaderToDynamicSamplingContext, @@ -14,7 +15,7 @@ import { } from '@sentry/utils'; import * as domain from 'domain'; -import { +import type { AppData, CreateRequestHandlerFunction, DataFunction, diff --git a/packages/remix/src/utils/metadata.ts b/packages/remix/src/utils/metadata.ts index 243cdcc3826f..382eff9c3e26 100644 --- a/packages/remix/src/utils/metadata.ts +++ b/packages/remix/src/utils/metadata.ts @@ -1,5 +1,5 @@ import { SDK_VERSION } from '@sentry/core'; -import { Options, SdkInfo } from '@sentry/types'; +import type { Options, SdkInfo } from '@sentry/types'; const PACKAGE_NAME_PREFIX = 'npm:@sentry/'; diff --git a/packages/remix/src/utils/remixOptions.ts b/packages/remix/src/utils/remixOptions.ts index 9534ed57de3b..4a1fe13e18e1 100644 --- a/packages/remix/src/utils/remixOptions.ts +++ b/packages/remix/src/utils/remixOptions.ts @@ -1,5 +1,5 @@ -import { NodeOptions } from '@sentry/node'; -import { BrowserOptions } from '@sentry/react'; -import { Options } from '@sentry/types'; +import type { NodeOptions } from '@sentry/node'; +import type { BrowserOptions } from '@sentry/react'; +import type { Options } from '@sentry/types'; export type RemixOptions = Options | BrowserOptions | NodeOptions; diff --git a/packages/remix/src/utils/serverAdapters/express.ts b/packages/remix/src/utils/serverAdapters/express.ts index 136246e60dde..e2484e4a6d6d 100644 --- a/packages/remix/src/utils/serverAdapters/express.ts +++ b/packages/remix/src/utils/serverAdapters/express.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '@sentry/core'; import { flush } from '@sentry/node'; import { hasTracingEnabled } from '@sentry/tracing'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { extractRequestData, isString, logger } from '@sentry/utils'; import { cwd } from 'process'; @@ -12,7 +12,7 @@ import { isRequestHandlerWrapped, startRequestHandlerTransaction, } from '../instrumentServer'; -import { +import type { ExpressCreateRequestHandler, ExpressCreateRequestHandlerOptions, ExpressNextFunction, diff --git a/packages/remix/src/utils/types.ts b/packages/remix/src/utils/types.ts index f6fe6e8d30e9..225a3ea1ad56 100644 --- a/packages/remix/src/utils/types.ts +++ b/packages/remix/src/utils/types.ts @@ -3,7 +3,7 @@ // Types vendored from @remix-run/server-runtime@1.6.0: // https://github.com/remix-run/remix/blob/f3691d51027b93caa3fd2cdfe146d7b62a6eb8f2/packages/remix-server-runtime/server.ts import type * as Express from 'express'; -import { Agent } from 'https'; +import type { Agent } from 'https'; import type { ComponentType } from 'react'; export type RemixRequestState = { diff --git a/packages/remix/src/utils/web-fetch.ts b/packages/remix/src/utils/web-fetch.ts index 72ce4177827b..853eac775c84 100644 --- a/packages/remix/src/utils/web-fetch.ts +++ b/packages/remix/src/utils/web-fetch.ts @@ -4,7 +4,7 @@ import { logger } from '@sentry/utils'; import { getClientIPAddress } from './getIpAddress'; -import { RemixRequest } from './types'; +import type { RemixRequest } from './types'; /* * Symbol extractor utility to be able to access internal fields of Remix requests. diff --git a/packages/replay/jest.setup.ts b/packages/replay/jest.setup.ts index 9d165d8c428e..db17db23f761 100644 --- a/packages/replay/jest.setup.ts +++ b/packages/replay/jest.setup.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { getCurrentHub } from '@sentry/core'; -import { ReplayRecordingData,Transport } from '@sentry/types'; +import type { ReplayRecordingData,Transport } from '@sentry/types'; import type { ReplayContainer, Session } from './src/types'; diff --git a/packages/replay/src/coreHandlers/breadcrumbHandler.ts b/packages/replay/src/coreHandlers/breadcrumbHandler.ts index f790e28db3c1..919c46fa7ad1 100644 --- a/packages/replay/src/coreHandlers/breadcrumbHandler.ts +++ b/packages/replay/src/coreHandlers/breadcrumbHandler.ts @@ -1,7 +1,8 @@ -import { Breadcrumb, Scope } from '@sentry/types'; +import type { Breadcrumb, Scope } from '@sentry/types'; import type { InstrumentationTypeBreadcrumb } from '../types'; -import { DomHandlerData, handleDom } from './handleDom'; +import type { DomHandlerData } from './handleDom'; +import { handleDom } from './handleDom'; import { handleScope } from './handleScope'; /** diff --git a/packages/replay/src/coreHandlers/handleDom.ts b/packages/replay/src/coreHandlers/handleDom.ts index 976adf7761c7..7cc2dc684b51 100644 --- a/packages/replay/src/coreHandlers/handleDom.ts +++ b/packages/replay/src/coreHandlers/handleDom.ts @@ -1,4 +1,4 @@ -import { Breadcrumb } from '@sentry/types'; +import type { Breadcrumb } from '@sentry/types'; import { htmlTreeAsString } from '@sentry/utils'; import { record } from 'rrweb'; diff --git a/packages/replay/src/coreHandlers/handleGlobalEvent.ts b/packages/replay/src/coreHandlers/handleGlobalEvent.ts index 59a286c3a770..719391e25491 100644 --- a/packages/replay/src/coreHandlers/handleGlobalEvent.ts +++ b/packages/replay/src/coreHandlers/handleGlobalEvent.ts @@ -1,5 +1,5 @@ import { addBreadcrumb } from '@sentry/core'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { logger } from '@sentry/utils'; import { REPLAY_EVENT_NAME, UNABLE_TO_SEND_REPLAY } from '../constants'; diff --git a/packages/replay/src/coreHandlers/handleScope.ts b/packages/replay/src/coreHandlers/handleScope.ts index 429fc9d9a3bb..6b5a8157cd9c 100644 --- a/packages/replay/src/coreHandlers/handleScope.ts +++ b/packages/replay/src/coreHandlers/handleScope.ts @@ -1,4 +1,4 @@ -import { Breadcrumb, Scope } from '@sentry/types'; +import type { Breadcrumb, Scope } from '@sentry/types'; import { createBreadcrumb } from '../util/createBreadcrumb'; diff --git a/packages/replay/src/eventBuffer.ts b/packages/replay/src/eventBuffer.ts index a755ab0676e8..f953b693bc6d 100644 --- a/packages/replay/src/eventBuffer.ts +++ b/packages/replay/src/eventBuffer.ts @@ -2,7 +2,7 @@ // TODO: figure out member access types and remove the line above import { captureException } from '@sentry/core'; -import { ReplayRecordingData } from '@sentry/types'; +import type { ReplayRecordingData } from '@sentry/types'; import { logger } from '@sentry/utils'; import type { EventBuffer, RecordingEvent, WorkerRequest, WorkerResponse } from './types'; diff --git a/packages/replay/src/integration.ts b/packages/replay/src/integration.ts index 865472c1571c..a7cadab5ccfd 100644 --- a/packages/replay/src/integration.ts +++ b/packages/replay/src/integration.ts @@ -1,6 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import type { BrowserClientReplayOptions } from '@sentry/types'; -import { Integration } from '@sentry/types'; +import type { BrowserClientReplayOptions, Integration } from '@sentry/types'; import { DEFAULT_ERROR_SAMPLE_RATE, diff --git a/packages/replay/src/util/createRecordingData.ts b/packages/replay/src/util/createRecordingData.ts index 63c1db5f6e7b..a0d9835c1094 100644 --- a/packages/replay/src/util/createRecordingData.ts +++ b/packages/replay/src/util/createRecordingData.ts @@ -1,4 +1,4 @@ -import { ReplayRecordingData } from '@sentry/types'; +import type { ReplayRecordingData } from '@sentry/types'; import type { RecordedEvents } from '../types'; diff --git a/packages/replay/src/util/createReplayEnvelope.ts b/packages/replay/src/util/createReplayEnvelope.ts index 3a052f32fdd6..afc445e83d71 100644 --- a/packages/replay/src/util/createReplayEnvelope.ts +++ b/packages/replay/src/util/createReplayEnvelope.ts @@ -1,4 +1,4 @@ -import { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types'; +import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types'; import { createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader } from '@sentry/utils'; /** diff --git a/packages/replay/src/util/isRrwebError.ts b/packages/replay/src/util/isRrwebError.ts index 1607f55255ef..b706e27f97cd 100644 --- a/packages/replay/src/util/isRrwebError.ts +++ b/packages/replay/src/util/isRrwebError.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; /** * Returns true if we think the given event is an error originating inside of rrweb. diff --git a/packages/replay/src/util/monkeyPatchRecordDroppedEvent.ts b/packages/replay/src/util/monkeyPatchRecordDroppedEvent.ts index 70cf11faf450..6a819ef917b2 100644 --- a/packages/replay/src/util/monkeyPatchRecordDroppedEvent.ts +++ b/packages/replay/src/util/monkeyPatchRecordDroppedEvent.ts @@ -1,5 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import { Client, DataCategory, Event, EventDropReason } from '@sentry/types'; +import type { Client, DataCategory, Event, EventDropReason } from '@sentry/types'; let _originalRecordDroppedEvent: Client['recordDroppedEvent'] | undefined; diff --git a/packages/replay/src/util/prepareReplayEvent.ts b/packages/replay/src/util/prepareReplayEvent.ts index a7e2fd6da995..d9227f50cfca 100644 --- a/packages/replay/src/util/prepareReplayEvent.ts +++ b/packages/replay/src/util/prepareReplayEvent.ts @@ -1,5 +1,6 @@ -import { prepareEvent, Scope } from '@sentry/core'; -import { Client, ReplayEvent } from '@sentry/types'; +import type { Scope } from '@sentry/core'; +import { prepareEvent } from '@sentry/core'; +import type { Client, ReplayEvent } from '@sentry/types'; /** * Prepare a replay event & enrich it with the SDK metadata. diff --git a/packages/replay/test/fixtures/error.ts b/packages/replay/test/fixtures/error.ts index 31827cec3929..c4a0b93144ed 100644 --- a/packages/replay/test/fixtures/error.ts +++ b/packages/replay/test/fixtures/error.ts @@ -1,5 +1,5 @@ -import { SeverityLevel } from '@sentry/browser'; -import { Event } from '@sentry/types'; +import type { SeverityLevel } from '@sentry/browser'; +import type { Event } from '@sentry/types'; export function Error(obj?: Event): any { const timestamp = new Date().getTime() / 1000; diff --git a/packages/replay/test/fixtures/transaction.ts b/packages/replay/test/fixtures/transaction.ts index 37ffcc4ac49d..24f89cdc9fb8 100644 --- a/packages/replay/test/fixtures/transaction.ts +++ b/packages/replay/test/fixtures/transaction.ts @@ -1,4 +1,4 @@ -import { Event, SeverityLevel } from '@sentry/types'; +import type { Event, SeverityLevel } from '@sentry/types'; export function Transaction(obj?: Partial): any { const timestamp = new Date().getTime() / 1000; diff --git a/packages/replay/test/integration/coreHandlers/handleGlobalEvent.test.ts b/packages/replay/test/integration/coreHandlers/handleGlobalEvent.test.ts index a3d3ca17ad4f..e612d1210000 100644 --- a/packages/replay/test/integration/coreHandlers/handleGlobalEvent.test.ts +++ b/packages/replay/test/integration/coreHandlers/handleGlobalEvent.test.ts @@ -1,9 +1,9 @@ import { getCurrentHub } from '@sentry/core'; -import { Event } from '@sentry/types'; +import type { Event } from '@sentry/types'; import { REPLAY_EVENT_NAME } from '../../../src/constants'; import { handleGlobalEventListener } from '../../../src/coreHandlers/handleGlobalEvent'; -import { ReplayContainer } from '../../../src/replay'; +import type { ReplayContainer } from '../../../src/replay'; import { overwriteRecordDroppedEvent, restoreRecordDroppedEvent, diff --git a/packages/replay/test/integration/errorSampleRate.test.ts b/packages/replay/test/integration/errorSampleRate.test.ts index c8a7237a7951..2730560093a4 100644 --- a/packages/replay/test/integration/errorSampleRate.test.ts +++ b/packages/replay/test/integration/errorSampleRate.test.ts @@ -1,12 +1,13 @@ import { captureException } from '@sentry/core'; import { DEFAULT_FLUSH_MIN_DELAY, REPLAY_SESSION_KEY, VISIBILITY_CHANGE_TIMEOUT, WINDOW } from '../../src/constants'; -import { ReplayContainer } from '../../src/replay'; +import type { ReplayContainer } from '../../src/replay'; import { addEvent } from '../../src/util/addEvent'; import { PerformanceEntryResource } from '../fixtures/performanceEntry/resource'; -import { BASE_TIMESTAMP, RecordMock } from '../index'; +import type { RecordMock } from '../index'; +import { BASE_TIMESTAMP } from '../index'; import { resetSdkMock } from '../mocks/resetSdkMock'; -import { DomHandler } from '../types'; +import type { DomHandler } from '../types'; import { clearSession } from '../utils/clearSession'; import { useFakeTimers } from '../utils/use-fake-timers'; diff --git a/packages/replay/test/integration/eventProcessors.test.ts b/packages/replay/test/integration/eventProcessors.test.ts index 5b4d96077f08..363c5f2d5a74 100644 --- a/packages/replay/test/integration/eventProcessors.test.ts +++ b/packages/replay/test/integration/eventProcessors.test.ts @@ -1,5 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import { Event, Hub, Scope } from '@sentry/types'; +import type { Event, Hub, Scope } from '@sentry/types'; import { BASE_TIMESTAMP } from '..'; import { resetSdkMock } from '../mocks/resetSdkMock'; diff --git a/packages/replay/test/integration/events.test.ts b/packages/replay/test/integration/events.test.ts index e2770101d395..ed74b6978fe6 100644 --- a/packages/replay/test/integration/events.test.ts +++ b/packages/replay/test/integration/events.test.ts @@ -1,10 +1,11 @@ import { getCurrentHub } from '@sentry/core'; import { WINDOW } from '../../src/constants'; -import { ReplayContainer } from '../../src/replay'; +import type { ReplayContainer } from '../../src/replay'; import { addEvent } from '../../src/util/addEvent'; import { PerformanceEntryResource } from '../fixtures/performanceEntry/resource'; -import { BASE_TIMESTAMP, RecordMock } from '../index'; +import type { RecordMock } from '../index'; +import { BASE_TIMESTAMP } from '../index'; import { resetSdkMock } from '../mocks/resetSdkMock'; import { clearSession } from '../utils/clearSession'; import { useFakeTimers } from '../utils/use-fake-timers'; diff --git a/packages/replay/test/integration/flush.test.ts b/packages/replay/test/integration/flush.test.ts index c43729d79de1..8865aee30705 100644 --- a/packages/replay/test/integration/flush.test.ts +++ b/packages/replay/test/integration/flush.test.ts @@ -1,7 +1,7 @@ import * as SentryUtils from '@sentry/utils'; import { DEFAULT_FLUSH_MIN_DELAY, SESSION_IDLE_DURATION, WINDOW } from '../../src/constants'; -import { ReplayContainer } from '../../src/replay'; +import type { ReplayContainer } from '../../src/replay'; import * as AddMemoryEntry from '../../src/util/addMemoryEntry'; import { createPerformanceEntries } from '../../src/util/createPerformanceEntries'; import { createPerformanceSpans } from '../../src/util/createPerformanceSpans'; diff --git a/packages/replay/test/integration/sendReplayEvent.test.ts b/packages/replay/test/integration/sendReplayEvent.test.ts index 1701a0a48826..1f747723a11d 100644 --- a/packages/replay/test/integration/sendReplayEvent.test.ts +++ b/packages/replay/test/integration/sendReplayEvent.test.ts @@ -1,9 +1,9 @@ import { getCurrentHub } from '@sentry/core'; -import { Transport } from '@sentry/types'; +import type { Transport } from '@sentry/types'; import * as SentryUtils from '@sentry/utils'; import { DEFAULT_FLUSH_MIN_DELAY, SESSION_IDLE_DURATION, WINDOW } from '../../src/constants'; -import { ReplayContainer } from '../../src/replay'; +import type { ReplayContainer } from '../../src/replay'; import { addEvent } from '../../src/util/addEvent'; import { BASE_TIMESTAMP, mockRrweb, mockSdk } from '../index'; import { clearSession } from '../utils/clearSession'; diff --git a/packages/replay/test/integration/session.test.ts b/packages/replay/test/integration/session.test.ts index 61b08e292582..46ef58622372 100644 --- a/packages/replay/test/integration/session.test.ts +++ b/packages/replay/test/integration/session.test.ts @@ -1,5 +1,5 @@ import { getCurrentHub } from '@sentry/core'; -import { Transport } from '@sentry/types'; +import type { Transport } from '@sentry/types'; import { DEFAULT_FLUSH_MIN_DELAY, @@ -8,11 +8,11 @@ import { VISIBILITY_CHANGE_TIMEOUT, WINDOW, } from '../../src/constants'; -import { ReplayContainer } from '../../src/replay'; +import type { ReplayContainer } from '../../src/replay'; import { addEvent } from '../../src/util/addEvent'; import { createPerformanceSpans } from '../../src/util/createPerformanceSpans'; import { BASE_TIMESTAMP } from '../index'; -import { RecordMock } from '../mocks/mockRrweb'; +import type { RecordMock } from '../mocks/mockRrweb'; import { resetSdkMock } from '../mocks/resetSdkMock'; import { clearSession } from '../utils/clearSession'; import { useFakeTimers } from '../utils/use-fake-timers'; diff --git a/packages/replay/test/integration/stop.test.ts b/packages/replay/test/integration/stop.test.ts index 46c43e8afea5..189156abe015 100644 --- a/packages/replay/test/integration/stop.test.ts +++ b/packages/replay/test/integration/stop.test.ts @@ -1,8 +1,8 @@ import * as SentryUtils from '@sentry/utils'; -import { Replay } from '../../src'; +import type { Replay } from '../../src'; import { SESSION_IDLE_DURATION, WINDOW } from '../../src/constants'; -import { ReplayContainer } from '../../src/replay'; +import type { ReplayContainer } from '../../src/replay'; import { addEvent } from '../../src/util/addEvent'; // mock functions need to be imported first import { BASE_TIMESTAMP, mockRrweb, mockSdk } from '../index'; diff --git a/packages/replay/test/mocks/mockSdk.ts b/packages/replay/test/mocks/mockSdk.ts index 159627e656a2..d81d2820a9e3 100644 --- a/packages/replay/test/mocks/mockSdk.ts +++ b/packages/replay/test/mocks/mockSdk.ts @@ -1,8 +1,9 @@ -import { BrowserOptions, init } from '@sentry/browser'; -import { Envelope, Transport } from '@sentry/types'; +import type { BrowserOptions } from '@sentry/browser'; +import { init } from '@sentry/browser'; +import type { Envelope, Transport } from '@sentry/types'; -import { Replay as ReplayIntegration } from '../../src'; -import { ReplayContainer } from '../../src/replay'; +import type { Replay as ReplayIntegration } from '../../src'; +import type { ReplayContainer } from '../../src/replay'; import type { ReplayConfiguration } from '../../src/types'; export interface MockSdkParams { diff --git a/packages/replay/test/mocks/resetSdkMock.ts b/packages/replay/test/mocks/resetSdkMock.ts index f2104975045c..24d90678f400 100644 --- a/packages/replay/test/mocks/resetSdkMock.ts +++ b/packages/replay/test/mocks/resetSdkMock.ts @@ -1,7 +1,9 @@ import type { ReplayContainer } from '../../src/replay'; -import { BASE_TIMESTAMP, RecordMock } from './../index'; +import type { RecordMock } from './../index'; +import { BASE_TIMESTAMP } from './../index'; import type { DomHandler } from './../types'; -import { mockSdk, MockSdkParams } from './mockSdk'; +import type { MockSdkParams } from './mockSdk'; +import { mockSdk } from './mockSdk'; export async function resetSdkMock({ replayOptions, sentryOptions }: MockSdkParams): Promise<{ domHandler: DomHandler; diff --git a/packages/replay/test/unit/eventBuffer.test.ts b/packages/replay/test/unit/eventBuffer.test.ts index ac5a3be70183..a4a319da68bd 100644 --- a/packages/replay/test/unit/eventBuffer.test.ts +++ b/packages/replay/test/unit/eventBuffer.test.ts @@ -2,7 +2,8 @@ import 'jsdom-worker'; import pako from 'pako'; -import { createEventBuffer, EventBufferCompressionWorker } from './../../src/eventBuffer'; +import type { EventBufferCompressionWorker } from './../../src/eventBuffer'; +import { createEventBuffer } from './../../src/eventBuffer'; import { BASE_TIMESTAMP } from './../index'; const TEST_EVENT = { data: {}, timestamp: BASE_TIMESTAMP, type: 3 }; diff --git a/packages/replay/test/unit/util/createReplayEnvelope.test.ts b/packages/replay/test/unit/util/createReplayEnvelope.test.ts index d5c5f2e5b75f..7de41649147b 100644 --- a/packages/replay/test/unit/util/createReplayEnvelope.test.ts +++ b/packages/replay/test/unit/util/createReplayEnvelope.test.ts @@ -1,4 +1,4 @@ -import { ReplayEvent } from '@sentry/types'; +import type { ReplayEvent } from '@sentry/types'; import { makeDsn } from '@sentry/utils'; import { createReplayEnvelope } from '../../../src/util/createReplayEnvelope'; diff --git a/packages/replay/test/unit/util/getReplayEvent.test.ts b/packages/replay/test/unit/util/getReplayEvent.test.ts index f9f6dcdfc79e..49bb832206c6 100644 --- a/packages/replay/test/unit/util/getReplayEvent.test.ts +++ b/packages/replay/test/unit/util/getReplayEvent.test.ts @@ -1,6 +1,7 @@ import { BrowserClient } from '@sentry/browser'; -import { getCurrentHub, Hub, Scope } from '@sentry/core'; -import { Client, ReplayEvent } from '@sentry/types'; +import type { Hub, Scope } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { Client, ReplayEvent } from '@sentry/types'; import { REPLAY_EVENT_NAME } from '../../../src/constants'; import { prepareReplayEvent } from '../../../src/util/prepareReplayEvent'; diff --git a/packages/replay/test/unit/util/prepareReplayEvent.test.ts b/packages/replay/test/unit/util/prepareReplayEvent.test.ts index 1213548cddb2..899a2ec5b35f 100644 --- a/packages/replay/test/unit/util/prepareReplayEvent.test.ts +++ b/packages/replay/test/unit/util/prepareReplayEvent.test.ts @@ -1,6 +1,7 @@ import { BrowserClient } from '@sentry/browser'; -import { getCurrentHub, Hub, Scope } from '@sentry/core'; -import { Client, ReplayEvent } from '@sentry/types'; +import type { Hub, Scope } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { Client, ReplayEvent } from '@sentry/types'; import { REPLAY_EVENT_NAME } from '../../../src/constants'; import { prepareReplayEvent } from '../../../src/util/prepareReplayEvent'; diff --git a/packages/replay/test/utils/clearSession.ts b/packages/replay/test/utils/clearSession.ts index cb9c44b62493..b5b64ac04531 100644 --- a/packages/replay/test/utils/clearSession.ts +++ b/packages/replay/test/utils/clearSession.ts @@ -1,5 +1,5 @@ import { REPLAY_SESSION_KEY, WINDOW } from '../../src/constants'; -import { ReplayContainer } from '../../src/types'; +import type { ReplayContainer } from '../../src/types'; export function clearSession(replay: ReplayContainer) { deleteSession(); diff --git a/packages/replay/test/utils/getDefaultBrowserClientOptions.ts b/packages/replay/test/utils/getDefaultBrowserClientOptions.ts index 74aafee7a1b3..63ad424b6202 100644 --- a/packages/replay/test/utils/getDefaultBrowserClientOptions.ts +++ b/packages/replay/test/utils/getDefaultBrowserClientOptions.ts @@ -1,5 +1,5 @@ import { createTransport } from '@sentry/core'; -import { ClientOptions } from '@sentry/types'; +import type { ClientOptions } from '@sentry/types'; import { resolvedSyncPromise } from '@sentry/utils'; export function getDefaultBrowserClientOptions(options: Partial = {}): ClientOptions { diff --git a/packages/serverless/src/awslambda.ts b/packages/serverless/src/awslambda.ts index 18b9ea2387d4..29dd10da6602 100644 --- a/packages/serverless/src/awslambda.ts +++ b/packages/serverless/src/awslambda.ts @@ -1,12 +1,13 @@ /* eslint-disable max-lines */ +import type { Scope } from '@sentry/node'; import * as Sentry from '@sentry/node'; -import { captureException, captureMessage, flush, getCurrentHub, Scope, withScope } from '@sentry/node'; +import { captureException, captureMessage, flush, getCurrentHub, withScope } from '@sentry/node'; import { extractTraceparentData } from '@sentry/tracing'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { baggageHeaderToDynamicSamplingContext, dsnFromString, dsnToString, isString, logger } from '@sentry/utils'; // NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil // eslint-disable-next-line import/no-unresolved -import { Context, Handler } from 'aws-lambda'; +import type { Context, Handler } from 'aws-lambda'; import { existsSync } from 'fs'; import { hostname } from 'os'; import { basename, resolve } from 'path'; diff --git a/packages/serverless/src/awsservices.ts b/packages/serverless/src/awsservices.ts index 66b2ea93c52d..431d0653ee69 100644 --- a/packages/serverless/src/awsservices.ts +++ b/packages/serverless/src/awsservices.ts @@ -1,9 +1,9 @@ import { getCurrentHub } from '@sentry/node'; -import { Integration, Span, Transaction } from '@sentry/types'; +import type { Integration, Span, Transaction } from '@sentry/types'; import { fill } from '@sentry/utils'; // 'aws-sdk/global' import is expected to be type-only so it's erased in the final .js file. // When TypeScript compiler is upgraded, use `import type` syntax to explicitly assert that we don't want to load a module here. -import * as AWS from 'aws-sdk/global'; +import type * as AWS from 'aws-sdk/global'; type GenericParams = { [key: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any type MakeRequestCallback = (err: AWS.AWSError, data: TResult) => void; diff --git a/packages/serverless/src/gcpfunction/cloud_events.ts b/packages/serverless/src/gcpfunction/cloud_events.ts index 6ab7b173784c..00088687bec6 100644 --- a/packages/serverless/src/gcpfunction/cloud_events.ts +++ b/packages/serverless/src/gcpfunction/cloud_events.ts @@ -2,7 +2,7 @@ import { captureException, flush, getCurrentHub } from '@sentry/node'; import { logger } from '@sentry/utils'; import { domainify, getActiveDomain, proxyFunction } from '../utils'; -import { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general'; +import type { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general'; export type CloudEventFunctionWrapperOptions = WrapperOptions; diff --git a/packages/serverless/src/gcpfunction/events.ts b/packages/serverless/src/gcpfunction/events.ts index 6b83fd8bfba0..f1ad73379ca1 100644 --- a/packages/serverless/src/gcpfunction/events.ts +++ b/packages/serverless/src/gcpfunction/events.ts @@ -2,7 +2,7 @@ import { captureException, flush, getCurrentHub } from '@sentry/node'; import { logger } from '@sentry/utils'; import { domainify, getActiveDomain, proxyFunction } from '../utils'; -import { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general'; +import type { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general'; export type EventFunctionWrapperOptions = WrapperOptions; diff --git a/packages/serverless/src/gcpfunction/http.ts b/packages/serverless/src/gcpfunction/http.ts index 3b62d8301bf1..6636ccdab3d6 100644 --- a/packages/serverless/src/gcpfunction/http.ts +++ b/packages/serverless/src/gcpfunction/http.ts @@ -1,9 +1,10 @@ -import { AddRequestDataToEventOptions, captureException, flush, getCurrentHub } from '@sentry/node'; +import type { AddRequestDataToEventOptions } from '@sentry/node'; +import { captureException, flush, getCurrentHub } from '@sentry/node'; import { extractTraceparentData } from '@sentry/tracing'; import { baggageHeaderToDynamicSamplingContext, isString, logger, stripUrlQueryAndFragment } from '@sentry/utils'; import { domainify, getActiveDomain, proxyFunction } from './../utils'; -import { HttpFunction, WrapperOptions } from './general'; +import type { HttpFunction, WrapperOptions } from './general'; // TODO (v8 / #5257): Remove this whole old/new business and just use the new stuff type ParseRequestOptions = AddRequestDataToEventOptions['include'] & { diff --git a/packages/serverless/src/gcpfunction/index.ts b/packages/serverless/src/gcpfunction/index.ts index 2cd8a0bec73f..12e912d45b77 100644 --- a/packages/serverless/src/gcpfunction/index.ts +++ b/packages/serverless/src/gcpfunction/index.ts @@ -1,5 +1,5 @@ import * as Sentry from '@sentry/node'; -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; import { GoogleCloudGrpc } from '../google-cloud-grpc'; import { GoogleCloudHttp } from '../google-cloud-http'; diff --git a/packages/serverless/src/google-cloud-grpc.ts b/packages/serverless/src/google-cloud-grpc.ts index 4037877cb3bc..f18aee42e002 100644 --- a/packages/serverless/src/google-cloud-grpc.ts +++ b/packages/serverless/src/google-cloud-grpc.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '@sentry/node'; -import { Integration, Span, Transaction } from '@sentry/types'; +import type { Integration, Span, Transaction } from '@sentry/types'; import { fill } from '@sentry/utils'; -import { EventEmitter } from 'events'; +import type { EventEmitter } from 'events'; interface GrpcFunction extends CallableFunction { (...args: unknown[]): EventEmitter; diff --git a/packages/serverless/src/google-cloud-http.ts b/packages/serverless/src/google-cloud-http.ts index 81b8d6a69155..04dec4bbe134 100644 --- a/packages/serverless/src/google-cloud-http.ts +++ b/packages/serverless/src/google-cloud-http.ts @@ -1,8 +1,8 @@ // '@google-cloud/common' import is expected to be type-only so it's erased in the final .js file. // When TypeScript compiler is upgraded, use `import type` syntax to explicitly assert that we don't want to load a module here. -import * as common from '@google-cloud/common'; +import type * as common from '@google-cloud/common'; import { getCurrentHub } from '@sentry/node'; -import { Integration, Span, Transaction } from '@sentry/types'; +import type { Integration, Span, Transaction } from '@sentry/types'; import { fill } from '@sentry/utils'; type RequestOptions = common.DecorateRequestOptions; diff --git a/packages/serverless/src/utils.ts b/packages/serverless/src/utils.ts index 0fc9a1a776aa..38e85c6a1c4e 100644 --- a/packages/serverless/src/utils.ts +++ b/packages/serverless/src/utils.ts @@ -1,4 +1,4 @@ -import { Event } from '@sentry/node'; +import type { Event } from '@sentry/node'; import { addExceptionMechanism } from '@sentry/utils'; import * as domain from 'domain'; diff --git a/packages/serverless/test/awslambda.test.ts b/packages/serverless/test/awslambda.test.ts index 419974e73bfe..36b3ed5626e6 100644 --- a/packages/serverless/test/awslambda.test.ts +++ b/packages/serverless/test/awslambda.test.ts @@ -1,6 +1,6 @@ // NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil // eslint-disable-next-line import/no-unresolved -import { Callback, Handler } from 'aws-lambda'; +import type { Callback, Handler } from 'aws-lambda'; import * as Sentry from '../src'; diff --git a/packages/serverless/test/gcpfunction.test.ts b/packages/serverless/test/gcpfunction.test.ts index 20f878565a56..a6a58ebb2d8b 100644 --- a/packages/serverless/test/gcpfunction.test.ts +++ b/packages/serverless/test/gcpfunction.test.ts @@ -3,7 +3,7 @@ import * as domain from 'domain'; import * as Sentry from '../src'; import { wrapCloudEventFunction, wrapEventFunction, wrapHttpFunction } from '../src/gcpfunction'; -import { +import type { CloudEventFunction, CloudEventFunctionWithCallback, EventFunction, diff --git a/packages/svelte/src/config.ts b/packages/svelte/src/config.ts index 03c6c0dc1f01..4a62cecfbed5 100644 --- a/packages/svelte/src/config.ts +++ b/packages/svelte/src/config.ts @@ -1,7 +1,7 @@ -import { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; +import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; import { componentTrackingPreprocessor, defaultComponentTrackingOptions } from './preprocessors'; -import { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from './types'; +import type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from './types'; const DEFAULT_SENTRY_OPTIONS: SentrySvelteConfigOptions = { componentTracking: defaultComponentTrackingOptions, diff --git a/packages/svelte/src/performance.ts b/packages/svelte/src/performance.ts index 359950e41264..5cb9e0254557 100644 --- a/packages/svelte/src/performance.ts +++ b/packages/svelte/src/performance.ts @@ -1,10 +1,10 @@ import { getCurrentHub } from '@sentry/browser'; -import { Span, Transaction } from '@sentry/types'; +import type { Span, Transaction } from '@sentry/types'; import { afterUpdate, beforeUpdate, onMount } from 'svelte'; import { current_component } from 'svelte/internal'; import { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants'; -import { TrackComponentOptions } from './types'; +import type { TrackComponentOptions } from './types'; const defaultTrackComponentOptions: { trackInit: boolean; diff --git a/packages/svelte/src/preprocessors.ts b/packages/svelte/src/preprocessors.ts index 49f8346aa47d..57722b1dad15 100644 --- a/packages/svelte/src/preprocessors.ts +++ b/packages/svelte/src/preprocessors.ts @@ -1,7 +1,7 @@ import MagicString from 'magic-string'; -import { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; +import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; -import { ComponentTrackingInitOptions, SentryPreprocessorGroup, TrackComponentOptions } from './types'; +import type { ComponentTrackingInitOptions, SentryPreprocessorGroup, TrackComponentOptions } from './types'; export const defaultComponentTrackingOptions: Required = { trackComponents: true, diff --git a/packages/svelte/src/sdk.ts b/packages/svelte/src/sdk.ts index 4857163ec137..448ccacbf046 100644 --- a/packages/svelte/src/sdk.ts +++ b/packages/svelte/src/sdk.ts @@ -1,4 +1,5 @@ -import { addGlobalEventProcessor, BrowserOptions, init as browserInit, SDK_VERSION } from '@sentry/browser'; +import type { BrowserOptions } from '@sentry/browser'; +import { addGlobalEventProcessor, init as browserInit, SDK_VERSION } from '@sentry/browser'; import type { EventProcessor } from '@sentry/types'; import { getDomElement } from '@sentry/utils'; /** diff --git a/packages/svelte/src/types.ts b/packages/svelte/src/types.ts index e601b239667d..4f4516606483 100644 --- a/packages/svelte/src/types.ts +++ b/packages/svelte/src/types.ts @@ -1,5 +1,5 @@ -import { CompileOptions } from 'svelte/types/compiler'; -import { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; +import type { CompileOptions } from 'svelte/types/compiler'; +import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; // Adds an id property to the preprocessor object we can use to check for duplication // in the preprocessors array diff --git a/packages/svelte/test/config.test.ts b/packages/svelte/test/config.test.ts index db8a699b5ab7..5e33355a4994 100644 --- a/packages/svelte/test/config.test.ts +++ b/packages/svelte/test/config.test.ts @@ -1,6 +1,6 @@ import { withSentryConfig } from '../src/config'; import { componentTrackingPreprocessor, FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID } from '../src/preprocessors'; -import { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from '../src/types'; +import type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from '../src/types'; describe('withSentryConfig', () => { it.each([ diff --git a/packages/svelte/test/performance.test.ts b/packages/svelte/test/performance.test.ts index cb039870a719..cbfd320f35bd 100644 --- a/packages/svelte/test/performance.test.ts +++ b/packages/svelte/test/performance.test.ts @@ -1,4 +1,4 @@ -import { Scope } from '@sentry/core'; +import type { Scope } from '@sentry/core'; import { act, render } from '@testing-library/svelte'; // linter doesn't like Svelte component imports diff --git a/packages/svelte/test/preprocessors.test.ts b/packages/svelte/test/preprocessors.test.ts index dd3d3cff1130..57a235ce4cfd 100644 --- a/packages/svelte/test/preprocessors.test.ts +++ b/packages/svelte/test/preprocessors.test.ts @@ -6,7 +6,7 @@ import { defaultComponentTrackingOptions, FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID, } from '../src/preprocessors'; -import { SentryPreprocessorGroup } from '../src/types'; +import type { SentryPreprocessorGroup } from '../src/types'; function expectComponentCodeToBeModified( preprocessedComponents: { diff --git a/packages/svelte/test/sdk.test.ts b/packages/svelte/test/sdk.test.ts index a716cb35105e..8203b025a437 100644 --- a/packages/svelte/test/sdk.test.ts +++ b/packages/svelte/test/sdk.test.ts @@ -1,5 +1,5 @@ import { addGlobalEventProcessor, init as browserInit, SDK_VERSION } from '@sentry/browser'; -import { EventProcessor } from '@sentry/types'; +import type { EventProcessor } from '@sentry/types'; import { detectAndReportSvelteKit, init as svelteInit, isSvelteKitApp } from '../src/sdk'; diff --git a/packages/tracing/src/browser/backgroundtab.ts b/packages/tracing/src/browser/backgroundtab.ts index 62df53a9c9b9..8c55e9853901 100644 --- a/packages/tracing/src/browser/backgroundtab.ts +++ b/packages/tracing/src/browser/backgroundtab.ts @@ -1,7 +1,7 @@ import { logger } from '@sentry/utils'; -import { IdleTransaction } from '../idletransaction'; -import { SpanStatusType } from '../span'; +import type { IdleTransaction } from '../idletransaction'; +import type { SpanStatusType } from '../span'; import { getActiveTransaction } from '../utils'; import { WINDOW } from './types'; diff --git a/packages/tracing/src/browser/browsertracing.ts b/packages/tracing/src/browser/browsertracing.ts index c9ca077fb179..df275bc7357d 100644 --- a/packages/tracing/src/browser/browsertracing.ts +++ b/packages/tracing/src/browser/browsertracing.ts @@ -1,23 +1,16 @@ /* eslint-disable max-lines */ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; import { baggageHeaderToDynamicSamplingContext, getDomElement, logger } from '@sentry/utils'; import { startIdleTransaction } from '../hubextensions'; -import { - DEFAULT_FINAL_TIMEOUT, - DEFAULT_HEARTBEAT_INTERVAL, - DEFAULT_IDLE_TIMEOUT, - IdleTransaction, -} from '../idletransaction'; +import type { IdleTransaction } from '../idletransaction'; +import { DEFAULT_FINAL_TIMEOUT, DEFAULT_HEARTBEAT_INTERVAL, DEFAULT_IDLE_TIMEOUT } from '../idletransaction'; import { extractTraceparentData } from '../utils'; import { registerBackgroundTabDetection } from './backgroundtab'; import { addPerformanceEntries, startTrackingLongTasks, startTrackingWebVitals } from './metrics'; -import { - defaultRequestInstrumentationOptions, - instrumentOutgoingRequests, - RequestInstrumentationOptions, -} from './request'; +import type { RequestInstrumentationOptions } from './request'; +import { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request'; import { instrumentRoutingWithDefaults } from './router'; import { WINDOW } from './types'; diff --git a/packages/tracing/src/browser/metrics/index.ts b/packages/tracing/src/browser/metrics/index.ts index 481a6ea59d83..7bd575e90024 100644 --- a/packages/tracing/src/browser/metrics/index.ts +++ b/packages/tracing/src/browser/metrics/index.ts @@ -1,9 +1,9 @@ /* eslint-disable max-lines */ -import { Measurements } from '@sentry/types'; +import type { Measurements } from '@sentry/types'; import { browserPerformanceTimeOrigin, htmlTreeAsString, logger } from '@sentry/utils'; -import { IdleTransaction } from '../../idletransaction'; -import { Transaction } from '../../transaction'; +import type { IdleTransaction } from '../../idletransaction'; +import type { Transaction } from '../../transaction'; import { getActiveTransaction, msToSec } from '../../utils'; import { WINDOW } from '../types'; import { onCLS } from '../web-vitals/getCLS'; @@ -11,7 +11,7 @@ import { onFID } from '../web-vitals/getFID'; import { onLCP } from '../web-vitals/getLCP'; import { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher'; import { observe } from '../web-vitals/lib/observe'; -import { NavigatorDeviceMemory, NavigatorNetworkInformation } from '../web-vitals/types'; +import type { NavigatorDeviceMemory, NavigatorNetworkInformation } from '../web-vitals/types'; import { _startChild, isMeasurementValue } from './utils'; function getBrowserPerformanceAPI(): Performance | undefined { diff --git a/packages/tracing/src/browser/metrics/utils.ts b/packages/tracing/src/browser/metrics/utils.ts index 4894dbd3ec8e..7c30a9090245 100644 --- a/packages/tracing/src/browser/metrics/utils.ts +++ b/packages/tracing/src/browser/metrics/utils.ts @@ -1,6 +1,6 @@ -import { Span, SpanContext } from '@sentry/types'; +import type { Span, SpanContext } from '@sentry/types'; -import { Transaction } from '../../transaction'; +import type { Transaction } from '../../transaction'; /** * Checks if a given value is a valid measurement value. diff --git a/packages/tracing/src/browser/router.ts b/packages/tracing/src/browser/router.ts index f0b50a0d014a..b66fdee30e9d 100644 --- a/packages/tracing/src/browser/router.ts +++ b/packages/tracing/src/browser/router.ts @@ -1,4 +1,4 @@ -import { Transaction, TransactionContext } from '@sentry/types'; +import type { Transaction, TransactionContext } from '@sentry/types'; import { addInstrumentationHandler, logger } from '@sentry/utils'; import { WINDOW } from './types'; diff --git a/packages/tracing/src/browser/web-vitals/getCLS.ts b/packages/tracing/src/browser/web-vitals/getCLS.ts index 0980eb5cf06d..3abddfac07cb 100644 --- a/packages/tracing/src/browser/web-vitals/getCLS.ts +++ b/packages/tracing/src/browser/web-vitals/getCLS.ts @@ -18,7 +18,7 @@ import { bindReporter } from './lib/bindReporter'; import { initMetric } from './lib/initMetric'; import { observe } from './lib/observe'; import { onHidden } from './lib/onHidden'; -import { CLSMetric, ReportCallback } from './types'; +import type { CLSMetric, ReportCallback } from './types'; /** * Calculates the [CLS](https://web.dev/cls/) value for the current page and diff --git a/packages/tracing/src/browser/web-vitals/getFID.ts b/packages/tracing/src/browser/web-vitals/getFID.ts index fcf5d529669c..fd19e112121a 100644 --- a/packages/tracing/src/browser/web-vitals/getFID.ts +++ b/packages/tracing/src/browser/web-vitals/getFID.ts @@ -19,7 +19,7 @@ import { getVisibilityWatcher } from './lib/getVisibilityWatcher'; import { initMetric } from './lib/initMetric'; import { observe } from './lib/observe'; import { onHidden } from './lib/onHidden'; -import { FIDMetric, PerformanceEventTiming, ReportCallback } from './types'; +import type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types'; /** * Calculates the [FID](https://web.dev/fid/) value for the current page and diff --git a/packages/tracing/src/browser/web-vitals/getLCP.ts b/packages/tracing/src/browser/web-vitals/getLCP.ts index 01ddb2465ebc..bf834c07ce4e 100644 --- a/packages/tracing/src/browser/web-vitals/getLCP.ts +++ b/packages/tracing/src/browser/web-vitals/getLCP.ts @@ -20,7 +20,7 @@ import { getVisibilityWatcher } from './lib/getVisibilityWatcher'; import { initMetric } from './lib/initMetric'; import { observe } from './lib/observe'; import { onHidden } from './lib/onHidden'; -import { LCPMetric, ReportCallback } from './types'; +import type { LCPMetric, ReportCallback } from './types'; const reportedMetricIDs: Record = {}; diff --git a/packages/tracing/src/browser/web-vitals/lib/bindReporter.ts b/packages/tracing/src/browser/web-vitals/lib/bindReporter.ts index 6e304d747c95..79f3f874e2d8 100644 --- a/packages/tracing/src/browser/web-vitals/lib/bindReporter.ts +++ b/packages/tracing/src/browser/web-vitals/lib/bindReporter.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Metric, ReportCallback } from '../types'; +import type { Metric, ReportCallback } from '../types'; export const bindReporter = ( callback: ReportCallback, diff --git a/packages/tracing/src/browser/web-vitals/lib/getNavigationEntry.ts b/packages/tracing/src/browser/web-vitals/lib/getNavigationEntry.ts index a639eee2bb88..9aaa8939b6dc 100644 --- a/packages/tracing/src/browser/web-vitals/lib/getNavigationEntry.ts +++ b/packages/tracing/src/browser/web-vitals/lib/getNavigationEntry.ts @@ -15,7 +15,7 @@ */ import { WINDOW } from '../../types'; -import { NavigationTimingPolyfillEntry } from '../types'; +import type { NavigationTimingPolyfillEntry } from '../types'; const getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => { // eslint-disable-next-line deprecation/deprecation diff --git a/packages/tracing/src/browser/web-vitals/lib/initMetric.ts b/packages/tracing/src/browser/web-vitals/lib/initMetric.ts index c486dac6b24d..2fa5854fd6db 100644 --- a/packages/tracing/src/browser/web-vitals/lib/initMetric.ts +++ b/packages/tracing/src/browser/web-vitals/lib/initMetric.ts @@ -15,7 +15,7 @@ */ import { WINDOW } from '../../types'; -import { Metric } from '../types'; +import type { Metric } from '../types'; import { generateUniqueID } from './generateUniqueID'; import { getActivationStart } from './getActivationStart'; import { getNavigationEntry } from './getNavigationEntry'; diff --git a/packages/tracing/src/browser/web-vitals/lib/observe.ts b/packages/tracing/src/browser/web-vitals/lib/observe.ts index d3f6a0f14153..685105d5c7dc 100644 --- a/packages/tracing/src/browser/web-vitals/lib/observe.ts +++ b/packages/tracing/src/browser/web-vitals/lib/observe.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types'; +import type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types'; export interface PerformanceEntryHandler { (entry: PerformanceEntry): void; diff --git a/packages/tracing/src/browser/web-vitals/types.ts b/packages/tracing/src/browser/web-vitals/types.ts index c78152748f97..ef8de70c12bb 100644 --- a/packages/tracing/src/browser/web-vitals/types.ts +++ b/packages/tracing/src/browser/web-vitals/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { FirstInputPolyfillCallback } from './types/polyfills'; +import type { FirstInputPolyfillCallback } from './types/polyfills'; export * from './types/base'; export * from './types/polyfills'; diff --git a/packages/tracing/src/browser/web-vitals/types/base.ts b/packages/tracing/src/browser/web-vitals/types/base.ts index 5194a8fd623b..5dc45f00558d 100644 --- a/packages/tracing/src/browser/web-vitals/types/base.ts +++ b/packages/tracing/src/browser/web-vitals/types/base.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry } from './polyfills'; +import type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry } from './polyfills'; export interface Metric { /** diff --git a/packages/tracing/src/browser/web-vitals/types/cls.ts b/packages/tracing/src/browser/web-vitals/types/cls.ts index c4252dc31916..0c97a5dde9aa 100644 --- a/packages/tracing/src/browser/web-vitals/types/cls.ts +++ b/packages/tracing/src/browser/web-vitals/types/cls.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { LoadState, Metric, ReportCallback } from './base'; +import type { LoadState, Metric, ReportCallback } from './base'; /** * A CLS-specific version of the Metric object. diff --git a/packages/tracing/src/browser/web-vitals/types/fid.ts b/packages/tracing/src/browser/web-vitals/types/fid.ts index 324c7e25ff66..926f0675b90a 100644 --- a/packages/tracing/src/browser/web-vitals/types/fid.ts +++ b/packages/tracing/src/browser/web-vitals/types/fid.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { LoadState, Metric, ReportCallback } from './base'; -import { FirstInputPolyfillEntry } from './polyfills'; +import type { LoadState, Metric, ReportCallback } from './base'; +import type { FirstInputPolyfillEntry } from './polyfills'; /** * An FID-specific version of the Metric object. diff --git a/packages/tracing/src/browser/web-vitals/types/lcp.ts b/packages/tracing/src/browser/web-vitals/types/lcp.ts index 841ddca1e6de..c94573c1caaf 100644 --- a/packages/tracing/src/browser/web-vitals/types/lcp.ts +++ b/packages/tracing/src/browser/web-vitals/types/lcp.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { Metric, ReportCallback } from './base'; -import { NavigationTimingPolyfillEntry } from './polyfills'; +import type { Metric, ReportCallback } from './base'; +import type { NavigationTimingPolyfillEntry } from './polyfills'; /** * An LCP-specific version of the Metric object. diff --git a/packages/tracing/src/errors.ts b/packages/tracing/src/errors.ts index 5a406500ffee..1952fb75a915 100644 --- a/packages/tracing/src/errors.ts +++ b/packages/tracing/src/errors.ts @@ -1,6 +1,6 @@ import { addInstrumentationHandler, logger } from '@sentry/utils'; -import { SpanStatusType } from './span'; +import type { SpanStatusType } from './span'; import { getActiveTransaction } from './utils'; /** diff --git a/packages/tracing/src/hubextensions.ts b/packages/tracing/src/hubextensions.ts index c3cc2967be9d..9514cb00b321 100644 --- a/packages/tracing/src/hubextensions.ts +++ b/packages/tracing/src/hubextensions.ts @@ -1,5 +1,6 @@ -import { getMainCarrier, Hub } from '@sentry/core'; -import { +import type { Hub } from '@sentry/core'; +import { getMainCarrier } from '@sentry/core'; +import type { ClientOptions, CustomSamplingContext, Integration, diff --git a/packages/tracing/src/idletransaction.ts b/packages/tracing/src/idletransaction.ts index f509ff931a45..395b116481b1 100644 --- a/packages/tracing/src/idletransaction.ts +++ b/packages/tracing/src/idletransaction.ts @@ -1,9 +1,10 @@ /* eslint-disable max-lines */ -import { Hub } from '@sentry/core'; -import { TransactionContext } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { TransactionContext } from '@sentry/types'; import { logger, timestampWithMs } from '@sentry/utils'; -import { Span, SpanRecorder } from './span'; +import type { Span } from './span'; +import { SpanRecorder } from './span'; import { Transaction } from './transaction'; export const DEFAULT_IDLE_TIMEOUT = 1000; diff --git a/packages/tracing/src/integrations/node/apollo.ts b/packages/tracing/src/integrations/node/apollo.ts index 09442216deb7..41b136abff42 100644 --- a/packages/tracing/src/integrations/node/apollo.ts +++ b/packages/tracing/src/integrations/node/apollo.ts @@ -1,5 +1,5 @@ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration } from '@sentry/types'; import { arrayify, fill, isThenable, loadModule, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/express.ts b/packages/tracing/src/integrations/node/express.ts index cb405664600a..8b3bcb52fcf4 100644 --- a/packages/tracing/src/integrations/node/express.ts +++ b/packages/tracing/src/integrations/node/express.ts @@ -1,5 +1,5 @@ /* eslint-disable max-lines */ -import { Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types'; +import type { Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types'; import { extractPathForTransaction, getNumberOfUrlSegments, isRegExp, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/graphql.ts b/packages/tracing/src/integrations/node/graphql.ts index 0bf267850cec..12f04b7c1e57 100644 --- a/packages/tracing/src/integrations/node/graphql.ts +++ b/packages/tracing/src/integrations/node/graphql.ts @@ -1,5 +1,5 @@ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration } from '@sentry/types'; import { fill, isThenable, loadModule, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/mongo.ts b/packages/tracing/src/integrations/node/mongo.ts index b2933ba37022..37335358c82e 100644 --- a/packages/tracing/src/integrations/node/mongo.ts +++ b/packages/tracing/src/integrations/node/mongo.ts @@ -1,5 +1,5 @@ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration, SpanContext } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration, SpanContext } from '@sentry/types'; import { fill, isThenable, loadModule, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/mysql.ts b/packages/tracing/src/integrations/node/mysql.ts index 9303522ea260..6e6a80ac59a6 100644 --- a/packages/tracing/src/integrations/node/mysql.ts +++ b/packages/tracing/src/integrations/node/mysql.ts @@ -1,5 +1,5 @@ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration } from '@sentry/types'; import { fill, loadModule, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/postgres.ts b/packages/tracing/src/integrations/node/postgres.ts index 5883ef94527f..41ad31b20660 100644 --- a/packages/tracing/src/integrations/node/postgres.ts +++ b/packages/tracing/src/integrations/node/postgres.ts @@ -1,5 +1,5 @@ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration } from '@sentry/types'; import { fill, isThenable, loadModule, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/prisma.ts b/packages/tracing/src/integrations/node/prisma.ts index 371052217911..2215cf2a817a 100644 --- a/packages/tracing/src/integrations/node/prisma.ts +++ b/packages/tracing/src/integrations/node/prisma.ts @@ -1,5 +1,5 @@ -import { Hub } from '@sentry/core'; -import { EventProcessor, Integration } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import type { EventProcessor, Integration } from '@sentry/types'; import { isThenable, logger } from '@sentry/utils'; import { shouldDisableAutoInstrumentation } from './utils/node-utils'; diff --git a/packages/tracing/src/integrations/node/utils/node-utils.ts b/packages/tracing/src/integrations/node/utils/node-utils.ts index 9cb6970c9ebc..11f8f2430b61 100644 --- a/packages/tracing/src/integrations/node/utils/node-utils.ts +++ b/packages/tracing/src/integrations/node/utils/node-utils.ts @@ -1,4 +1,4 @@ -import { Hub } from '@sentry/types'; +import type { Hub } from '@sentry/types'; /** * Check if Sentry auto-instrumentation should be disabled. diff --git a/packages/tracing/src/span.ts b/packages/tracing/src/span.ts index be070c0cbfa3..db11bb931df7 100644 --- a/packages/tracing/src/span.ts +++ b/packages/tracing/src/span.ts @@ -1,5 +1,12 @@ /* eslint-disable max-lines */ -import { Instrumenter, Primitive, Span as SpanInterface, SpanContext, TraceContext, Transaction } from '@sentry/types'; +import type { + Instrumenter, + Primitive, + Span as SpanInterface, + SpanContext, + TraceContext, + Transaction, +} from '@sentry/types'; import { dropUndefinedKeys, logger, timestampWithMs, uuid4 } from '@sentry/utils'; /** diff --git a/packages/tracing/src/transaction.ts b/packages/tracing/src/transaction.ts index 78a33fd17313..b93d52b81c38 100644 --- a/packages/tracing/src/transaction.ts +++ b/packages/tracing/src/transaction.ts @@ -1,5 +1,6 @@ -import { getCurrentHub, Hub } from '@sentry/core'; -import { +import type { Hub } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { Context, Contexts, DynamicSamplingContext, diff --git a/packages/tracing/src/utils.ts b/packages/tracing/src/utils.ts index d79a4f91a2df..66cba77843b7 100644 --- a/packages/tracing/src/utils.ts +++ b/packages/tracing/src/utils.ts @@ -1,5 +1,6 @@ -import { getCurrentHub, Hub } from '@sentry/core'; -import { Options, Transaction } from '@sentry/types'; +import type { Hub } from '@sentry/core'; +import { getCurrentHub } from '@sentry/core'; +import type { Options, Transaction } from '@sentry/types'; /** * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used diff --git a/packages/tracing/test/browser/browsertracing.test.ts b/packages/tracing/test/browser/browsertracing.test.ts index 3840ea75d6d6..a00025811874 100644 --- a/packages/tracing/test/browser/browsertracing.test.ts +++ b/packages/tracing/test/browser/browsertracing.test.ts @@ -1,19 +1,16 @@ import { BrowserClient, WINDOW } from '@sentry/browser'; import { Hub, makeMain } from '@sentry/core'; import type { BaseTransportOptions, ClientOptions, DsnComponents } from '@sentry/types'; -import { InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils'; +import type { InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils'; import { JSDOM } from 'jsdom'; -import { BrowserTracing, BrowserTracingOptions, getMetaContent } from '../../src/browser/browsertracing'; +import type { BrowserTracingOptions } from '../../src/browser/browsertracing'; +import { BrowserTracing, getMetaContent } from '../../src/browser/browsertracing'; import { defaultRequestInstrumentationOptions } from '../../src/browser/request'; import { instrumentRoutingWithDefaults } from '../../src/browser/router'; import * as hubExtensions from '../../src/hubextensions'; -import { - DEFAULT_FINAL_TIMEOUT, - DEFAULT_HEARTBEAT_INTERVAL, - DEFAULT_IDLE_TIMEOUT, - IdleTransaction, -} from '../../src/idletransaction'; +import type { IdleTransaction } from '../../src/idletransaction'; +import { DEFAULT_FINAL_TIMEOUT, DEFAULT_HEARTBEAT_INTERVAL, DEFAULT_IDLE_TIMEOUT } from '../../src/idletransaction'; import { getActiveTransaction } from '../../src/utils'; import { getDefaultBrowserClientOptions } from '../testutils'; diff --git a/packages/tracing/test/browser/metrics/index.test.ts b/packages/tracing/test/browser/metrics/index.test.ts index 2bda341e3b29..4820a70a5c9b 100644 --- a/packages/tracing/test/browser/metrics/index.test.ts +++ b/packages/tracing/test/browser/metrics/index.test.ts @@ -1,5 +1,6 @@ import { Transaction } from '../../../src'; -import { _addMeasureSpans, _addResourceSpans, ResourceEntry } from '../../../src/browser/metrics'; +import type { ResourceEntry } from '../../../src/browser/metrics'; +import { _addMeasureSpans, _addResourceSpans } from '../../../src/browser/metrics'; describe('_addMeasureSpans', () => { const transaction = new Transaction({ op: 'pageload', name: '/' }); diff --git a/packages/tracing/test/browser/request.test.ts b/packages/tracing/test/browser/request.test.ts index 732d6ea9b4f8..e2d60aa9edb2 100644 --- a/packages/tracing/test/browser/request.test.ts +++ b/packages/tracing/test/browser/request.test.ts @@ -2,15 +2,10 @@ import { BrowserClient } from '@sentry/browser'; import { Hub, makeMain } from '@sentry/core'; import * as utils from '@sentry/utils'; -import { Span, spanStatusfromHttpCode, Transaction } from '../../src'; -import { - fetchCallback, - FetchData, - instrumentOutgoingRequests, - shouldAttachHeaders, - xhrCallback, - XHRData, -} from '../../src/browser/request'; +import type { Transaction } from '../../src'; +import { Span, spanStatusfromHttpCode } from '../../src'; +import type { FetchData, XHRData } from '../../src/browser/request'; +import { fetchCallback, instrumentOutgoingRequests, shouldAttachHeaders, xhrCallback } from '../../src/browser/request'; import { addExtensionMethods } from '../../src/hubextensions'; import * as tracingUtils from '../../src/utils'; import { getDefaultBrowserClientOptions } from '../testutils'; diff --git a/packages/tracing/test/browser/router.test.ts b/packages/tracing/test/browser/router.test.ts index f0e3fec29084..65ce7e90af48 100644 --- a/packages/tracing/test/browser/router.test.ts +++ b/packages/tracing/test/browser/router.test.ts @@ -1,4 +1,4 @@ -import { InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils'; +import type { InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils'; import { JSDOM } from 'jsdom'; import { instrumentRoutingWithDefaults } from '../../src/browser/router'; diff --git a/packages/tracing/test/errors.test.ts b/packages/tracing/test/errors.test.ts index 7942bf2b85e9..554ee3b3d8c7 100644 --- a/packages/tracing/test/errors.test.ts +++ b/packages/tracing/test/errors.test.ts @@ -1,6 +1,6 @@ import { BrowserClient } from '@sentry/browser'; import { Hub, makeMain } from '@sentry/core'; -import { InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils'; +import type { InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils'; import { registerErrorInstrumentation } from '../src/errors'; import { _addTracingExtensions } from '../src/hubextensions'; diff --git a/packages/tracing/test/span.test.ts b/packages/tracing/test/span.test.ts index 378fac467069..6de0d79b7125 100644 --- a/packages/tracing/test/span.test.ts +++ b/packages/tracing/test/span.test.ts @@ -1,6 +1,6 @@ import { BrowserClient } from '@sentry/browser'; import { Hub, makeMain, Scope } from '@sentry/core'; -import { BaseTransportOptions, ClientOptions, TransactionSource } from '@sentry/types'; +import type { BaseTransportOptions, ClientOptions, TransactionSource } from '@sentry/types'; import { Span, Transaction } from '../src'; import { TRACEPARENT_REGEXP } from '../src/utils'; diff --git a/packages/tracing/test/testutils.ts b/packages/tracing/test/testutils.ts index 4ddd042a1240..071ecdf5111a 100644 --- a/packages/tracing/test/testutils.ts +++ b/packages/tracing/test/testutils.ts @@ -1,5 +1,5 @@ import { createTransport } from '@sentry/browser'; -import { Client, ClientOptions } from '@sentry/types'; +import type { Client, ClientOptions } from '@sentry/types'; import { GLOBAL_OBJ, resolvedSyncPromise } from '@sentry/utils'; import { JSDOM } from 'jsdom'; diff --git a/packages/types/src/breadcrumb.ts b/packages/types/src/breadcrumb.ts index 34fe2dfcd16a..b8e2552a2f34 100644 --- a/packages/types/src/breadcrumb.ts +++ b/packages/types/src/breadcrumb.ts @@ -1,4 +1,4 @@ -import { Severity, SeverityLevel } from './severity'; +import type { Severity, SeverityLevel } from './severity'; /** JSDoc */ export interface Breadcrumb { diff --git a/packages/types/src/client.ts b/packages/types/src/client.ts index 00fe9f5191ed..28d23025ce84 100644 --- a/packages/types/src/client.ts +++ b/packages/types/src/client.ts @@ -1,14 +1,14 @@ -import { EventDropReason } from './clientreport'; -import { DataCategory } from './datacategory'; -import { DsnComponents } from './dsn'; -import { Event, EventHint } from './event'; -import { Integration, IntegrationClass } from './integration'; -import { ClientOptions } from './options'; -import { Scope } from './scope'; -import { SdkMetadata } from './sdkmetadata'; -import { Session, SessionAggregates } from './session'; -import { Severity, SeverityLevel } from './severity'; -import { Transport } from './transport'; +import type { EventDropReason } from './clientreport'; +import type { DataCategory } from './datacategory'; +import type { DsnComponents } from './dsn'; +import type { Event, EventHint } from './event'; +import type { Integration, IntegrationClass } from './integration'; +import type { ClientOptions } from './options'; +import type { Scope } from './scope'; +import type { SdkMetadata } from './sdkmetadata'; +import type { Session, SessionAggregates } from './session'; +import type { Severity, SeverityLevel } from './severity'; +import type { Transport } from './transport'; /** * User-Facing Sentry SDK Client. diff --git a/packages/types/src/clientreport.ts b/packages/types/src/clientreport.ts index 79b3c2a4454c..7b4e181d1102 100644 --- a/packages/types/src/clientreport.ts +++ b/packages/types/src/clientreport.ts @@ -1,4 +1,4 @@ -import { DataCategory } from './datacategory'; +import type { DataCategory } from './datacategory'; export type EventDropReason = | 'before_send' diff --git a/packages/types/src/context.ts b/packages/types/src/context.ts index 120bd82cda9d..bab969899cea 100644 --- a/packages/types/src/context.ts +++ b/packages/types/src/context.ts @@ -1,4 +1,4 @@ -import { Primitive } from './misc'; +import type { Primitive } from './misc'; export type Context = Record; diff --git a/packages/types/src/envelope.ts b/packages/types/src/envelope.ts index 75c18498d5f1..60d67b89d0da 100644 --- a/packages/types/src/envelope.ts +++ b/packages/types/src/envelope.ts @@ -1,11 +1,11 @@ -import { ClientReport } from './clientreport'; -import { DsnComponents } from './dsn'; -import { Event } from './event'; -import { ReplayEvent, ReplayRecordingData } from './replay'; -import { SdkInfo } from './sdkinfo'; -import { Session, SessionAggregates } from './session'; -import { Transaction } from './transaction'; -import { UserFeedback } from './user'; +import type { ClientReport } from './clientreport'; +import type { DsnComponents } from './dsn'; +import type { Event } from './event'; +import type { ReplayEvent, ReplayRecordingData } from './replay'; +import type { SdkInfo } from './sdkinfo'; +import type { Session, SessionAggregates } from './session'; +import type { Transaction } from './transaction'; +import type { UserFeedback } from './user'; // Based on: https://develop.sentry.dev/sdk/envelopes/ diff --git a/packages/types/src/event.ts b/packages/types/src/event.ts index e9df8d364c68..86280fc7e65b 100644 --- a/packages/types/src/event.ts +++ b/packages/types/src/event.ts @@ -1,19 +1,19 @@ -import { Attachment } from './attachment'; -import { Breadcrumb } from './breadcrumb'; -import { Contexts } from './context'; -import { DebugMeta } from './debugMeta'; -import { Exception } from './exception'; -import { Extras } from './extra'; -import { Measurements } from './measurement'; -import { Primitive } from './misc'; -import { Request } from './request'; -import { CaptureContext } from './scope'; -import { SdkInfo } from './sdkinfo'; -import { Severity, SeverityLevel } from './severity'; -import { Span } from './span'; -import { Thread } from './thread'; -import { TransactionNameChange, TransactionSource } from './transaction'; -import { User } from './user'; +import type { Attachment } from './attachment'; +import type { Breadcrumb } from './breadcrumb'; +import type { Contexts } from './context'; +import type { DebugMeta } from './debugMeta'; +import type { Exception } from './exception'; +import type { Extras } from './extra'; +import type { Measurements } from './measurement'; +import type { Primitive } from './misc'; +import type { Request } from './request'; +import type { CaptureContext } from './scope'; +import type { SdkInfo } from './sdkinfo'; +import type { Severity, SeverityLevel } from './severity'; +import type { Span } from './span'; +import type { Thread } from './thread'; +import type { TransactionNameChange, TransactionSource } from './transaction'; +import type { User } from './user'; /** JSDoc */ export interface Event { diff --git a/packages/types/src/eventprocessor.ts b/packages/types/src/eventprocessor.ts index 543c0163ea5f..60a983fa0fdc 100644 --- a/packages/types/src/eventprocessor.ts +++ b/packages/types/src/eventprocessor.ts @@ -1,4 +1,4 @@ -import { Event, EventHint } from './event'; +import type { Event, EventHint } from './event'; /** * Event processors are used to change the event before it will be send. diff --git a/packages/types/src/exception.ts b/packages/types/src/exception.ts index 4b98f3a326d3..a74adf6c1603 100644 --- a/packages/types/src/exception.ts +++ b/packages/types/src/exception.ts @@ -1,5 +1,5 @@ -import { Mechanism } from './mechanism'; -import { Stacktrace } from './stacktrace'; +import type { Mechanism } from './mechanism'; +import type { Stacktrace } from './stacktrace'; /** JSDoc */ export interface Exception { diff --git a/packages/types/src/hub.ts b/packages/types/src/hub.ts index 555da1ef94ab..35a3f9f4a82e 100644 --- a/packages/types/src/hub.ts +++ b/packages/types/src/hub.ts @@ -1,14 +1,14 @@ -import { Breadcrumb, BreadcrumbHint } from './breadcrumb'; -import { Client } from './client'; -import { Event, EventHint } from './event'; -import { Extra, Extras } from './extra'; -import { Integration, IntegrationClass } from './integration'; -import { Primitive } from './misc'; -import { Scope } from './scope'; -import { Session } from './session'; -import { Severity, SeverityLevel } from './severity'; -import { CustomSamplingContext, Transaction, TransactionContext } from './transaction'; -import { User } from './user'; +import type { Breadcrumb, BreadcrumbHint } from './breadcrumb'; +import type { Client } from './client'; +import type { Event, EventHint } from './event'; +import type { Extra, Extras } from './extra'; +import type { Integration, IntegrationClass } from './integration'; +import type { Primitive } from './misc'; +import type { Scope } from './scope'; +import type { Session } from './session'; +import type { Severity, SeverityLevel } from './severity'; +import type { CustomSamplingContext, Transaction, TransactionContext } from './transaction'; +import type { User } from './user'; /** * Internal class used to make sure we always have the latest internal functions diff --git a/packages/types/src/integration.ts b/packages/types/src/integration.ts index 251c135973fd..c7672effc185 100644 --- a/packages/types/src/integration.ts +++ b/packages/types/src/integration.ts @@ -1,5 +1,5 @@ -import { EventProcessor } from './eventprocessor'; -import { Hub } from './hub'; +import type { EventProcessor } from './eventprocessor'; +import type { Hub } from './hub'; /** Integration Class Interface */ export interface IntegrationClass { diff --git a/packages/types/src/misc.ts b/packages/types/src/misc.ts index 3476befa78c6..af9ed8fc6bd7 100644 --- a/packages/types/src/misc.ts +++ b/packages/types/src/misc.ts @@ -1,4 +1,4 @@ -import { QueryParams } from './request'; +import type { QueryParams } from './request'; /** * Data extracted from an incoming request to a node server diff --git a/packages/types/src/options.ts b/packages/types/src/options.ts index 8e6a8465d298..ca53b19f607a 100644 --- a/packages/types/src/options.ts +++ b/packages/types/src/options.ts @@ -1,12 +1,12 @@ -import { Breadcrumb, BreadcrumbHint } from './breadcrumb'; -import { ErrorEvent, Event, EventHint, TransactionEvent } from './event'; -import { Instrumenter } from './instrumenter'; -import { Integration } from './integration'; -import { CaptureContext } from './scope'; -import { SdkMetadata } from './sdkmetadata'; -import { StackLineParser, StackParser } from './stacktrace'; -import { SamplingContext } from './transaction'; -import { BaseTransportOptions, Transport } from './transport'; +import type { Breadcrumb, BreadcrumbHint } from './breadcrumb'; +import type { ErrorEvent, Event, EventHint, TransactionEvent } from './event'; +import type { Instrumenter } from './instrumenter'; +import type { Integration } from './integration'; +import type { CaptureContext } from './scope'; +import type { SdkMetadata } from './sdkmetadata'; +import type { StackLineParser, StackParser } from './stacktrace'; +import type { SamplingContext } from './transaction'; +import type { BaseTransportOptions, Transport } from './transport'; export interface ClientOptions { /** diff --git a/packages/types/src/replay.ts b/packages/types/src/replay.ts index 2027a373bb33..79bbce4c6eb4 100644 --- a/packages/types/src/replay.ts +++ b/packages/types/src/replay.ts @@ -1,4 +1,4 @@ -import { Event } from './event'; +import type { Event } from './event'; /** * NOTE: These types are still considered Beta and subject to change. diff --git a/packages/types/src/scope.ts b/packages/types/src/scope.ts index 1b7be6f5b938..4ed11b287421 100644 --- a/packages/types/src/scope.ts +++ b/packages/types/src/scope.ts @@ -1,14 +1,14 @@ -import { Attachment } from './attachment'; -import { Breadcrumb } from './breadcrumb'; -import { Context, Contexts } from './context'; -import { EventProcessor } from './eventprocessor'; -import { Extra, Extras } from './extra'; -import { Primitive } from './misc'; -import { RequestSession, Session } from './session'; -import { Severity, SeverityLevel } from './severity'; -import { Span } from './span'; -import { Transaction } from './transaction'; -import { User } from './user'; +import type { Attachment } from './attachment'; +import type { Breadcrumb } from './breadcrumb'; +import type { Context, Contexts } from './context'; +import type { EventProcessor } from './eventprocessor'; +import type { Extra, Extras } from './extra'; +import type { Primitive } from './misc'; +import type { RequestSession, Session } from './session'; +import type { Severity, SeverityLevel } from './severity'; +import type { Span } from './span'; +import type { Transaction } from './transaction'; +import type { User } from './user'; /** JSDocs */ export type CaptureContext = Scope | Partial | ((scope: Scope) => Scope); diff --git a/packages/types/src/sdkinfo.ts b/packages/types/src/sdkinfo.ts index 0a839b0c7c95..b287ef0674f5 100644 --- a/packages/types/src/sdkinfo.ts +++ b/packages/types/src/sdkinfo.ts @@ -1,4 +1,4 @@ -import { Package } from './package'; +import type { Package } from './package'; export interface SdkInfo { name?: string; diff --git a/packages/types/src/sdkmetadata.ts b/packages/types/src/sdkmetadata.ts index d65e989cb4c1..40df8046fe3d 100644 --- a/packages/types/src/sdkmetadata.ts +++ b/packages/types/src/sdkmetadata.ts @@ -1,4 +1,4 @@ -import { SdkInfo } from './sdkinfo'; +import type { SdkInfo } from './sdkinfo'; export interface SdkMetadata { sdk?: SdkInfo; diff --git a/packages/types/src/session.ts b/packages/types/src/session.ts index 35d5e0840a3e..3d62a8085444 100644 --- a/packages/types/src/session.ts +++ b/packages/types/src/session.ts @@ -1,4 +1,4 @@ -import { User } from './user'; +import type { User } from './user'; export interface RequestSession { status?: RequestSessionStatus; diff --git a/packages/types/src/span.ts b/packages/types/src/span.ts index 2b0a91ed9ee6..756a6808910c 100644 --- a/packages/types/src/span.ts +++ b/packages/types/src/span.ts @@ -1,6 +1,6 @@ -import { Instrumenter } from './instrumenter'; -import { Primitive } from './misc'; -import { Transaction } from './transaction'; +import type { Instrumenter } from './instrumenter'; +import type { Primitive } from './misc'; +import type { Transaction } from './transaction'; /** Interface holding all properties that can be set on a Span on creation. */ export interface SpanContext { diff --git a/packages/types/src/stacktrace.ts b/packages/types/src/stacktrace.ts index ae2f350f716b..c27cbf00a12c 100644 --- a/packages/types/src/stacktrace.ts +++ b/packages/types/src/stacktrace.ts @@ -1,4 +1,4 @@ -import { StackFrame } from './stackframe'; +import type { StackFrame } from './stackframe'; /** JSDoc */ export interface Stacktrace { diff --git a/packages/types/src/thread.ts b/packages/types/src/thread.ts index 5cc1a2b63891..1cfad253a299 100644 --- a/packages/types/src/thread.ts +++ b/packages/types/src/thread.ts @@ -1,4 +1,4 @@ -import { Stacktrace } from './stacktrace'; +import type { Stacktrace } from './stacktrace'; /** JSDoc */ export interface Thread { diff --git a/packages/types/src/transaction.ts b/packages/types/src/transaction.ts index ae2dd54e2629..e60132a8e550 100644 --- a/packages/types/src/transaction.ts +++ b/packages/types/src/transaction.ts @@ -1,10 +1,10 @@ -import { Context } from './context'; -import { DynamicSamplingContext } from './envelope'; -import { Instrumenter } from './instrumenter'; -import { MeasurementUnit } from './measurement'; -import { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc'; -import { PolymorphicRequest } from './polymorphics'; -import { Span, SpanContext } from './span'; +import type { Context } from './context'; +import type { DynamicSamplingContext } from './envelope'; +import type { Instrumenter } from './instrumenter'; +import type { MeasurementUnit } from './measurement'; +import type { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc'; +import type { PolymorphicRequest } from './polymorphics'; +import type { Span, SpanContext } from './span'; /** * Interface holding Transaction-specific properties diff --git a/packages/types/src/transport.ts b/packages/types/src/transport.ts index b254edecc6df..05638b67228e 100644 --- a/packages/types/src/transport.ts +++ b/packages/types/src/transport.ts @@ -1,6 +1,6 @@ -import { Client } from './client'; -import { Envelope } from './envelope'; -import { TextEncoderInternal } from './textencoder'; +import type { Client } from './client'; +import type { Envelope } from './envelope'; +import type { TextEncoderInternal } from './textencoder'; export type TransportRequest = { body: string | Uint8Array; diff --git a/packages/utils/src/baggage.ts b/packages/utils/src/baggage.ts index 1a2fa58d52a6..406ee3adc819 100644 --- a/packages/utils/src/baggage.ts +++ b/packages/utils/src/baggage.ts @@ -1,4 +1,4 @@ -import { DynamicSamplingContext } from '@sentry/types'; +import type { DynamicSamplingContext } from '@sentry/types'; import { isString } from './is'; import { logger } from './logger'; diff --git a/packages/utils/src/buildPolyfills/_asyncOptionalChain.ts b/packages/utils/src/buildPolyfills/_asyncOptionalChain.ts index 10a10aa03f3a..71c0382451b5 100644 --- a/packages/utils/src/buildPolyfills/_asyncOptionalChain.ts +++ b/packages/utils/src/buildPolyfills/_asyncOptionalChain.ts @@ -1,4 +1,4 @@ -import { GenericFunction } from './types'; +import type { GenericFunction } from './types'; /** * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, diff --git a/packages/utils/src/buildPolyfills/_createNamedExportFrom.ts b/packages/utils/src/buildPolyfills/_createNamedExportFrom.ts index 0c632e586aba..678e7024b7a1 100644 --- a/packages/utils/src/buildPolyfills/_createNamedExportFrom.ts +++ b/packages/utils/src/buildPolyfills/_createNamedExportFrom.ts @@ -1,4 +1,4 @@ -import { GenericObject } from './types'; +import type { GenericObject } from './types'; declare const exports: GenericObject; diff --git a/packages/utils/src/buildPolyfills/_createStarExport.ts b/packages/utils/src/buildPolyfills/_createStarExport.ts index f4f36c8c041a..38d4ae340a85 100644 --- a/packages/utils/src/buildPolyfills/_createStarExport.ts +++ b/packages/utils/src/buildPolyfills/_createStarExport.ts @@ -1,4 +1,4 @@ -import { GenericObject } from './types'; +import type { GenericObject } from './types'; declare const exports: GenericObject; diff --git a/packages/utils/src/buildPolyfills/_interopDefault.ts b/packages/utils/src/buildPolyfills/_interopDefault.ts index 5bed0ef4e3f1..2b56c164b698 100644 --- a/packages/utils/src/buildPolyfills/_interopDefault.ts +++ b/packages/utils/src/buildPolyfills/_interopDefault.ts @@ -1,4 +1,4 @@ -import { RequireResult } from './types'; +import type { RequireResult } from './types'; /** * Unwraps a module if it has been wrapped in an object under the key `default`. diff --git a/packages/utils/src/buildPolyfills/_interopNamespace.ts b/packages/utils/src/buildPolyfills/_interopNamespace.ts index 2211e21accfa..1401d986e9a1 100644 --- a/packages/utils/src/buildPolyfills/_interopNamespace.ts +++ b/packages/utils/src/buildPolyfills/_interopNamespace.ts @@ -1,4 +1,4 @@ -import { RequireResult } from './types'; +import type { RequireResult } from './types'; /** * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules. diff --git a/packages/utils/src/buildPolyfills/_interopNamespaceDefaultOnly.ts b/packages/utils/src/buildPolyfills/_interopNamespaceDefaultOnly.ts index 66785a79e92f..98d96e329119 100644 --- a/packages/utils/src/buildPolyfills/_interopNamespaceDefaultOnly.ts +++ b/packages/utils/src/buildPolyfills/_interopNamespaceDefaultOnly.ts @@ -1,4 +1,4 @@ -import { RequireResult } from './types'; +import type { RequireResult } from './types'; /** * Wrap a module in an object, as the value under the key `default`. diff --git a/packages/utils/src/buildPolyfills/_interopRequireDefault.ts b/packages/utils/src/buildPolyfills/_interopRequireDefault.ts index 9d9a7767cb7c..480d3561fc4e 100644 --- a/packages/utils/src/buildPolyfills/_interopRequireDefault.ts +++ b/packages/utils/src/buildPolyfills/_interopRequireDefault.ts @@ -1,4 +1,4 @@ -import { RequireResult } from './types'; +import type { RequireResult } from './types'; /** * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default` diff --git a/packages/utils/src/buildPolyfills/_interopRequireWildcard.ts b/packages/utils/src/buildPolyfills/_interopRequireWildcard.ts index 411939ab68d6..b545d90c5652 100644 --- a/packages/utils/src/buildPolyfills/_interopRequireWildcard.ts +++ b/packages/utils/src/buildPolyfills/_interopRequireWildcard.ts @@ -1,4 +1,4 @@ -import { RequireResult } from './types'; +import type { RequireResult } from './types'; /** * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules. diff --git a/packages/utils/src/buildPolyfills/_optionalChain.ts b/packages/utils/src/buildPolyfills/_optionalChain.ts index 452c6ac110b0..3bb00a465c53 100644 --- a/packages/utils/src/buildPolyfills/_optionalChain.ts +++ b/packages/utils/src/buildPolyfills/_optionalChain.ts @@ -1,4 +1,4 @@ -import { GenericFunction } from './types'; +import type { GenericFunction } from './types'; /** * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, diff --git a/packages/utils/src/buildPolyfills/types.ts b/packages/utils/src/buildPolyfills/types.ts index 41f1a8a31ee5..806f302460a8 100644 --- a/packages/utils/src/buildPolyfills/types.ts +++ b/packages/utils/src/buildPolyfills/types.ts @@ -1,4 +1,4 @@ -import { Primitive } from '@sentry/types'; +import type { Primitive } from '@sentry/types'; export type GenericObject = { [key: string]: Value }; export type GenericFunction = (...args: unknown[]) => Value; diff --git a/packages/utils/src/clientreport.ts b/packages/utils/src/clientreport.ts index f91c79ab5c5c..c0dbb6cb3aba 100644 --- a/packages/utils/src/clientreport.ts +++ b/packages/utils/src/clientreport.ts @@ -1,4 +1,4 @@ -import { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types'; +import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types'; import { createEnvelope } from './envelope'; import { dateTimestampInSeconds } from './time'; diff --git a/packages/utils/src/dsn.ts b/packages/utils/src/dsn.ts index d6dd4a7da2b7..f506a8fcb9be 100644 --- a/packages/utils/src/dsn.ts +++ b/packages/utils/src/dsn.ts @@ -1,4 +1,4 @@ -import { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types'; +import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types'; import { SentryError } from './error'; diff --git a/packages/utils/src/envelope.ts b/packages/utils/src/envelope.ts index 5cb1a675645e..8dcb7c492fed 100644 --- a/packages/utils/src/envelope.ts +++ b/packages/utils/src/envelope.ts @@ -1,4 +1,4 @@ -import { +import type { Attachment, AttachmentItem, BaseEnvelopeHeaders, diff --git a/packages/utils/src/instrument.ts b/packages/utils/src/instrument.ts index 319ac5e538a3..cc3c1986b06d 100644 --- a/packages/utils/src/instrument.ts +++ b/packages/utils/src/instrument.ts @@ -1,7 +1,7 @@ /* eslint-disable max-lines */ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/ban-types */ -import { WrappedFunction } from '@sentry/types'; +import type { WrappedFunction } from '@sentry/types'; import { isInstanceOf, isString } from './is'; import { CONSOLE_LEVELS, logger } from './logger'; diff --git a/packages/utils/src/is.ts b/packages/utils/src/is.ts index 8ec83089e4d5..350826cb567c 100644 --- a/packages/utils/src/is.ts +++ b/packages/utils/src/is.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { PolymorphicEvent, Primitive } from '@sentry/types'; +import type { PolymorphicEvent, Primitive } from '@sentry/types'; // eslint-disable-next-line @typescript-eslint/unbound-method const objectToString = Object.prototype.toString; diff --git a/packages/utils/src/logger.ts b/packages/utils/src/logger.ts index efa8f49716b9..b3cc6ddacdea 100644 --- a/packages/utils/src/logger.ts +++ b/packages/utils/src/logger.ts @@ -1,4 +1,4 @@ -import { WrappedFunction } from '@sentry/types'; +import type { WrappedFunction } from '@sentry/types'; import { getGlobalSingleton, GLOBAL_OBJ } from './worldwide'; diff --git a/packages/utils/src/misc.ts b/packages/utils/src/misc.ts index 39a61bd478e7..640c526db7b2 100644 --- a/packages/utils/src/misc.ts +++ b/packages/utils/src/misc.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Event, Exception, Mechanism, StackFrame } from '@sentry/types'; +import type { Event, Exception, Mechanism, StackFrame } from '@sentry/types'; import { addNonEnumerableProperty } from './object'; import { snipLine } from './string'; diff --git a/packages/utils/src/normalize.ts b/packages/utils/src/normalize.ts index ebeb5f0ff318..0b203d3749e0 100644 --- a/packages/utils/src/normalize.ts +++ b/packages/utils/src/normalize.ts @@ -1,7 +1,8 @@ -import { Primitive } from '@sentry/types'; +import type { Primitive } from '@sentry/types'; import { isNaN, isSyntheticEvent } from './is'; -import { memoBuilder, MemoFunc } from './memo'; +import type { MemoFunc } from './memo'; +import { memoBuilder } from './memo'; import { convertToPlainObject } from './object'; import { getFunctionName } from './stacktrace'; diff --git a/packages/utils/src/object.ts b/packages/utils/src/object.ts index 1e02d1fd163e..3a22e2aa49a3 100644 --- a/packages/utils/src/object.ts +++ b/packages/utils/src/object.ts @@ -1,6 +1,6 @@ /* eslint-disable max-lines */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { WrappedFunction } from '@sentry/types'; +import type { WrappedFunction } from '@sentry/types'; import { htmlTreeAsString } from './browser'; import { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is'; diff --git a/packages/utils/src/ratelimit.ts b/packages/utils/src/ratelimit.ts index 78720c888576..da4e3bbdb08e 100644 --- a/packages/utils/src/ratelimit.ts +++ b/packages/utils/src/ratelimit.ts @@ -1,4 +1,4 @@ -import { TransportMakeRequestResponse } from '@sentry/types'; +import type { TransportMakeRequestResponse } from '@sentry/types'; // Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend export type RateLimits = Record; diff --git a/packages/utils/src/requestdata.ts b/packages/utils/src/requestdata.ts index 4f914bfe16c0..f6b40c3ab8bd 100644 --- a/packages/utils/src/requestdata.ts +++ b/packages/utils/src/requestdata.ts @@ -14,7 +14,13 @@ /* eslint-disable max-lines */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Event, ExtractedNodeRequestData, PolymorphicRequest, Transaction, TransactionSource } from '@sentry/types'; +import type { + Event, + ExtractedNodeRequestData, + PolymorphicRequest, + Transaction, + TransactionSource, +} from '@sentry/types'; import { isPlainObject, isString } from './is'; import { normalize } from './normalize'; diff --git a/packages/utils/src/severity.ts b/packages/utils/src/severity.ts index c40f0c2a6004..6d631b590a88 100644 --- a/packages/utils/src/severity.ts +++ b/packages/utils/src/severity.ts @@ -1,5 +1,5 @@ /* eslint-disable deprecation/deprecation */ -import { Severity, SeverityLevel } from '@sentry/types'; +import type { Severity, SeverityLevel } from '@sentry/types'; // Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either // diff --git a/packages/utils/src/stacktrace.ts b/packages/utils/src/stacktrace.ts index fabbc9f43575..742a28049695 100644 --- a/packages/utils/src/stacktrace.ts +++ b/packages/utils/src/stacktrace.ts @@ -1,4 +1,4 @@ -import { StackFrame, StackLineParser, StackLineParserFn, StackParser } from '@sentry/types'; +import type { StackFrame, StackLineParser, StackLineParserFn, StackParser } from '@sentry/types'; const STACKTRACE_LIMIT = 50; diff --git a/packages/utils/src/tracing.ts b/packages/utils/src/tracing.ts index cef6e334f7e7..7eee5312ce6d 100644 --- a/packages/utils/src/tracing.ts +++ b/packages/utils/src/tracing.ts @@ -1,4 +1,4 @@ -import { TraceparentData } from '@sentry/types'; +import type { TraceparentData } from '@sentry/types'; export const TRACEPARENT_REGEXP = new RegExp( '^[ \\t]*' + // whitespace diff --git a/packages/utils/src/worldwide.ts b/packages/utils/src/worldwide.ts index 464ca794b4a4..e341339bc980 100644 --- a/packages/utils/src/worldwide.ts +++ b/packages/utils/src/worldwide.ts @@ -12,7 +12,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Integration } from '@sentry/types'; +import type { Integration } from '@sentry/types'; /** Internal global with common properties and Sentry extensions */ export interface InternalGlobal { diff --git a/packages/utils/test/buildPolyfills/interop.test.ts b/packages/utils/test/buildPolyfills/interop.test.ts index 917d62daee2f..a53c64eb0979 100644 --- a/packages/utils/test/buildPolyfills/interop.test.ts +++ b/packages/utils/test/buildPolyfills/interop.test.ts @@ -5,7 +5,7 @@ import { _interopRequireDefault, _interopRequireWildcard, } from '../../src/buildPolyfills'; -import { RequireResult } from '../../src/buildPolyfills/types'; +import type { RequireResult } from '../../src/buildPolyfills/types'; import { _interopDefault as _interopDefaultOrig, _interopNamespace as _interopNamespaceOrig, diff --git a/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts b/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts index 55fd5ee9c996..d2a1d98d8a05 100644 --- a/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts +++ b/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts @@ -1,5 +1,5 @@ import { _nullishCoalesce } from '../../src/buildPolyfills'; -import { Value } from '../../src/buildPolyfills/types'; +import type { Value } from '../../src/buildPolyfills/types'; import { _nullishCoalesce as _nullishCoalesceOrig } from './originals'; const dogStr = 'dogs are great!'; diff --git a/packages/utils/test/buildPolyfills/optionalChain.test.ts b/packages/utils/test/buildPolyfills/optionalChain.test.ts index 4fec5ee1dc63..4ad6f14befde 100644 --- a/packages/utils/test/buildPolyfills/optionalChain.test.ts +++ b/packages/utils/test/buildPolyfills/optionalChain.test.ts @@ -1,7 +1,7 @@ import { default as arrayFlat } from 'array.prototype.flat'; import { _optionalChain } from '../../src/buildPolyfills'; -import { GenericFunction, GenericObject, Value } from '../../src/buildPolyfills/types'; +import type { GenericFunction, GenericObject, Value } from '../../src/buildPolyfills/types'; import { _optionalChain as _optionalChainOrig } from './originals'; // Older versions of Node don't have `Array.prototype.flat`, which crashes these tests. On newer versions that do have diff --git a/packages/utils/test/clientreport.test.ts b/packages/utils/test/clientreport.test.ts index 03026fd16eaf..b783886771dc 100644 --- a/packages/utils/test/clientreport.test.ts +++ b/packages/utils/test/clientreport.test.ts @@ -1,4 +1,4 @@ -import { ClientReport } from '@sentry/types'; +import type { ClientReport } from '@sentry/types'; import { TextDecoder, TextEncoder } from 'util'; import { createClientReportEnvelope } from '../src/clientreport'; diff --git a/packages/utils/test/envelope.test.ts b/packages/utils/test/envelope.test.ts index b88400dbe503..2996b6dcde06 100644 --- a/packages/utils/test/envelope.test.ts +++ b/packages/utils/test/envelope.test.ts @@ -1,4 +1,4 @@ -import { EventEnvelope } from '@sentry/types'; +import type { EventEnvelope } from '@sentry/types'; import { TextDecoder, TextEncoder } from 'util'; const encoder = new TextEncoder(); diff --git a/packages/utils/test/misc.test.ts b/packages/utils/test/misc.test.ts index ded5a7a4d037..77c6441e31a1 100644 --- a/packages/utils/test/misc.test.ts +++ b/packages/utils/test/misc.test.ts @@ -1,4 +1,4 @@ -import { Event, Mechanism, StackFrame } from '@sentry/types'; +import type { Event, Mechanism, StackFrame } from '@sentry/types'; import { addContextToFrame, diff --git a/packages/utils/test/ratelimit.test.ts b/packages/utils/test/ratelimit.test.ts index 52a04683563f..978774c78ea3 100644 --- a/packages/utils/test/ratelimit.test.ts +++ b/packages/utils/test/ratelimit.test.ts @@ -1,9 +1,9 @@ +import type { RateLimits } from '../src/ratelimit'; import { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, - RateLimits, updateRateLimits, } from '../src/ratelimit'; diff --git a/packages/vue/src/components.ts b/packages/vue/src/components.ts index 86c7e8f2f65f..c52962aade41 100644 --- a/packages/vue/src/components.ts +++ b/packages/vue/src/components.ts @@ -1,4 +1,4 @@ -import { ViewModel } from './types'; +import type { ViewModel } from './types'; // Vendored directly from https://github.com/vuejs/vue/blob/master/src/core/util/debug.js with types only changes. const classifyRE = /(?:^|[-_])(\w)/g; diff --git a/packages/vue/src/constants.ts b/packages/vue/src/constants.ts index 13c9d7af9c83..e254d988c40c 100644 --- a/packages/vue/src/constants.ts +++ b/packages/vue/src/constants.ts @@ -1,3 +1,3 @@ -import { Operation } from './types'; +import type { Operation } from './types'; export const DEFAULT_HOOKS: Operation[] = ['activate', 'mount', 'update']; diff --git a/packages/vue/src/errorhandler.ts b/packages/vue/src/errorhandler.ts index 16cb09a723ab..032ecc2386c8 100644 --- a/packages/vue/src/errorhandler.ts +++ b/packages/vue/src/errorhandler.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '@sentry/browser'; import { formatComponentName, generateComponentTrace } from './components'; -import { Options, ViewModel, Vue } from './types'; +import type { Options, ViewModel, Vue } from './types'; type UnknownFunc = (...args: unknown[]) => void; diff --git a/packages/vue/src/router.ts b/packages/vue/src/router.ts index f782246e8fb2..2bdb088a24cf 100644 --- a/packages/vue/src/router.ts +++ b/packages/vue/src/router.ts @@ -1,5 +1,5 @@ import { captureException, WINDOW } from '@sentry/browser'; -import { Transaction, TransactionContext, TransactionSource } from '@sentry/types'; +import type { Transaction, TransactionContext, TransactionSource } from '@sentry/types'; import { getActiveTransaction } from './tracing'; diff --git a/packages/vue/src/sdk.ts b/packages/vue/src/sdk.ts index a2063038402c..9c10dbec28e6 100644 --- a/packages/vue/src/sdk.ts +++ b/packages/vue/src/sdk.ts @@ -4,7 +4,7 @@ import { arrayify, GLOBAL_OBJ } from '@sentry/utils'; import { DEFAULT_HOOKS } from './constants'; import { attachErrorHandler } from './errorhandler'; import { createTracingMixins } from './tracing'; -import { Options, TracingOptions, Vue } from './types'; +import type { Options, TracingOptions, Vue } from './types'; const globalWithVue = GLOBAL_OBJ as typeof GLOBAL_OBJ & { Vue: Vue }; diff --git a/packages/vue/src/tracing.ts b/packages/vue/src/tracing.ts index 889cbe30dca6..9f56586aa717 100644 --- a/packages/vue/src/tracing.ts +++ b/packages/vue/src/tracing.ts @@ -1,10 +1,10 @@ import { getCurrentHub } from '@sentry/browser'; -import { Span, Transaction } from '@sentry/types'; +import type { Span, Transaction } from '@sentry/types'; import { logger, timestampInSeconds } from '@sentry/utils'; import { formatComponentName } from './components'; import { DEFAULT_HOOKS } from './constants'; -import { Hook, Operation, TracingOptions, ViewModel, Vue } from './types'; +import type { Hook, Operation, TracingOptions, ViewModel, Vue } from './types'; const VUE_OP = 'ui.vue'; diff --git a/packages/vue/src/types.ts b/packages/vue/src/types.ts index eb386d6f3e4b..1cc39b97b887 100644 --- a/packages/vue/src/types.ts +++ b/packages/vue/src/types.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { BrowserOptions } from '@sentry/browser'; +import type { BrowserOptions } from '@sentry/browser'; // This is not great, but kinda necessary to make it woth with Vue@2 and Vue@3 at the same time. export interface Vue { diff --git a/packages/vue/test/errorHandler.test.ts b/packages/vue/test/errorHandler.test.ts index 1c41166fd167..e7530c91304e 100644 --- a/packages/vue/test/errorHandler.test.ts +++ b/packages/vue/test/errorHandler.test.ts @@ -2,7 +2,7 @@ import { getCurrentHub } from '@sentry/browser'; import { generateComponentTrace } from '../src/components'; import { attachErrorHandler } from '../src/errorhandler'; -import { Operation, Options, ViewModel, Vue } from '../src/types'; +import type { Operation, Options, ViewModel, Vue } from '../src/types'; describe('attachErrorHandler', () => { describe('attachProps', () => { diff --git a/packages/vue/test/router.test.ts b/packages/vue/test/router.test.ts index c4072616d9af..65482f80f10b 100644 --- a/packages/vue/test/router.test.ts +++ b/packages/vue/test/router.test.ts @@ -1,8 +1,8 @@ import * as SentryBrowser from '@sentry/browser'; -import { Transaction } from '@sentry/types'; +import type { Transaction } from '@sentry/types'; import { vueRouterInstrumentation } from '../src'; -import { Route } from '../src/router'; +import type { Route } from '../src/router'; import * as vueTracing from '../src/tracing'; const captureExceptionSpy = jest.spyOn(SentryBrowser, 'captureException'); diff --git a/packages/wasm/src/index.ts b/packages/wasm/src/index.ts index cc5e678ee123..436668e73ac2 100644 --- a/packages/wasm/src/index.ts +++ b/packages/wasm/src/index.ts @@ -1,4 +1,4 @@ -import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; +import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; import { patchWebAssembly } from './patchWebAssembly'; import { getImage, getImages } from './registry'; diff --git a/packages/wasm/src/registry.ts b/packages/wasm/src/registry.ts index 56609b389cca..f000dbff7c53 100644 --- a/packages/wasm/src/registry.ts +++ b/packages/wasm/src/registry.ts @@ -1,4 +1,4 @@ -import { DebugImage } from '@sentry/types'; +import type { DebugImage } from '@sentry/types'; export const IMAGES: Array = [];