Skip to content

Commit 254e4c5

Browse files
committed
docs: update
1 parent c91086a commit 254e4c5

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

docs/rules/attribute-hyphenation.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ This rule enforces using hyphenated attribute names on custom components in Vue
3636
```json
3737
{
3838
"vue/attribute-hyphenation": ["error", "always" | "never", {
39-
"ignore": []
39+
"ignore": [],
40+
"exclude": []
4041
}]
4142
}
4243
```
@@ -46,7 +47,8 @@ and all the [SVG attributes](https://developer.mozilla.org/en-US/docs/Web/SVG/At
4647

4748
- `"always"` (default) ... Use hyphenated name.
4849
- `"never"` ... Don't use hyphenated name except the ones that are ignored.
49-
- `"ignore"` ... Array of ignored names
50+
- `"ignore"` ... Array of ignored names.
51+
- `"exclude"` ... Array of exclude tag names.
5052

5153
### `"always"`
5254

@@ -109,6 +111,24 @@ Don't use hyphenated name but allow custom attributes
109111

110112
</eslint-code-block>
111113

114+
### `"never", { "exclude": ["/^custom-/"] }`
115+
116+
Exclude tags from applying this rule.
117+
118+
<eslint-code-block fix :rules="{'vue/attribute-hyphenation': ['error', 'never', { exclude: ['/^custom-/'] }]}">
119+
120+
```vue
121+
<template>
122+
<!-- ✓ GOOD -->
123+
<custom-component custom-prop="prop" />
124+
125+
<!-- ✗ BAD -->
126+
<my-component custom-prop="prop" />
127+
</template>
128+
```
129+
130+
</eslint-code-block>
131+
112132
## :couple: Related Rules
113133

114134
- [vue/v-on-event-hyphenation](./v-on-event-hyphenation.md)

docs/rules/v-on-event-hyphenation.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ This rule enforces using hyphenated v-on event names on custom components in Vue
3939
{
4040
"vue/v-on-event-hyphenation": ["error", "always" | "never", {
4141
"autofix": false,
42-
"ignore": []
42+
"ignore": [],
43+
"exclude": []
4344
}]
4445
}
4546
```
4647

4748
- `"always"` (default) ... Use hyphenated name.
4849
- `"never"` ... Don't use hyphenated name.
49-
- `"ignore"` ... Array of ignored names
50+
- `"ignore"` ... Array of ignored names.
51+
- `"exclude"` ... Array of exclude tag names.
5052
- `"autofix"` ... If `true`, enable autofix. If you are using Vue 2, we recommend that you do not use it due to its side effects.
5153

5254
### `"always"`
@@ -104,6 +106,24 @@ Don't use hyphenated name but allow custom event names
104106

105107
</eslint-code-block>
106108

109+
### `"never", { "exclude": ["/^custom-/"] }`
110+
111+
Exclude tags from applying this rule.
112+
113+
<eslint-code-block fix :rules="{'vue/v-on-event-hyphenation': ['error', 'never', { exclude: ['/^custom-/'], autofix: true }]}">
114+
115+
```vue
116+
<template>
117+
<!-- ✓ GOOD -->
118+
<custom-component v-on:custom-event="handleEvent" />
119+
120+
<!-- ✗ BAD -->
121+
<my-component v-on:custom-event="handleEvent" />
122+
</template>
123+
```
124+
125+
</eslint-code-block>
126+
107127
## :couple: Related Rules
108128

109129
- [vue/custom-event-name-casing](./custom-event-name-casing.md)

0 commit comments

Comments
 (0)