Closed
Description
Nuxt.js's asyncData, fetch and head component properties were already added to the order-in-components
rule.
There are others, though:
Additionally, Vue Router defines three in-component navigation guards:
- beforeRouteEnter
- beforeRouteUpdate
- beforeRouteLeave
It would be useful to have them included in the default rule config to enforce a consistent style.
I'd like to suggest the following order:
// side effects
"el",
// global awareness
"name",
+ "key",
"parent",
// component type
"functional",
// template modifiers
["delimiters", "comments"],
// template dependencies
["components", "directives", "filters"],
// composition
"extends",
"mixins",
+ // new category: page validation
+ "beforeRouteEnter",
+ "beforeRouteUpdate",
+ "beforeRouteLeave",
+ "middleware",
+ "validate",
// interface
"inheritAttrs",
"model",
["props", "propsData"],
// local state
"fetch",
"asyncData",
"data",
"computed",
// events
"watch",
+ "watchQuery",
"LIFECYCLE_HOOKS",
// non-reactive properties
"methods",
"head",
// rendering
+ "layout",
["template", "render"],
"renderError",
+ "transition",
+ "loading",
+ "scrollToTop",
Metadata
Metadata
Assignees
Labels
No labels