Skip to content

Commit 9ac07a4

Browse files
committed
chore(biome): enable noUnusedImports rule
1 parent 8fb1a2f commit 9ac07a4

File tree

37 files changed

+38
-32
lines changed

37 files changed

+38
-32
lines changed

biome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"suspicious": {
2121
"all": false,
2222
"noControlCharactersInRegex": "error"
23+
},
24+
"nursery": {
25+
"noUnusedImports": "error"
2326
}
2427
},
2528
"ignore": [".vscode/*", "**/*.json"]

packages/angular/test/tracing.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component } from '@angular/core';
22
import type { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router';
3-
import type { Hub } from '@sentry/types';
43

54
import { TraceClassDecorator, TraceDirective, TraceMethodDecorator, instrumentAngularRouting } from '../src';
65
import { getParameterizedRouteFromSnapshot } from '../src/tracing';

packages/astro/test/server/middleware.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as SentryNode from '@sentry/node';
22
import type { Client } from '@sentry/types';
3-
import { SpyInstance, vi } from 'vitest';
3+
import { vi } from 'vitest';
44

55
import { handleRequest, interpolateRouteFromUrlAndParams } from '../../src/server/middleware';
66

packages/browser-integration-tests/suites/public-api/startTransaction/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as Sentry from '@sentry/browser';
2-
// eslint-disable-next-line no-unused-vars
3-
import * as _ from '@sentry/tracing';
2+
import '@sentry/tracing';
43

54
window.Sentry = Sentry;
65

packages/core/src/metrics/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { MeasurementUnit, MetricBucketItem } from '@sentry/types';
22
import { dropUndefinedKeys } from '@sentry/utils';
3-
import type { MetricType, SimpleMetricBucket } from './types';
3+
import type { MetricType } from './types';
44

55
/**
66
* Generate bucket key from metric properties.

packages/deno/src/integrations/deno-cron.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { withMonitor } from '@sentry/core';
22
import type { Integration } from '@sentry/types';
3-
import type { DenoClient } from '../client';
43
import { parseScheduleToString } from './deno-cron-format';
54

65
type CronOptions = { backoffSchedule?: number[]; signal?: AbortSignal };

packages/deno/src/integrations/globalhandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ServerRuntimeClient } from '@sentry/core';
2-
import { getClient, getCurrentHub, getCurrentScope } from '@sentry/core';
2+
import { getClient, getCurrentHub } from '@sentry/core';
33
import { flush } from '@sentry/core';
44
import type { Event, Hub, Integration, Primitive, StackParser } from '@sentry/types';
55
import { eventFromUnknownInput, isPrimitive } from '@sentry/utils';

packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { PassThrough } from 'node:stream';
88

9-
import type { AppLoadContext, DataFunctionArgs, EntryContext } from '@remix-run/node';
9+
import type { AppLoadContext, EntryContext } from '@remix-run/node';
1010
import { createReadableStreamFromReadable } from '@remix-run/node';
1111
import { installGlobals } from '@remix-run/node';
1212
import { RemixServer } from '@remix-run/react';

packages/e2e-tests/test-applications/create-remix-app/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { PassThrough } from 'node:stream';
88

9-
import type { AppLoadContext, DataFunctionArgs, EntryContext } from '@remix-run/node';
9+
import type { AppLoadContext, EntryContext } from '@remix-run/node';
1010
import { Response } from '@remix-run/node';
1111
import { RemixServer } from '@remix-run/react';
1212
import * as Sentry from '@sentry/remix';
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
22
// we need to import the SDK to ensure tsc check the types
3-
import * as _SentryBrowser from '@sentry/browser';
4-
import * as _SentryCore from '@sentry/core';
5-
import * as _SentryHub from '@sentry/hub';
6-
import * as _SentryIntegrations from '@sentry/integrations';
7-
import * as _SentryNode from '@sentry/node';
8-
import * as _SentryOpentelemetry from '@sentry/opentelemetry-node';
9-
import * as _SentryReplay from '@sentry/replay';
10-
import * as _SentryTracing from '@sentry/tracing';
11-
import * as _SentryTypes from '@sentry/types';
12-
import * as _SentryUtils from '@sentry/utils';
13-
import * as _SentryWasm from '@sentry/wasm';

packages/e2e-tests/test-applications/nextjs-app-dir/tests/async-context-edge.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from '@playwright/test';
2-
import { waitForError, waitForTransaction } from '../event-proxy-server';
2+
import { waitForTransaction } from '../event-proxy-server';
33

44
test('Should allow for async context isolation in the edge SDK', async ({ request }) => {
55
// test.skip(process.env.TEST_ENV === 'development', "Doesn't work in dev mode.");

packages/e2e-tests/test-applications/node-hapi-app/tests/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from '@playwright/test';
2-
import axios, { AxiosError, AxiosResponse } from 'axios';
2+
import axios, { AxiosError } from 'axios';
33
import { waitForError, waitForTransaction } from '../event-proxy-server';
44

55
const authToken = process.env.E2E_TEST_AUTH_TOKEN;

packages/e2e-tests/test-applications/react-create-hash-router/src/pages/Index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as Sentry from '@sentry/react';
2-
import * as React from 'react';
2+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
3+
import * as React from 'react';
34
import { Link } from 'react-router-dom';
45

56
const Index = () => {

packages/e2e-tests/test-applications/react-create-hash-router/src/pages/User.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
12
import * as React from 'react';
23

34
const User = () => {

packages/e2e-tests/test-applications/react-router-6-use-routes/src/pages/Index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as Sentry from '@sentry/react';
2+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
23
import * as React from 'react';
34
import { Link } from 'react-router-dom';
45

packages/e2e-tests/test-applications/react-router-6-use-routes/src/pages/User.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
12
import * as React from 'react';
23

34
const User = () => {

packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as Sentry from '@sentry/react';
2+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
23
import * as React from 'react';
34
import { Link } from 'react-router-dom';
45

packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/User.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
12
import * as React from 'react';
23

34
const User = () => {

packages/e2e-tests/test-applications/standard-frontend-react/src/pages/Index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as Sentry from '@sentry/react';
2+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
23
import * as React from 'react';
34
import { Link } from 'react-router-dom';
45

packages/e2e-tests/test-applications/standard-frontend-react/src/pages/User.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
12
import * as React from 'react';
23

34
const User = () => {

packages/gatsby/test/integration.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TextDecoder, TextEncoder } from 'util';
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33
import { render } from '@testing-library/react';
44
import { useEffect } from 'react';
5-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
66
import * as React from 'react';
77

88
import { onClientEntry } from '../gatsby-browser';

packages/nextjs/src/common/_error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { captureException, getClient, withScope } from '@sentry/core';
1+
import { captureException, withScope } from '@sentry/core';
22
import type { NextPageContext } from 'next';
33
import { flushQueue } from './utils/responseEnd';
44

packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import * as Sentry from '@sentry/nextjs';
22
import type { WebFetchHeaders } from '@sentry/types';
33
// @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public
44
// API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader.
5+
// biome-ignore lint/nursery/noUnusedImports: Biome doesn't understand the shim with variable import path
56
import { requestAsyncStorage } from '__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__';
67
// @ts-expect-error See above
8+
// biome-ignore lint/nursery/noUnusedImports: Biome doesn't understand the shim with variable import path
79
import * as routeModule from '__SENTRY_WRAPPING_TARGET_FILE__';
810

911
import type { RequestAsyncStorage } from './requestAsyncStorageShim';

packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import * as Sentry from '@sentry/nextjs';
22
import type { WebFetchHeaders } from '@sentry/types';
33
// @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public
44
// API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader.
5+
// biome-ignore lint/nursery/noUnusedImports: Biome doesn't understand the shim with variable import path
56
import { requestAsyncStorage } from '__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__';
67
// @ts-expect-error We use `__SENTRY_WRAPPING_TARGET_FILE__` as a placeholder for the path to the file being wrapped.
8+
// biome-ignore lint/nursery/noUnusedImports: Biome doesn't understand the shim with variable import path
79
import * as serverComponentModule from '__SENTRY_WRAPPING_TARGET_FILE__';
810

911
import type { RequestAsyncStorage } from './requestAsyncStorageShim';

packages/nextjs/src/edge/wrapApiHandlerWithSentry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCurrentHub, getCurrentScope } from '@sentry/core';
1+
import { getCurrentScope } from '@sentry/core';
22

33
import { withEdgeWrapping } from '../common/utils/edgeWrapperUtils';
44
import type { EdgeRouteHandler } from './types';

packages/nextjs/test/integration/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Head from 'next/head';
22
import Link from 'next/link';
3-
import React, { ReactNode } from 'react';
3+
import { ReactNode } from 'react';
44

55
type Props = {
66
children?: ReactNode;

packages/nextjs/test/integration/components/List.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
12
import * as React from 'react';
23
import { User } from '../interfaces';
34
import ListItem from './ListItem';

packages/nextjs/test/integration/components/ListDetail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
12
import * as React from 'react';
23

34
import { User } from '../interfaces';

packages/nextjs/test/integration/components/ListItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from 'next/link';
2+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
23
import React from 'react';
34

45
import { User } from '../interfaces';

packages/node-experimental/src/integrations/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SpanKind } from '@opentelemetry/api';
44
import { registerInstrumentations } from '@opentelemetry/instrumentation';
55
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
66
import { addBreadcrumb, hasTracingEnabled, isSentryRequestUrl } from '@sentry/core';
7-
import { _INTERNAL, getClient, getCurrentHub, getSpanKind, setSpanMetadata } from '@sentry/opentelemetry';
7+
import { _INTERNAL, getClient, getSpanKind, setSpanMetadata } from '@sentry/opentelemetry';
88
import type { EventProcessor, Hub, Integration } from '@sentry/types';
99
import { stringMatchesSomePattern } from '@sentry/utils';
1010

packages/react/test/profiler.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { SpanContext } from '@sentry/types';
22
import { render } from '@testing-library/react';
33
import { renderHook } from '@testing-library/react-hooks';
4+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSXq
45
import * as React from 'react';
56

67
import { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP } from '../src/constants';

packages/react/test/reactrouterv4.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { act, render } from '@testing-library/react';
22
import { createMemoryHistory } from 'history-4';
3+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
34
import * as React from 'react';
45
import { Route, Router, Switch, matchPath } from 'react-router-4';
56

packages/react/test/reactrouterv5.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { act, render } from '@testing-library/react';
22
import { createMemoryHistory } from 'history-4';
3+
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX
34
import * as React from 'react';
45
import { Route, Router, Switch, matchPath } from 'react-router-5';
56

packages/react/test/redux.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as Sentry from '@sentry/browser';
2-
import type { Scope } from '@sentry/types';
32
import * as Redux from 'redux';
43

54
import { createReduxEnhancer } from '../src/redux';

packages/remix/test/integration/app_v2/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DataFunctionArgs, EntryContext } from '@remix-run/node';
1+
import type { EntryContext } from '@remix-run/node';
22
import { RemixServer } from '@remix-run/react';
33
import * as Sentry from '@sentry/remix';
44
import { renderToString } from 'react-dom/server';

packages/remix/test/integration/common/routes/server-side-unexpected-errors.$id.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ActionFunction, LoaderFunction, json, redirect } from '@remix-run/node';
1+
import { ActionFunction } from '@remix-run/node';
22
import { useActionData } from '@remix-run/react';
33

44
export const action: ActionFunction = async ({ params: { id } }) => {

packages/vue/src/tracing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCurrentHub, getCurrentScope } from '@sentry/browser';
1+
import { getCurrentScope } from '@sentry/browser';
22
import type { Span, Transaction } from '@sentry/types';
33
import { logger, timestampInSeconds } from '@sentry/utils';
44

0 commit comments

Comments
 (0)