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

What's up with vue/experimental-script-setup-vars? #1882

Closed
FloEdelmann opened this issue May 7, 2022 · 3 comments
Closed

What's up with vue/experimental-script-setup-vars? #1882

FloEdelmann opened this issue May 7, 2022 · 3 comments
Labels

Comments

@FloEdelmann
Copy link
Member

FloEdelmann commented May 7, 2022

The vue/experimental-script-setup-vars rule was deprecated in #1528 (first released in v7.13.0), but without any explanation or replacement rule.

It seems like vue/script-setup-uses-vars (added in #1529, will be deprecated in #1849) is actually the replacement rule, as it was also first released in v7.13.0.

However, in tests/lib/script-setup.js, vue/experimental-script-setup-vars is still hardcoded. When I try to replace it with vue/script-setup-uses-vars there, the test fails:

  1) script-setup test cases
       temporary supports.
         should not be marked.:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:

+ expected
- actual

+[]
-[
-  {
-    "column": 37
-    "endColumn": 42
-    "endLine": 5
-    "line": 5
-    "message": "'props' is not defined."
-    "messageId": "undef"
-    "nodeType": "Identifier"
-    "ruleId": "no-undef"
-    "severity": 2
-  }
-  {
-    "column": 7
-    "endColumn": 11
-    "endLine": 6
-    "line": 6
-    "message": "'emit' is not defined."
-    "messageId": "undef"
-    "nodeType": "Identifier"
-    "ruleId": "no-undef"
-    "severity": 2
-  }
-]

CC @ota-meshi

@FloEdelmann
Copy link
Member Author

FloEdelmann commented May 7, 2022

It seems like the syntax in the test is an early version of the <script setup> RFC:

<script setup="props, { emit }">
import { watchEffect } from 'vue'
watchEffect(() => console.log(props.msg))
emit('foo')
</script>`

https://vuejs.org/api/sfc-script-setup.html has no references to <script setup="props"> anymore.

Since vue/script-setup-uses-vars has its own tests, I guess we can just delete tests/lib/script-setup.js then?

@ota-meshi
Copy link
Member

As you say, vue/script-setup-uses-vars is rule for syntax (as an experimental feature) that was available early in Vue v3.0.
I think we can remove tests/lib/script-setup.js.

@FloEdelmann
Copy link
Member Author

Alright, the test will be removed in #1881.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants