chore(biome): enable noUnusedImports rule#9895
Conversation
| 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.
Can you also open an issue to Biome for this?
There was a problem hiding this comment.
Turns out that it's a typescript bug, so i refactored this code a little.
| 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.
| // biome-ignore lint/nursery/noUnusedImports: Need React import for JSXq | |
| // biome-ignore lint/nursery/noUnusedImports: Need React import for JSX |
| // eslint-disable-next-line no-unused-vars | ||
| import * as _ from '@sentry/tracing'; |
There was a problem hiding this comment.
I think we did this on purpose, not sure if the change is safe
There was a problem hiding this comment.
The change should be safe, I validated by running integration tests.
There was a problem hiding this comment.
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.
The change should be safe, I validated by running integration tests.
| 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 |
| 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 |
| @@ -1,4 +1,3 @@ | |||
| import { get } from 'http'; | |||
There was a problem hiding this comment.
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/