Skip to content

Commit 1d26811

Browse files
committed
docs: update
1 parent 6f8214e commit 1d26811

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

docs/rules/no-duplicate-attr-inheritance.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ since: v7.0.0
1212
1313
## :book: Rule Details
1414

15-
This rule aims to prevent duplicate attribute inheritance.
15+
This rule aims to prevent duplicate attribute inheritance.
1616
This rule to warn to apply `inheritAttrs: false` when it detects `v-bind="$attrs"` being used.
1717

1818
<eslint-code-block :rules="{'vue/no-duplicate-attr-inheritance': ['error', { checkMultiRootNodes: false }]}">
@@ -47,6 +47,18 @@ export default {
4747

4848
</eslint-code-block>
4949

50+
## :wrench: Options
51+
52+
```json
53+
{
54+
"vue/no-duplicate-attr-inheritance": ["error", {
55+
"checkMultiRootNodes": false,
56+
}]
57+
}
58+
```
59+
60+
- `"checkMultiRootNodes"`: If set to `true`, check and warn to apply `inheritAttrs: false` whenever it detects `v-bind="$attrs"` being used. Default is `false`, will ignore the components with multiple root nodes, because Vue encourages adding `v-bind="$attrs"` in this case to prevent runtime warnings. See [attribute inheritance on multiple root nodes](https://vuejs.org/guide/components/attrs.html#attribute-inheritance-on-multiple-root-nodes) for more.
61+
5062
### `"checkMultiRootNodes": true`
5163

5264
<eslint-code-block :rules="{'vue/no-duplicate-attr-inheritance': ['error', { checkMultiRootNodes: true }]}">
@@ -66,21 +78,10 @@ export default {
6678

6779
</eslint-code-block>
6880

69-
## :wrench: Options
70-
71-
```json
72-
{
73-
"vue/no-duplicate-attr-inheritance": ["error", {
74-
"checkMultiRootNodes": false,
75-
}]
76-
}
77-
```
78-
79-
- `"checkMultiRootNodes"` ... If `true`, check and warn when there are multiple root nodes. (Default: `false`)
80-
8181
## :books: Further Reading
8282

8383
- [API - inheritAttrs](https://vuejs.org/api/options-misc.html#inheritattrs)
84+
- [Fallthrough Attributes](https://vuejs.org/guide/components/attrs.html#attribute-inheritance-on-multiple-root-nodes)
8485

8586
## :rocket: Version
8687

lib/rules/no-duplicate-attr-inheritance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function isConditionalGroup(elements) {
1212
return false
1313
}
1414

15-
const firstElement = element[0]
15+
const firstElement = elements[0]
1616
const lastElement = elements[elements.length - 1]
1717
const inBetweenElements = elements.slice(1, -1)
1818

0 commit comments

Comments
 (0)