Skip to content
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

💅 Shows "All these imports are only used as types" in Vue+typescript #4539

Closed
1 task done
lethefrost opened this issue Nov 14, 2024 · 1 comment
Closed
1 task done
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@lethefrost
Copy link

Environment information

Biome 1.9.4(bundled)

Rule name

useImportType

Playground link

https://biomejs.dev/playground/?files.main.vue=PAB0AGUAbQBwAGwAYQB0AGUAPgAKACAAIAA8AFQAZQBzAHQAQwBvAG0AcABvAG4AZQBuAHQAPgAKACAAIAAgACAALgAuAC4ACgAgACAAPAAvAFQAZQBzAHQAQwBvAG0AcABvAG4AZQBuAHQAPgAKADwALwB0AGUAbQBwAGwAYQB0AGUAPgAKAAoAPABzAGMAcgBpAHAAdAAgAHMAZQB0AHUAcAAgAGwAYQBuAGcAPQAiAHQAcwAiAD4ACgAgACAAIAAgAGkAbQBwAG8AcgB0ACAAVABlAHMAdABDAG8AbQBwAG8AbgBlAG4AdAAgAGYAcgBvAG0AIAAnAC4ALwBUAGUAcwB0AEMAbwBtAHAAbwBuAGUAbgB0AC4AdgB1AGUAJwAKACAAIAAgACAAYwBvAG4AcwB0ACAAdABlAHMAdABUAHkAcABlACAAPQAgAEkAbgBzAHQAYQBuAGMAZQBUAHkAcABlADwAdAB5AHAAZQBvAGYAIABUAGUAcwB0AEMAbwBtAHAAbwBuAGUAbgB0AD4ACgA8AC8AcwBjAHIAaQBwAHQAPgA%3D

Expected result

Please see the playground: if the line of typeof doesn't exist, biome won't have problem with unused import or something, but when you have the typeof line and when it is the only reference to the imported component inside the script tag, biome will report All these imports are only used as types. despite the usage outside the script tag.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@lethefrost lethefrost added the S-Needs triage Status: this issue needs to be triaged label Nov 14, 2024
@dyc3
Copy link
Contributor

dyc3 commented Nov 14, 2024

We only partially support vue files right now. See: https://biomejs.dev/internals/language-support/#html-super-languages-support

We recommend disabling these rules for these files until they are better supported.

  {
    "overrides": [
      {
        "include": ["*.svelte", "*.astro", "*.vue"],
        "linter": {
          "rules": {
            "style": {
              "useConst": "off",
              "useImportType": "off"
            }
          }
        }
      }
    ]
  }

@dyc3 dyc3 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants