From c7779c915e2e274aea1118803c1f54ce2303b9ea Mon Sep 17 00:00:00 2001 From: rrd108 Date: Tue, 6 Aug 2024 15:38:18 +0200 Subject: [PATCH] doc add descriptions to vue-strong rules --- docs/rules/vue-strong/directive-shorthands.md | 5 +++++ docs/rules/vue-strong/prop-name-casing.md | 5 +++++ docs/rules/vue-strong/quoted-attribute-values.md | 5 +++++ docs/rules/vue-strong/self-closing-components.md | 5 +++++ docs/rules/vue-strong/simple-computed.md | 10 ++++++++++ docs/rules/vue-strong/template-simple-expression.md | 6 ++++++ 6 files changed, 36 insertions(+) diff --git a/docs/rules/vue-strong/directive-shorthands.md b/docs/rules/vue-strong/directive-shorthands.md index dc7d8e92..7d611201 100644 --- a/docs/rules/vue-strong/directive-shorthands.md +++ b/docs/rules/vue-strong/directive-shorthands.md @@ -6,3 +6,8 @@ Checks if the template is using directive shorthands.   
::: warning This rule enforces using directive shorthands for better readability. While the official style guide allows using shorthands "**always** or **never**", this rule will flag non-shorthands as code smell. ::: + +## ❓ Why it's good to follow this rule? + +- **Readability:** Directive shorthands are easier to read and understand and result in a shorter block of code. +- **Consistency:** Using shorthands makes the code more consistent and easier to maintain. diff --git a/docs/rules/vue-strong/prop-name-casing.md b/docs/rules/vue-strong/prop-name-casing.md index b0adf165..08800f66 100644 --- a/docs/rules/vue-strong/prop-name-casing.md +++ b/docs/rules/vue-strong/prop-name-casing.md @@ -2,3 +2,8 @@ Checks if the props name is in camelCase.   
👉 https://vuejs.org/style-guide/rules-strongly-recommended.html#prop-name-casing + +## ❓ Why it's good to follow this rule? + +- **Readability**: CamelCase prop names are easier to read and understand. +- **Consistency**: CamelCase prop names are consistent with the naming of files and folders. diff --git a/docs/rules/vue-strong/quoted-attribute-values.md b/docs/rules/vue-strong/quoted-attribute-values.md index 2793a13c..411e1816 100644 --- a/docs/rules/vue-strong/quoted-attribute-values.md +++ b/docs/rules/vue-strong/quoted-attribute-values.md @@ -2,3 +2,8 @@ Checks if the template is using quoted attribute values.   
👉 https://vuejs.org/style-guide/rules-strongly-recommended.html#quoted-attribute-values + +## ❓ Why it's good to follow this rule? + +- **Readability:** Quoted attribute values are easier to read and understand. +- **Consistency:** Using quoted attribute values makes the code more consistent and easier to maintain. diff --git a/docs/rules/vue-strong/self-closing-components.md b/docs/rules/vue-strong/self-closing-components.md index 74f5a4f6..5d27e0e4 100644 --- a/docs/rules/vue-strong/self-closing-components.md +++ b/docs/rules/vue-strong/self-closing-components.md @@ -2,3 +2,8 @@ Checks if the template is using self-closing components.   
👉 https://vuejs.org/style-guide/rules-strongly-recommended.html#self-closing-components + +## ❓ Why it's good to follow this rule? + +- **Readability:** Self-closing components are easier to read and understand and result in a shorted code block. +- **Consistency:** Using self-closing components makes the code more consistent and easier to maintain. diff --git a/docs/rules/vue-strong/simple-computed.md b/docs/rules/vue-strong/simple-computed.md index 2d311cc5..0fdd3af4 100644 --- a/docs/rules/vue-strong/simple-computed.md +++ b/docs/rules/vue-strong/simple-computed.md @@ -2,3 +2,13 @@ Checks if any computed properties are bigger than 5 lines.   
👉 https://vuejs.org/style-guide/rules-strongly-recommended.html#simple-computed-properties + +## ❓ Why it's good to follow this rule? + +- **Simple Responsibility:** Shorter computed properties have a single responsibility and can be really focused. +- **Readability:** Shorter computed properties are easier to read and understand. +- **Maintainability:** Shorter computed properties are easier to maintain and refactor. +- **Performance:** Shorter computed properties are faster to compute. +- **Consistency:** Shorter computed properties are consistent with the naming of files and folders. +- **Debugging:** Shorter computed properties are easier to debug. +- **Testing:** Shorter computed properties are easier to test. diff --git a/docs/rules/vue-strong/template-simple-expression.md b/docs/rules/vue-strong/template-simple-expression.md index 4e9118f6..a9c211d6 100644 --- a/docs/rules/vue-strong/template-simple-expression.md +++ b/docs/rules/vue-strong/template-simple-expression.md @@ -2,3 +2,9 @@ Checks if the template is using only simple expressions.   
👉 https://vuejs.org/style-guide/rules-strongly-recommended.html#simple-expressions-in-templates + +## ❓ Why it's good to follow this rule? + +- **Simplicity:** Simple expressions are easier to read and understand. +- **Readability:** Simple expressions are easier to read and understand. +- **Consistency:** Using simple expressions makes the code more consistent and easier to maintain.