-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(biome): enable noUnusedImports rule #9895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -2,8 +2,10 @@ import * as Sentry from '@sentry/nextjs'; | |||
import type { WebFetchHeaders } from '@sentry/types'; | |||
// @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public | |||
// API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader. | |||
// biome-ignore lint/nursery/noUnusedImports: Biome doesn't understand the shim with variable import path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also open an issue to Biome for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done biomejs/biome#1269
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out that it's a typescript bug, so i refactored this code a little.
@@ -1,6 +1,7 @@ | |||
import type { SpanContext } from '@sentry/types'; | |||
import { render } from '@testing-library/react'; | |||
import { renderHook } from '@testing-library/react-hooks'; | |||
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSXq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSXq | |
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9249efe
// eslint-disable-next-line no-unused-vars | ||
import * as _ from '@sentry/tracing'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we did this on purpose, not sure if the change is safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change should be safe, I validated by running integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm it isn't I reverted.
// eslint-disable-next-line no-unused-vars | ||
import * as _ from '@sentry/tracing'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change should be safe, I validated by running integration tests.
@@ -2,8 +2,10 @@ import * as Sentry from '@sentry/nextjs'; | |||
import type { WebFetchHeaders } from '@sentry/types'; | |||
// @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public | |||
// API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader. | |||
// biome-ignore lint/nursery/noUnusedImports: Biome doesn't understand the shim with variable import path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done biomejs/biome#1269
@@ -1,6 +1,7 @@ | |||
import type { SpanContext } from '@sentry/types'; | |||
import { render } from '@testing-library/react'; | |||
import { renderHook } from '@testing-library/react-hooks'; | |||
// biome-ignore lint/nursery/noUnusedImports: Need React import for JSXq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9249efe
@@ -1,4 +1,3 @@ | |||
import { get } from 'http'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug that was caught from this, I'd rather we merge this sooner rather than later.
@anonrig this is ready for another review! |
Adds https://biomejs.dev/linter/rules/no-unused-imports/