From 0cfe66dccb71c693943b956a043063c916ecabf1 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Mon, 11 Feb 2019 22:11:53 +0900 Subject: [PATCH 1/2] New: v-slot-style rule (fixes #801) --- docs/rules/v-slot-style.md | 112 ++++++++ lib/rules/v-slot-style.js | 146 +++++++++++ tests/lib/rules/v-slot-style.js | 443 ++++++++++++++++++++++++++++++++ 3 files changed, 701 insertions(+) create mode 100644 docs/rules/v-slot-style.md create mode 100644 lib/rules/v-slot-style.js create mode 100644 tests/lib/rules/v-slot-style.js diff --git a/docs/rules/v-slot-style.md b/docs/rules/v-slot-style.md new file mode 100644 index 000000000..67bd294b7 --- /dev/null +++ b/docs/rules/v-slot-style.md @@ -0,0 +1,112 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/v-slot-style +description: enforce `v-slot` directive style +--- +# vue/v-slot-style +> enforce `v-slot` directive style + +- :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. + +## :book: Rule Details + +This rule enforces `v-slot` directive style which you should use shorthand or long form. + + + +```vue + +``` + + + +## :wrench: Options + +Default is set to `shorthand`. + +```json +{ + "vue/v-slot-style": ["error", { + "atComponent": "shorthand" | "longform" | "v-slot", + "default": "shorthand" | "longform" | "v-slot", + "named": "shorthand" | "longform", + }] +} +``` + +| Name | Type | Default Value | Description +|:-----|:-----|:--------------|:------------ +| `atComponent` | `"shorthand"` \| `"longform"` \| `"v-slot"` | `"v-slot"` | The style for the default slot at custom components directly (E.g. ``). +| `default` | `"shorthand"` \| `"longform"` \| `"v-slot"` | `"shorthand"` | The style for the default slot at template wrappers (E.g. `