-
-
Notifications
You must be signed in to change notification settings - Fork 675
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 vue/valid-define-options
to vue3-essential
config
#2653
Conversation
lib/rules/valid-define-options.js
Outdated
// TODO Switch in the next major version | ||
// categories: ['vue3-essential', 'vue2-essential'], | ||
categories: undefined, | ||
categories: ['vue3-essential', 'vue2-essential'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is defineOptions
even supported in Vue 2? If not, then it makes no sense to add this rule to the vue2-essentials
config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can only be used in <script setup>
syntax. Removed ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vue 2.7 added support for <script setup>
(see https://blog.vuejs.org/posts/vue-2-7-naruto), but I think defineOptions
was added later to Vue 3 and never backported to Vue 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm not very familiar with Vue 2.7, I'll check whether defineOptions
was introduced in Vue 2.7.
Since vue/valid-define-emits
and vue/valid-define-props
are in the essential
category for both Vue 2 and Vue 3.
Update: Yep, you're right, defineOptions
was never added back to Vue 2. So, setting the category as vue3-essential
should be enough.
vue/valid-define-options
to vue3-essential
config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🙂
Resolve the remaining todo in the code base.
Will added to #2166.