-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
preset.html-standard.json
185 lines (172 loc) · 4.36 KB
/
preset.html-standard.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{
"rules": {
/**
* No duplicate attr
*
* The parser ignores all such duplicate occurrences of the attribute.
*
* @see https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute
*/
"attr-duplication": true,
/**
* No use deprecated attr
*
* You should not use deprecated attributes from the viewpoint of compatibility.
*/
"deprecated-attr": true,
/**
* No use deprecated element
*
* You should not use deprecated elements from the viewpoint of compatibility.
*/
"deprecated-element": true,
/**
* Require `doctype`
*
* It has the effect of avoiding quirks mode.
*
* @see https://html.spec.whatwg.org/multipage/syntax.html#syntax-doctype
*/
"doctype": true,
/**
* Must not skip heading levels
*
*/
"heading-levels": true,
/**
* Must not duplicate **ID**
*
*/
"id-duplication": true,
/**
* No use ineffective attr
*
*/
"ineffective-attr": true,
/**
* No duplicate names in `<dl>`
*
* Within a single dl element, there should not be more than one dt element for each name.
*
* @see https://html.spec.whatwg.org/multipage/grouping-content.html#the-dl-element:~:text=Within%20a%20single%20dl%20element%2C%20there%20should%20not%20be%20more%20than%20one%20dt%20element%20for%20each%20name
*
*/
"no-duplicate-dt": true,
/**
* No refer to no existent **ID**
*/
"no-refer-to-non-existent-id": true,
/**
* No use **orphaned end tag**
*
*/
"no-orphaned-end-tag": true,
/**
* Allow only **permitted contents**
*
*/
"permitted-contents": true,
/**
* Need **placeholder label option**
*
*/
"placeholder-label-option": true,
/**
* Require the `datetime` attribute if the content of the `time` element is invalid
*
*/
"require-datetime": true,
/**
* Specify required attr
*
*/
"required-attr": true
},
"nodeRules": [
{
/**
* Specify `charset=UTF-8`
*
* @see https://html.spec.whatwg.org/multipage/semantics.html#charset
*/
"selector": ":where(head)",
"rules": {
"required-element": ["meta[charset=\"UTF-8\" i]"]
}
},
{
/**
* No use `<small>` as **subheadings**
*
* Should not use it in `<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`, and `<h6>`.
*
* @see https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-small-element
*/
"selector": "h1, h2, h3, h4, h5, h6",
"rules": {
"disallowed-element": {
"value": ["small"],
"reason": "The small element must not be used for subheadings. https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-small-element"
}
}
},
{
/**
* No use `<caption>` within `<figure>`
*
* When `<table>` is the only content in `<figure>` other than `<figcaption>`, `<caption>` should be omitted in favor of `<figcaption>`.
*
* @see https://html.spec.whatwg.org/multipage/tables.html#the-caption-element
*/
"selector": ":where(figcaption ~ table, table:has(~ figcaption))",
"rules": {
"disallowed-element": {
"value": ["caption"],
"reason": "When a table element is the only content in a figure element other than the figcaption, the caption element should be omitted in favor of the figcaption. (https://html.spec.whatwg.org/multipage/tables.html#the-caption-element)"
},
"require-accessible-name": false
}
},
{
/**
* Require `title` attr in `<input pattern>`
*
* When an `<input>` element has a `pattern` attribute specified, authors should include a `title` attribute to give a description of the pattern.
*
* @see https://html.spec.whatwg.org/multipage/grouping-content.html#the-figure-element
*/
"selector": ":where(input[pattern])",
"rules": {
"required-attr": {
"value": [{ "name": "title" }]
}
}
},
{
/**
* No nested same `<details>` name group
*/
"regexSelector": {
"nodeName": "details",
"attrName": "name",
"attrValue": "^(?<value>.+)$",
"combination": {
"combinator": " ",
"nodeName": "details"
}
},
"rules": {
"invalid-attr": {
"options": {
"disallowAttrs": {
"name": {
"pattern": "{{ value }}"
}
}
},
"reason": "A document must not contain a details element that is a descendant of another details element in the same details name group."
}
}
}
]
}