Rule proposition: order-in-components
See original GitHub issueAs I mentioned in #10, I think that creating separate issue for each rule proposition has many benefits, so this is my first proposition:
Rule name: order-in-components
Description: Keep order of properties in components according to https://docs.gitlab.com/ce/development/fe_guide/style_guide_js.html#ordering
Gitlab’s style guide lists all properties, I would however consider grouping lifecycle hooks in order to make it simpler, like so:
- name
- props
- mixins
- data
- components
- computedProps
- methods
- lifecycle hooks
Introducing order rule we can make sure that every component is written in exactly the same way, which would make it more readable and consistent across codebase.
This rule should be configurable, so that anyone can amend proposed order in .eslintrc
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Robert's Rules of Order
Robert's Rules of Order is the standard for facilitating discussions and group decision-making. Copies of the rules are available at most bookstores.
Read more >on some asymptotically nonparametric competitors of ... - jstor
Summary. In a previous paper [2] the author investigated some alternative estimates of shift in the p-variate one-sample problem. This paper examines the....
Read more >Category: Vuejs - Full Stack Programmer
Vuejs: Rule proposition of order-in-components ... It's important to keep one standard way of ordering properties in vue components, that will… Posted in ......
Read more >What's on the ballot? Here's a look at California's 2022 ...
Proposition 31 is a referendum on a law passed by the Legislature in 2020 to ban the sale of many flavored tobacco products...
Read more >International Journal of Plasticity - COMOD
ick (1966) law adapted to orthotropic material and isotropic hardening, ... mials of the third order in components of the stress, while the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I personally prefer having all assets at top of the component (like dependencies), and then group all state-related options (props, data, computed), hence:
Looks good - tweaked a bit more:
The main thing is I moved
template
up alongsideel
, and movedmethods
to be after lifecycle hooks.It’s interesting because putting
render
last is kind of a convention from React land, but I’m much more used to seeing templates earlier to get a visual understanding of a component.