Skip to content

vue/block-order

enforce order of component top-level elements

  • ⚙️ This rule is included in all of "plugin:vue/recommended", *.configs["flat/recommended"], "plugin:vue/vue2-recommended" and *.configs["flat/vue2-recommended"].
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule warns about the order of the top-level tags, such as <script>, <template> & <style>.

🔧 Options

json
{
  "vue/block-order": ["error", {
    "order": [ [ "script", "template" ], "style" ]
  }]
}
  • order ((string|string[])[]) ... The order of top-level element names. default [ [ "script", "template" ], "style" ]. May also be CSS selectors, such as script[setup] and i18n:not([locale=en]).

{ "order": [ [ "script", "template" ], "style" ] } (default)

Now loading...
Now loading...
Now loading...

{ "order": ["template", "script", "style"] }

Now loading...
Now loading...

{ "order": ["docs", "template", "script", "style"] }

Now loading...
Now loading...

{ 'order': ['template', 'script:not([setup])', 'script[setup]'] }

Now loading...
Now loading...

{ 'order': ['template', 'style:not([scoped])', 'style[scoped]'] }

Now loading...
Now loading...

{ 'order': ['template', 'i18n:not([locale=en])', 'i18n[locale=en]'] }

Now loading...
Now loading...

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-vue v9.16.0

🔍 Implementation

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy