Closed
Description
In the documentation I found this example which didn't work. I made it work by removing the additional parentheses.
Did not work
{
"vue/block-order": ["error", {
"order": [ [ "script", "template" ], "style" ]
}]
}
Worked for me
"vue/block-order": ["error", { order: ["script", "template", "style"] }],
If I'm not the only one, I think it's just a small documentation error.
Activity
waynzh commentedon May 18, 2025
The docs seems to be fine. Please follow the bug report template and provide more detailed information.
The outer array defines the overall order, while the inner array indicates that the order among these elements is interchangeable.
sbrauch commentedon May 21, 2025
Hey,
Thanks for your quick reply.
I've tried again with a college and another computer but it doesn't seem to work. I have a simple configuration where some files in my project have the order
template, script, style
and somescript, template, style
.I want all of them to change to and always be
script, template, style
.When I implement it without the inner array it works. This works meaning the import order becomes the one that I have defined:

This doesn't work, meaning when I save the import order does not change.
FloEdelmann commentedon May 21, 2025
The inner array means "the order of these is irrelevant", i.e.
[["script", "template"], "style"]
means both["script", "template", "style"]
and["template", "script", "style"]
are valid. This is exactly what you noticed. If you want to force a specific order, please specify it without an inner array.I'll close this issue because the rule is working as intended and the docs are correct. If you think the docs can be improved, feel free to comment or open a PR 🙂