Skip to content

Commit

Permalink
chore: Keep Nuxt's 'asyncData' and 'fetch' with 'data' (#823)
Browse files Browse the repository at this point in the history
* chore: Keep Nuxt's 'asyncData' and 'fetch' with 'data'

Change the order of asyncData and fetch properties to be next
to data property. All those are function-wise more or less
equivalent so IMO it makes sense to keep them together. asyncData
and fetch are primarily for setting up component's data.

* Update order per review

* Add also 'head' property

* Change order of 'head'
  • Loading branch information
rchl authored and ota-meshi committed Aug 17, 2019
1 parent d822a03 commit 27fc35c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/rules/order-in-components.md
Expand Up @@ -74,11 +74,14 @@ export default {
"inheritAttrs",
"model",
["props", "propsData"],
"fetch",
"asyncData",
"data",
"computed",
"watch",
"LIFECYCLE_HOOKS",
"methods",
"head",
["template", "render"],
"renderError"
]
Expand Down
5 changes: 3 additions & 2 deletions lib/rules/order-in-components.js
Expand Up @@ -19,13 +19,14 @@ const defaultOrder = [
'inheritAttrs',
'model',
['props', 'propsData'],
'fetch',
'asyncData',
'data',
'computed',
'watch',
'asyncData',
'fetch',
'LIFECYCLE_HOOKS',
'methods',
'head',
['template', 'render'],
'renderError'
]
Expand Down

0 comments on commit 27fc35c

Please sign in to comment.