Skip to content

💅 False-positive noUnusedImports error when a identifier is used only in template #7978

@eye-wave

Description

@eye-wave

Environment information

CLI:
  Version:                      2.3.3
  Color support:                true

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  true

Rule name

lint/correctness/noUnusedImports

Playground link

https://next.biomejs.dev/playground/?code=PABzAGMAcgBpAHAAdAA%2BAAoAIAAgAGkAbQBwAG8AcgB0ACAAewAgAEEAcABwACAAfQAgAGYAcgBvAG0AIAAiAC4ALwBBAHAAcAAuAHMAdgBlAGwAdABlACIAOwAKAAoAIAAgAGwAZQB0ACAAewAgAGMAaABpAGwAZAByAGUAbgAgAH0AIAA9ACAAJABwAHIAbwBwAHMAKAApAAoACgAgACAAbABlAHQAIABjAG8AdQBuAHQAIAA9ACAAJABzAHQAYQB0AGUAKAAwACkACgA8AC8AcwBjAHIAaQBwAHQAPgAKAAoAPABBAHAAcAAgAC8APgAKAHsAQAByAGUAbgBkAGUAcgAgAGMAaABpAGwAZAByAGUAbgA%2FAC4AKAApAH0ACgAKADwAYgB1AHQAdABvAG4APgB7AGMAbwB1AG4AdAB9ADwALwBiAHUAdAB0AG8AbgA%2BAAoA&language=svelte

Expected result

For imports or destructured props this is not a big issue, just an annoyance.

For variables declared with let, the linter can break the intended functionality making them into consts.

I haven't tested this in Vue or Astro

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-Needs triageStatus: this issue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions