sort of declaration of script setup in Vue 3
npm install eslint-vue-setup-rules in Vue 3. are sorted in the following fixed order:
"type",
"defineProps",
"defineEmits",
"defineSlots",
"defineModel",
"defineOptions",
"class",
"plainVars",
"reactiveVars",
"composables",
"computed",
"watchers",
"lifecycle",
"unknowns",
"functions",
"defineExpose"
`
$3
A single blank line (which corresponds to two consecutive newline characters) is inserted between different groups.
This means that if you have a group of define declarations followed by another group (such as "plainVars"),
there will be one blank line between these groups in the final sorted output.
Example: Consider the following two groups:
_Group 1 (defineProps):_
`js
const aa = defineProps<{ msg: string }>();
`
_Group 2 (plain variable declarations):_
`js
const hello = "Hello World!";
const count = 0
`
The final sorted output will be:
`js
const aa = defineProps<{ msg: string }>();const hello = "Hello World!";
const count = 0
`
Notice the blank line between the two groups, which helps visually separate different types of declarations.
π Section Order Customization
By default, the rule enforces the predefined order of declarations within
`
After (fixed):
`js``