-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Traditionally the block order in Vue SFC was:
- template
- script
- styles
But nowadays with script setup its a bit mixed between the mentioned order and:
- script-setup
- (script) [optional only used for module scope variables]
- template
- styles
The later has the benefit that template and styles often belong together and are now easier to jump between without need to skip JS.
Script often is only related to template but not styles.
So because of the mixed styles I would suggest to enforce a order here, either template-script or script-template.
Or at least do so for script-setup.
One example for script-setup could be:
{
"vue/block-order": ["error", {
"order": [ "script[setup]", [ "script:not([setup])", "template" ], "style" ]
}]
}This only enforces script-setup to come before template but ignore if you still use script and use <template><script> order
Reactions are currently unavailable