Skip to content

Commit

Permalink
build: enable biome organizeImports feature (#9693)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Nov 29, 2023
1 parent 462ea44 commit 27f6ae1
Show file tree
Hide file tree
Showing 403 changed files with 580 additions and 580 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"useIgnoreFile": true
},
"organizeImports": {
"enabled": false
"enabled": true
},
"linter": {
"enabled": false
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-ivy/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VERSION } from '@angular/core';
import type { BrowserOptions } from '@sentry/browser';
import { defaultIntegrations, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser';
import { SDK_VERSION, defaultIntegrations, init as browserInit, setContext } from '@sentry/browser';
import type { SdkMetadata } from '@sentry/types';
import { logger } from '@sentry/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VERSION } from '@angular/core';
import type { BrowserOptions } from '@sentry/browser';
import { defaultIntegrations, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser';
import { SDK_VERSION, defaultIntegrations, init as browserInit, setContext } from '@sentry/browser';
import type { SdkMetadata } from '@sentry/types';
import { logger } from '@sentry/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { NavigationCancel, NavigationError, Router } from '@angular/router';
import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';
import { getCurrentHub, WINDOW } from '@sentry/browser';
import { WINDOW, getCurrentHub } from '@sentry/browser';
import type { Span, Transaction, TransactionContext } from '@sentry/types';
import { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';
import type { Observable } from 'rxjs';
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/test/errorhandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http';
import * as SentryBrowser from '@sentry/browser';
import type { Client, Event } from '@sentry/types';

import { createErrorHandler, SentryErrorHandler } from '../src/errorhandler';
import { SentryErrorHandler, createErrorHandler } from '../src/errorhandler';

const captureExceptionSpy = jest.spyOn(SentryBrowser, 'captureException');

Expand Down
2 changes: 1 addition & 1 deletion packages/angular/test/ivy-synced.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as glob from 'glob';
import * as path from 'path';
import * as glob from 'glob';

describe('@sentry/angular-ivy', () => {
/*
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/test/tracing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import type { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router';
import type { Hub } from '@sentry/types';

import { instrumentAngularRouting, TraceClassDecorator, TraceDirective, TraceMethodDecorator } from '../src';
import { TraceClassDecorator, TraceDirective, TraceMethodDecorator, instrumentAngularRouting } from '../src';
import { getParameterizedRouteFromSnapshot } from '../src/tracing';
import { AppComponent, TestEnv } from './utils/index';

Expand Down
2 changes: 1 addition & 1 deletion packages/angular/test/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import type { Transaction } from '@sentry/types';

import { instrumentAngularRouting, TraceService } from '../../src';
import { TraceService, instrumentAngularRouting } from '../../src';

@Component({
template: '<router-outlet></router-outlet>',
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/scripts/syncIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */

import * as fse from 'fs-extra';
import * as path from 'path';
import * as fse from 'fs-extra';

const buildDir = path.resolve('build');
const srcIntegrationDir = path.resolve(path.join('src', 'integration'));
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/integration/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as fs from 'fs';
import * as path from 'path';
/* eslint-disable no-console */
import { sentryVitePlugin } from '@sentry/vite-plugin';
import type { AstroConfig, AstroIntegration } from 'astro';
import * as fs from 'fs';
import * as path from 'path';

import { buildClientSnippet, buildSdkInitFileImportSnippet, buildServerSnippet } from './snippets';
import type { SentryOptions } from './types';
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/server/meta.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getDynamicSamplingContextFromClient } from '@sentry/core';
import type { Hub, Span } from '@sentry/types';
import {
TRACEPARENT_REGEXP,
dynamicSamplingContextToSentryBaggageHeader,
generateSentryTraceHeader,
logger,
TRACEPARENT_REGEXP,
} from '@sentry/utils';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/client/sdk.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BrowserClient } from '@sentry/browser';
import * as SentryBrowser from '@sentry/browser';
import { BrowserTracing, getClient, getCurrentHub, SDK_VERSION, WINDOW } from '@sentry/browser';
import { BrowserTracing, SDK_VERSION, WINDOW, getClient, getCurrentHub } from '@sentry/browser';
import { vi } from 'vitest';

import { init } from '../../../astro/src/client/sdk';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from '@playwright/test';
import fs from 'fs';
import path from 'path';
import { expect } from '@playwright/test';

import { sentryTest, TEST_HOST } from '../../../../utils/fixtures';
import { TEST_HOST, sentryTest } from '../../../../utils/fixtures';
import { LOADER_CONFIGS } from '../../../../utils/generatePlugin';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as glob from 'glob';
import * as path from 'path';
import * as childProcess from 'child_process';
import * as path from 'path';
import * as glob from 'glob';

async function run(): Promise<void> {
let testPaths: string[] = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Sentry from '@sentry/browser';
import { Feedback } from '@sentry-internal/feedback';
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Sentry from '@sentry/browser';
import { Feedback } from '@sentry-internal/feedback';
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
BrowserClient,
Breadcrumbs,
BrowserClient,
Dedupe,
FunctionToString,
HttpContext,
Hub,
InboundFilters,
LinkedErrors,
defaultStackParser,
makeFetchTransport,
Hub,
} from '@sentry/browser';

const integrations = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from '@playwright/test';
import fs from 'fs';
import path from 'path';
import { expect } from '@playwright/test';

import { sentryTest, TEST_HOST } from '../../../utils/fixtures';
import { TEST_HOST, sentryTest } from '../../../utils/fixtures';
import { getExpectedReplayEvent } from '../../../utils/replayEventTemplates';
import {
getFullRecordingSnapshots,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { expect } from '@playwright/test';

import { sentryTest } from '../../../utils/fixtures';
import {
getReplaySnapshot,
REPLAY_DEFAULT_FLUSH_MAX_DELAY,
getReplaySnapshot,
shouldSkipReplayTest,
waitForReplayRequest,
} from '../../../utils/replayHelpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { expect } from '@playwright/test';
import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser } from '../../../utils/helpers';
import {
REPLAY_DEFAULT_FLUSH_MAX_DELAY,
getDecompressedRecordingEvents,
getReplaySnapshot,
isCustomSnapshot,
isReplayEvent,
REPLAY_DEFAULT_FLUSH_MAX_DELAY,
shouldSkipReplayTest,
waitForReplayRequest,
} from '../../../utils/replayHelpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-integration-tests/suites/wasm/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@playwright/test';
import fs from 'fs';
import path from 'path';
import { expect } from '@playwright/test';

import { sentryTest } from '../../utils/fixtures';
import { shouldSkipWASMTests } from '../../utils/wasmHelpers';
Expand Down
4 changes: 2 additions & 2 deletions packages/browser-integration-tests/utils/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-empty-pattern */
import { test as base } from '@playwright/test';
import fs from 'fs';
import path from 'path';
/* eslint-disable no-empty-pattern */
import { test as base } from '@playwright/test';

import { generatePage } from './generatePage';

Expand Down
4 changes: 2 additions & 2 deletions packages/browser-integration-tests/utils/generatePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Package } from '@sentry/types';
import fs from 'fs';
import HtmlWebpackPlugin, { createHtmlTagObject } from 'html-webpack-plugin';
import path from 'path';
import type { Package } from '@sentry/types';
import HtmlWebpackPlugin, { createHtmlTagObject } from 'html-webpack-plugin';
import type { Compiler } from 'webpack';

import { addStaticAsset, addStaticAssetSymlink } from './staticAssets';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { captureException, withScope } from '@sentry/core';
import type { DsnLike, Mechanism, WrappedFunction } from '@sentry/types';
import {
GLOBAL_OBJ,
addExceptionMechanism,
addExceptionTypeValue,
addNonEnumerableProperty,
getOriginalFunction,
GLOBAL_OBJ,
markFunctionWrapped,
} from '@sentry/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.bundle.replay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is exported so the loader does not fail when switching off Replay/Tracing
import { addTracingExtensions, BrowserTracing } from '@sentry-internal/integration-shims';
import { BrowserTracing, addTracingExtensions } from '@sentry-internal/integration-shims';
import { Replay } from '@sentry/replay';

import * as Sentry from './index.bundle.base';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.bundle.tracing.replay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addExtensionMethods, BrowserTracing, Span } from '@sentry-internal/tracing';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';
import { Replay } from '@sentry/replay';

import * as Sentry from './index.bundle.base';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.bundle.tracing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is exported so the loader does not fail when switching off Replay
import { Replay } from '@sentry-internal/integration-shims';
import { addExtensionMethods, BrowserTracing, Span } from '@sentry-internal/tracing';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';

import * as Sentry from './index.bundle.base';

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.bundle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is exported so the loader does not fail when switching off Replay/Tracing
import { addTracingExtensions, BrowserTracing, Replay } from '@sentry-internal/integration-shims';
import { BrowserTracing, Replay, addTracingExtensions } from '@sentry-internal/integration-shims';

import * as Sentry from './index.bundle.base';

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/integrations/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
XhrBreadcrumbHint,
} from '@sentry/types/build/types/breadcrumb';
import {
SENTRY_XHR_DATA_KEY,
addClickKeypressInstrumentationHandler,
addConsoleInstrumentationHandler,
addFetchInstrumentationHandler,
Expand All @@ -26,7 +27,6 @@ import {
logger,
parseUrl,
safeJoin,
SENTRY_XHR_DATA_KEY,
severityLevelFromString,
} from '@sentry/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/profiling/hubextensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { DEBUG_BUILD } from '../debug-build';
import { WINDOW } from '../helpers';
import type { JSSelfProfile } from './jsSelfProfiling';
import {
MAX_PROFILE_DURATION_MS,
addProfileToGlobalCache,
isAutomatedPageLoadTransaction,
MAX_PROFILE_DURATION_MS,
shouldProfileTransaction,
startJSSelfProfile,
} from './utils';
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/profiling/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import { DEFAULT_ENVIRONMENT, getCurrentHub } from '@sentry/core';
import type { DebugImage, Envelope, Event, StackFrame, StackParser, Transaction } from '@sentry/types';
import type { Profile, ThreadCpuProfile } from '@sentry/types/src/profiling';
import { browserPerformanceTimeOrigin, forEachEnvelopeItem, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils';
import { GLOBAL_OBJ, browserPerformanceTimeOrigin, forEachEnvelopeItem, logger, uuid4 } from '@sentry/utils';

import { DEBUG_BUILD } from '../debug-build';
import { getClient } from '../exports';
import { WINDOW } from '../helpers';
import type { JSSelfProfile, JSSelfProfiler, JSSelfProfilerConstructor, JSSelfProfileStack } from './jsSelfProfiling';
import type { JSSelfProfile, JSSelfProfileStack, JSSelfProfiler, JSSelfProfilerConstructor } from './jsSelfProfiling';

const MS_TO_NS = 1e6;
// Use 0 as main thread id which is identical to threadId in node:worker_threads
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Hub } from '@sentry/core';
import {
Integrations as CoreIntegrations,
getClient,
getCurrentHub,
getIntegrationsToSetup,
getReportDialogEndpoint,
initAndBind,
Integrations as CoreIntegrations,
} from '@sentry/core';
import type { UserFeedback } from '@sentry/types';
import {
Expand Down
10 changes: 5 additions & 5 deletions packages/browser/test/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { getReportDialogEndpoint, SDK_VERSION } from '@sentry/core';
import { SDK_VERSION, getReportDialogEndpoint } from '@sentry/core';
import type { WrappedFunction } from '@sentry/types';
import * as utils from '@sentry/utils';

import type { Event } from '../../src';
import {
addBreadcrumb,
BrowserClient,
Integrations,
Scope,
WINDOW,
addBreadcrumb,
captureEvent,
captureException,
captureMessage,
Expand All @@ -14,10 +17,7 @@ import {
getClient,
getCurrentHub,
init,
Integrations,
Scope,
showReportDialog,
WINDOW,
wrap,
} from '../../src';
import { getDefaultBrowserClientOptions } from './helper/browser-client-options';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getCurrentHub } from '@sentry/core';
import type { Client } from '@sentry/types';

import { Breadcrumbs, BrowserClient, flush, Hub } from '../../../src';
import { Breadcrumbs, BrowserClient, Hub, flush } from '../../../src';
import { getDefaultBrowserClientOptions } from '../helper/browser-client-options';

const hub = new Hub();
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/test/unit/sdk.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/unbound-method */
import { createTransport, Scope } from '@sentry/core';
import { Scope, createTransport } from '@sentry/core';
import type { Client, Integration } from '@sentry/types';
import { resolvedSyncPromise } from '@sentry/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/test/unit/transports/fetch.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TextEncoder } from 'util';
import type { EventEnvelope, EventItem } from '@sentry/types';
import { createEnvelope, serializeEnvelope } from '@sentry/utils';
import { TextEncoder } from 'util';

import { makeFetchTransport } from '../../../src/transports/fetch';
import type { BrowserTransportOptions } from '../../../src/transports/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/test/unit/transports/offline.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'fake-indexeddb/auto';

import { TextDecoder, TextEncoder } from 'util';
import { createTransport } from '@sentry/core';
import type {
EventEnvelope,
Expand All @@ -8,7 +9,6 @@ import type {
TransportMakeRequestResponse,
} from '@sentry/types';
import { createEnvelope } from '@sentry/utils';
import { TextDecoder, TextEncoder } from 'util';

import { MIN_DELAY } from '../../../../core/src/transports/offline';
import { createStore, insert, makeBrowserOfflineTransport, pop } from '../../../src/transports/offline';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/test/unit/transports/xhr.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TextEncoder } from 'util';
import type { EventEnvelope, EventItem } from '@sentry/types';
import { createEnvelope, serializeEnvelope } from '@sentry/utils';
import { TextEncoder } from 'util';

import type { BrowserTransportOptions } from '../../../src/transports/types';
import { makeXHRTransport } from '../../../src/transports/xhr';
Expand Down

0 comments on commit 27f6ae1

Please sign in to comment.