-
-
Notifications
You must be signed in to change notification settings - Fork 681
Add Reactivity Transform macros #1799
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
Add Reactivity Transform macros #1799
Conversation
Thank you for opening this PR. After the Reactivity Transform RFCs have been merged, we will work to support it. |
Ok, thanks for the clarification! |
@ota-meshi But I am getting an error I don't want to turn this rule off completely, what can I do? |
This is a different ESLint rule: https://eslint.org/docs/rules/prefer-const Please use |
Vue Reactivity Transform actually requires that you use |
Are you sure? Most of the examples on the linked page do use Note that I also found this related comment in the RFC: vuejs/rfcs#369 (reply in thread) |
You can use either // Written input
let id = $ref(0)
const age = $ref(0)
id++ // 1
age++ // 1
// is actually (simplified):
// Compiled output
let id = { value: 0 }
const age = { value: 0 }
id.value++ // 1
age.value++ // 1 ESLint doesn't know the output of the Vue compiler, it can only analyze the code you write. You'd probably have to modify the |
At least in your example, both Modifying the core ESLint |
Closes #1798
I noticed that the new Reactivity Transform macros were missing in the
vue/setup-compiler-macros
option, resulting in e.g.'$ref' is not defined no-undef
errors when not explicitly importing the macros.I hope this implementation is correct. I looked at #1685 as an example.