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

💅 linter does not detect vue-bound attributes #2973

Closed
1 task done
rotu opened this issue May 24, 2024 · 2 comments
Closed
1 task done

💅 linter does not detect vue-bound attributes #2973

rotu opened this issue May 24, 2024 · 2 comments

Comments

@rotu
Copy link

rotu commented May 24, 2024

Environment information

$ px biome rage --linter 
CLI:
  Version:                      1.7.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.13.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.5.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Linter:
  Recommended:                  true
  All:                          false
  Rules:                        correctness/noUndeclaredVariables = "error"
                                correctness/noUnusedVariables = "error"

Workspace:
  Open Documents:               0

Rule name

lint/correctness/noUnusedVariables

Playground link

https://codesandbox.io/p/devbox/staging-resonance-kxcxp4?file=%2Fsrc%2Fmain.vue

Expected result

The rules correctness/noUnusedVariables and correctness/noUndeclaredVariables ignore whether variables are used in vue attributes.

<template>
  <p :style="style1"></p>
  <!-- false negative: /lint/correctness/noUndeclaredVariables -->
  <p :style="style2"></p>

  {{ text }}
</template>
<script setup>
// false positive: /lint/correctness/noUnusedVariables
const style1 = "color:red";
</script>

It seems like maybe only the <script> is checked, not embedded tags, so this might fall under #2239.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@nhedger
Copy link
Member

nhedger commented May 24, 2024

We currently do not parse the template tags, so that's expected unfortunately.

Support for Vue is still partial, so you may want to disable some rules for .vue files for the time being.

@ematipico
Copy link
Member

We explain this on our website

https://biomejs.dev/internals/language-support/#html-super-languages-support

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
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

No branches or pull requests

3 participants