From b7ee76e8d89232775c43bea2bf23dae780a90a15 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Mon, 4 Mar 2019 18:09:12 +0900 Subject: [PATCH] New: v-slot-style rule (fixes #801) (#836) --- docs/rules/v-slot-style.md | 110 ++++++++ lib/rules/v-slot-style.js | 146 +++++++++++ tests/lib/rules/v-slot-style.js | 443 ++++++++++++++++++++++++++++++++ 3 files changed, 699 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..41b5ea6b4 --- /dev/null +++ b/docs/rules/v-slot-style.md @@ -0,0 +1,110 @@ +--- +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 + +```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. `