-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Nuxt 3: auto imported ref will not trigger vue/no-ref-as-operand
warning
#1969
Comments
Thank you for posting issue. If the way If you want to check it in a |
Hey Yosuke,
Sounds good. Also, eslint-config from nuxt (https://github.com/nuxt/eslint-config/blob/main/packages/eslint-config/package.json#L17) has
If you provide a way to define this for the rule, would both ways of importing work? Nuxt auto imported |
I think the rule is probably to check both |
Hey again, is there some kind of roadmap when this will be tackled? |
Nuxt 3 is out. Would be really helpful having this. |
I think we should first list all the rules that have problems with auto-import. We then need to consider what additional options would be best for any given user. But I'm not familiar with nuxt and can't find the time to do it. So we'll have to wait for someone to list the rules and summarize what problems each has. |
Ok, understood. I will reopen my issue at the nuxt repo and ask for help from the nuxt team. |
does this issue have any workaround solutions? |
Made a PR: #2422 |
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
Context: I am using Nuxt 3 and already filed an issue in their repo: nuxt/nuxt#14882
They said, I should first ask here...
I'm posting here my original question from the linked issue:
I'm constantly forgetting to add
.value
when working with refs and wondered why eslint is not helping me – no visual hints in VS Code and no error when running eslint in terminal.There is a rule from
eslint-plugin-vue
to catch this: vue/no-ref-as-operandTurns out, the auto imported
ref
from#imports
is somehow "different" than directly importing fromvue
.If I do
import { ref } from 'vue'
, I get squiggly lines in VS Code and.value
is automatically added when I save the file.See also simple reproduction below.
What did you expect to happen?
Lint errors, both visually in VS Code and via terminal.
What actually happened?
No errors reported.
Repository to reproduce this issue
https://stackblitz.com/edit/github-cyy9sn?file=app.vue
run
npm run lint
to check outputThe text was updated successfully, but these errors were encountered: