Conversation
lib/configs/vue3.ts
Outdated
| 'error', { | ||
| order: [ | ||
| 'defineOptions', | ||
| 'defineModel', | ||
| 'defineProps', | ||
| 'defineEmits', | ||
| 'defineSlots', | ||
| 'defineExpose', | ||
| ], | ||
| }, | ||
| ], |
There was a problem hiding this comment.
What do you think about defineExposeLast: true?
There was a problem hiding this comment.
Is there a difference?
There was a problem hiding this comment.
Yes. defineExposeLast: true moves defineExpose to the end of the entire script setup:
- Syntactically correct for exposing arrow function and variables
- Feels like (exposing after everything is defined), like with exports
There was a problem hiding this comment.
If this is the common way to group it yes. For me it feels easier to see everything API (props, events, slots, exposed) in the beginning and only if you are interested in the implementation scroll down to the definitions.
exposing arrow function and variables
IMHO you should just use function, but if variable can (and are) exposed sometimes it makes sense to move it down.
So no strong opinion on this, would do what you think is the common thing in Vue.
There was a problem hiding this comment.
would do what you think is the common thing in Vue
I thought that it was a common thing to put it to the end, but it is not defaulted in this eslint rule
Example: usage in the vue docs
When using `<script setup>` we should directly use the modern approach using `defineOptions` also we should have a defined order so its easier to navigate in components. Signed-off-by: Ferdinand Thiessen <[email protected]>
When using
<script setup>we should directly use the modern approach usingdefineOptionsalso we should have a defined order so its easier to navigate in components.@ShGKme as you are probably one of the heavy script-setup users, thats also the order in talk desktop right?