Skip to content

Conversation

@nikolas-sturm
Copy link

Description

Fixes the single line only magic comments to instead suppress biome across the whole file as expected.

Before:

> biome check

src/auto-imports.d.ts:6:1 suppressions/unused

  ⚠ Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.
  
    4 │ // noinspection JSUnusedGlobalSymbols
    5 │ // Generated by unplugin-auto-import
  > 6 │ // biome-ignore lint: disable
      │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    7 │ export {}
    8 │ declare global {
  

Checked 73 files in 15ms. Fixed 1 file.
Found 1 warning.

After:

> biome check

Checked 73 files in 18ms. No fixes applied.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ilyaliao
Copy link
Collaborator

ilyaliao commented Aug 3, 2025

Tested working in version 2.1.3, but it seems unable to prevent formatting

@nikolas-sturm
Copy link
Author

Ok. I've decided to rewrite the whole biomejs integration to also prevent formatting of the file. As of right now, biomejs unfortunately does not provide a magic comment to disable formatting. According to their docs, the intended solution is to use the negated matcher in the files.includes array in the biome.{json,jsonc} config. I have written a small function using the jsonc-parser that allows automatically updating this and is strictly opt-in. I have also added a separate test to make sure this works as intended. It also auto-detects the indentation style the user has in their biome.json file and uses that. Additionally, I removed the biomelintrc related functionality as it seems to be deprecated and does not exist anymore. In my testing, biome correctly reads from the generated .d.ts file and parses the globals.

@antfu
Copy link
Member

antfu commented Nov 27, 2025

I am not so sure about the complexity introduced here to support a simple ignore feature - shouldn't the Biome side provides better DX on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants