Skip to content

Commit

Permalink
doc add description to vue-essential rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rrd108 committed Aug 6, 2024
1 parent c7779c9 commit 851a8b5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/rules/vue-essential/global-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@

Checks if the component is using global styles instead of `scoped` styles. &nbsp;&nbsp;<br />
👉 https://vuejs.org/style-guide/rules-essential.html#use-component-scoped-styling

## ❓ Why it's good to follow this rule?

- **Maintainability** limiting the `css` for the actual component makes it easier to maintain and understand.
- **Isolation** the component is isolated and has no unwanted effect on the other parts of the application.
- **Reusability** the component can be reused in other parts of the application with exactly the same look and feel.

4 changes: 4 additions & 0 deletions docs/rules/vue-essential/simple-prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

Checks if the component is using simple props definitions. &nbsp;&nbsp;<br />
👉 https://vuejs.org/style-guide/rules-essential.html#use-detailed-prop-definitions

## ❓ Why it's good to follow this rule?

- **Readability** the component is easier to understand in details.
5 changes: 5 additions & 0 deletions docs/rules/vue-essential/single-name-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

Checks if the component name is a single word. &nbsp;&nbsp;<br />
👉 https://vuejs.org/style-guide/rules-essential.html#use-multi-word-component-names

## ❓ Why it's good to follow this rule?

- **Consistency** the component name is consistent with the other components.
- **Readability** the component name is more descriptive about its goal.
4 changes: 4 additions & 0 deletions docs/rules/vue-essential/vfor-no-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
Checks if the component is using `v-for` without a `key` property. &nbsp;&nbsp;<br />
👉 https://vuejs.org/style-guide/rules-essential.html#use-keyed-v-for

## ❓ Why it's good to follow this rule?

- **Performance** adding a `key` property to the `v-for` loop helps Vue to identify the elements and update only the changed elements.
- In certain situations a missing `key` property can lead to unexpected behavior.
5 changes: 5 additions & 0 deletions docs/rules/vue-essential/vif-with-vfor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

Checks if the component is using `v-if` with `v-for`. &nbsp;&nbsp;<br />
👉 https://vuejs.org/style-guide/rules-essential.html#avoid-v-if-with-v-for

## ❓ Why it's good to follow this rule?

- **Performance** using `v-if` with `v-for` can lead to performance issues.
- **Readability** the component is easier to understand and maintain.

0 comments on commit 851a8b5

Please sign in to comment.