From ea36831a861410bb61949ee401f6ad8dd5426a43 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Thu, 16 Jan 2020 23:24:06 +0900 Subject: [PATCH] Change the ruleset for categories - Change `plugin:vue/essential` config - Add `vue/valid-v-bind-sync` rule - Add `vue/valid-v-slot` rule - Change `plugin:vue/strongly-recommended` config - Add `vue/component-definition-name-casing` rule - Add `vue/v-slot-style` rule - Remove `vue/name-property-casing` rule - Change `plugin:vue/recommended` config - Add `vue/component-tags-order` rule - To deprecate `vue/name-property-casing` rule. --- docs/rules/README.md | 12 ++++++------ docs/rules/component-definition-name-casing.md | 1 + docs/rules/component-tags-order.md | 2 ++ docs/rules/name-property-casing.md | 2 +- docs/rules/v-slot-style.md | 1 + docs/rules/valid-v-bind-sync.md | 2 ++ docs/rules/valid-v-slot.md | 2 ++ lib/configs/essential.js | 2 ++ lib/configs/recommended.js | 1 + lib/configs/strongly-recommended.js | 5 +++-- lib/rules/component-definition-name-casing.js | 4 +--- lib/rules/component-tags-order.js | 4 +--- lib/rules/name-property-casing.js | 6 +++--- lib/rules/v-slot-style.js | 4 +--- lib/rules/valid-v-bind-sync.js | 4 +--- lib/rules/valid-v-slot.js | 4 +--- 16 files changed, 29 insertions(+), 27 deletions(-) diff --git a/docs/rules/README.md b/docs/rules/README.md index 30c0f93d1..42623f8d4 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -58,6 +58,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi | [vue/return-in-computed-property](./return-in-computed-property.md) | enforce that a return statement is present in computed property | | | [vue/use-v-on-exact](./use-v-on-exact.md) | enforce usage of `exact` modifier on `v-on` | | | [vue/valid-template-root](./valid-template-root.md) | enforce valid template root | | +| [vue/valid-v-bind-sync](./valid-v-bind-sync.md) | enforce valid `.sync` modifier on `v-bind` directives | | | [vue/valid-v-bind](./valid-v-bind.md) | enforce valid `v-bind` directives | | | [vue/valid-v-cloak](./valid-v-cloak.md) | enforce valid `v-cloak` directives | | | [vue/valid-v-else-if](./valid-v-else-if.md) | enforce valid `v-else-if` directives | | @@ -70,6 +71,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi | [vue/valid-v-once](./valid-v-once.md) | enforce valid `v-once` directives | | | [vue/valid-v-pre](./valid-v-pre.md) | enforce valid `v-pre` directives | | | [vue/valid-v-show](./valid-v-show.md) | enforce valid `v-show` directives | | +| [vue/valid-v-slot](./valid-v-slot.md) | enforce valid `v-slot` directives | | | [vue/valid-v-text](./valid-v-text.md) | enforce valid `v-text` directives | | ## Priority B: Strongly Recommended (Improving Readability) @@ -85,6 +87,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi | Rule ID | Description | | |:--------|:------------|:---| | [vue/attribute-hyphenation](./attribute-hyphenation.md) | enforce attribute naming style on custom components in template | :wrench: | +| [vue/component-definition-name-casing](./component-definition-name-casing.md) | enforce specific casing for component definition name | :wrench: | | [vue/html-closing-bracket-newline](./html-closing-bracket-newline.md) | require or disallow a line break before tag's closing brackets | :wrench: | | [vue/html-closing-bracket-spacing](./html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets | :wrench: | | [vue/html-end-tags](./html-end-tags.md) | enforce end tag style | :wrench: | @@ -94,7 +97,6 @@ Enforce all the rules in this category, as well as all higher priority rules, wi | [vue/max-attributes-per-line](./max-attributes-per-line.md) | enforce the maximum number of attributes per line | :wrench: | | [vue/multiline-html-element-content-newline](./multiline-html-element-content-newline.md) | require a line break before and after the contents of a multiline element | :wrench: | | [vue/mustache-interpolation-spacing](./mustache-interpolation-spacing.md) | enforce unified spacing in mustache interpolations | :wrench: | -| [vue/name-property-casing](./name-property-casing.md) | enforce specific casing for the name property in Vue components | :wrench: | | [vue/no-multi-spaces](./no-multi-spaces.md) | disallow multiple spaces | :wrench: | | [vue/no-spaces-around-equal-signs-in-attribute](./no-spaces-around-equal-signs-in-attribute.md) | disallow spaces around equal signs in attribute | :wrench: | | [vue/no-template-shadow](./no-template-shadow.md) | disallow variable declarations from shadowing variables declared in the outer scope | | @@ -104,6 +106,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi | [vue/singleline-html-element-content-newline](./singleline-html-element-content-newline.md) | require a line break before and after the contents of a singleline element | :wrench: | | [vue/v-bind-style](./v-bind-style.md) | enforce `v-bind` directive style | :wrench: | | [vue/v-on-style](./v-on-style.md) | enforce `v-on` directive style | :wrench: | +| [vue/v-slot-style](./v-slot-style.md) | enforce `v-slot` directive style | :wrench: | ## Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) @@ -118,6 +121,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi | Rule ID | Description | | |:--------|:------------|:---| | [vue/attributes-order](./attributes-order.md) | enforce order of attributes | :wrench: | +| [vue/component-tags-order](./component-tags-order.md) | enforce order of component top-level elements | | | [vue/no-v-html](./no-v-html.md) | disallow use of v-html to prevent XSS attack | | | [vue/order-in-components](./order-in-components.md) | enforce order of properties in components | :wrench: | | [vue/this-in-template](./this-in-template.md) | disallow usage of `this` in template | | @@ -145,9 +149,7 @@ For example: | [vue/brace-style](./brace-style.md) | enforce consistent brace style for blocks | :wrench: | | [vue/camelcase](./camelcase.md) | enforce camelcase naming convention | | | [vue/comma-dangle](./comma-dangle.md) | require or disallow trailing commas | :wrench: | -| [vue/component-definition-name-casing](./component-definition-name-casing.md) | enforce specific casing for component definition name | :wrench: | | [vue/component-name-in-template-casing](./component-name-in-template-casing.md) | enforce specific casing for the component naming style in template | :wrench: | -| [vue/component-tags-order](./component-tags-order.md) | enforce order of component top-level elements | | | [vue/dot-location](./dot-location.md) | enforce consistent newlines before and after dots | :wrench: | | [vue/eqeqeq](./eqeqeq.md) | require the use of `===` and `!==` | :wrench: | | [vue/key-spacing](./key-spacing.md) | enforce consistent spacing between keys and values in object literal properties | :wrench: | @@ -172,9 +174,6 @@ For example: | [vue/space-unary-ops](./space-unary-ops.md) | enforce consistent spacing before or after unary operators | :wrench: | | [vue/static-class-names-order](./static-class-names-order.md) | enforce static class names order | :wrench: | | [vue/v-on-function-call](./v-on-function-call.md) | enforce or forbid parentheses after method calls without arguments in `v-on` directives | :wrench: | -| [vue/v-slot-style](./v-slot-style.md) | enforce `v-slot` directive style | :wrench: | -| [vue/valid-v-bind-sync](./valid-v-bind-sync.md) | enforce valid `.sync` modifier on `v-bind` directives | | -| [vue/valid-v-slot](./valid-v-slot.md) | enforce valid `v-slot` directives | | ## Deprecated @@ -183,4 +182,5 @@ For example: | Rule ID | Replaced by | |:--------|:------------| +| [vue/name-property-casing](./name-property-casing.md) | [vue/component-definition-name-casing](./component-definition-name-casing.md) | | [vue/no-confusing-v-for-v-if](./no-confusing-v-for-v-if.md) | [vue/no-use-v-if-with-v-for](./no-use-v-if-with-v-for.md) | diff --git a/docs/rules/component-definition-name-casing.md b/docs/rules/component-definition-name-casing.md index d43d0ded9..d5566ca9c 100644 --- a/docs/rules/component-definition-name-casing.md +++ b/docs/rules/component-definition-name-casing.md @@ -7,6 +7,7 @@ description: enforce specific casing for component definition name # vue/component-definition-name-casing > enforce specific casing for component definition name +- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`. - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. Define a style for component definition name casing for consistency purposes. diff --git a/docs/rules/component-tags-order.md b/docs/rules/component-tags-order.md index d8c45447b..e66cb665a 100644 --- a/docs/rules/component-tags-order.md +++ b/docs/rules/component-tags-order.md @@ -7,6 +7,8 @@ description: enforce order of component top-level elements # vue/component-tags-order > enforce order of component top-level elements +- :gear: This rule is included in `"plugin:vue/recommended"`. + ## :book: Rule Details This rule warns about the order of the `