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

Add vue/valid-define-options to vue3-essential config #2653

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

waynzh
Copy link
Member

@waynzh waynzh commented Dec 17, 2024

Resolve the remaining todo in the code base.

Will added to #2166.

// TODO Switch in the next major version
// categories: ['vue3-essential', 'vue2-essential'],
categories: undefined,
categories: ['vue3-essential', 'vue2-essential'],
Copy link
Member

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.

Copy link
Member Author

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 ✅

Copy link
Member

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.

Copy link
Member Author

@waynzh waynzh Dec 17, 2024

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.

@waynzh waynzh changed the title Add vue/valid-define-options to essential config Add vue/valid-define-options to vue3-essential config Dec 17, 2024
@waynzh waynzh changed the title Add vue/valid-define-options to vue3-essential config Add vue/valid-define-options to vue3-essential config Dec 17, 2024
@waynzh waynzh mentioned this pull request Dec 17, 2024
@waynzh waynzh requested a review from FloEdelmann December 17, 2024 08:16
Copy link
Member

@FloEdelmann FloEdelmann left a 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 🙂

@waynzh waynzh merged commit 43d6a91 into vuejs:v10 Dec 17, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants