@markuplint/config-presets 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ Ruleset|Description|`recommended`|`recommended-vue`|`recommended-svelte`|`recomm
|
|
|
29
29
|
[`tabindex` attr only `-1` or `0`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#accessibility_concerns)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
30
30
|
`<label>` should have control| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
31
31
|
[Use **landmark**](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
32
|
+
**Popover** trigger and target must be adjacent| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
33
|
+
No consecutive `<br>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
32
34
|
No refer to no existent **ID**| |✅|✅|✅|✅|✅|✅|❌|✅|❌|❌|❌|
|
|
33
35
|
Require **accessible name**| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
34
36
|
Require `<h1>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
@@ -42,11 +44,12 @@ No merge cells| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
|
42
44
|
[`<summary>` no contains interactive contents](https://github.com/whatwg/html/issues/2272#issuecomment-1242415594)|There is a case where an assistive technology can't access contents, or contents don't propagate a mouse event to `<summary>`.|✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
43
45
|
[Disallow `autofocus` attr to except in the dialog scope](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_considerations)|Don't take away a focus to forced. However, the `dialog` element and its descendants allow it.|✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
44
46
|
[No duplicate attr](https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute)|The parser ignores all such duplicate occurrences of the attribute.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
45
|
-
Use **character reference**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
46
47
|
No use deprecated attr|You should not use deprecated attributes from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
47
48
|
No use deprecated element|You should not use deprecated elements from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
48
49
|
[Require `doctype`](https://html.spec.whatwg.org/multipage/syntax.html#syntax-doctype)|It has the effect of avoiding quirks mode.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
50
|
+
Must not skip heading levels| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
49
51
|
No use ineffective attr| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
52
|
+
[No duplicate names in `<dl>`](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)|Within a single dl element, there should not be more than one dt element for each name.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
50
53
|
Allow only **permitted contents**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
51
54
|
Need **placeholder label option**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
52
55
|
Require the `datetime` attribute if the content of the `time` element is invalid| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
@@ -54,13 +57,15 @@ Specify required attr| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
|
54
57
|
[Specify `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
55
58
|
[No use `<small>` as **subheadings**](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-small-element)|Should not use it in `<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`, and `<h6>`.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
56
59
|
[No use `<caption>` within `<figure>`](https://html.spec.whatwg.org/multipage/tables.html#the-caption-element)|When `<table>` is the only content in `<figure>` other than `<figcaption>`, `<caption>` should be omitted in favor of `<figcaption>`.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
60
|
+
[Require `title` attr in `<input pattern>`](https://html.spec.whatwg.org/multipage/grouping-content.html#the-figure-element)|When an `<input>` element has a `pattern` attribute specified, authors should include a `title` attribute to give a description of the pattern.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
61
|
+
No nested same `<details>` name group| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
57
62
|
[Require `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)| |✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
|
|
58
63
|
Require `defer` attr|Should load and parse scripts lazily to avoid render-blocking.|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
|
|
59
64
|
Require **aspect-ratio**|Require `width` and `height` attr with `<img>` to avoid **Cumulative Layout Shift**|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
|
|
60
|
-
Require async decoding image|Require `decoding=async` with `<img>` to avoid render-blocking.|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
|
|
61
65
|
Require loading `<iframe>` lazily|Require `loading=lazy` with `<iframe>` to avoid render-blocking that causes loading if its element is out of the viewport.|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
|
|
62
66
|
Allow `property` attr with `<meta>`|Be able to use **Open-Graph** etc.|✅|✅|✅|✅|✅|❌|❌|❌|❌|✅|❌|
|
|
63
67
|
No hard coding **ID**|The component that hard-coded ID cannot mount to an app duplicated because the IDs must be unique in a document. Recommend to specify dynamic IDs to avoid doing that.|❌|✅|✅|❌|✅|❌|❌|❌|❌|❌|❌|
|
|
68
|
+
Use [**character reference**](https://markuplint.dev/docs/rules/character-reference)| |❌|❌|❌|✅|❌|❌|❌|❌|❌|❌|❌|
|
|
64
69
|
No omit **end-tag**|Recommend to write an end-tag always because it is too difficult for a human decide an element is end-tag omittable.|❌|❌|❌|✅|❌|❌|❌|❌|❌|❌|❌|
|
|
65
70
|
|
|
66
71
|
## Install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/config-presets",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "markuplint config presets",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"jsonc-parser": "^3.2.1",
|
|
18
18
|
"mustache": "^4.2.0"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "b9817c30c2df71faa866e3b3fe286afa499deede"
|
|
21
21
|
}
|
package/preset.a11y.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rules":{"id-duplication":true,"invalid-attr":{"options":{"disallowAttrs":["
|
|
1
|
+
{"rules":{"id-duplication":true,"invalid-attr":{"options":{"disallowAttrs":["accesskey"],"allowAttrs":[{"name":"tabindex","value":{"enum":["-1","0"]}}]}},"label-has-control":true,"landmark-roles":true,"neighbor-popovers":true,"no-consecutive-br":true,"no-refer-to-non-existent-id":true,"require-accessible-name":true,"required-h1":true,"use-list":true,"wai-aria":true},"nodeRules":[{"selector":":where(html)","rules":{"required-attr":["lang"]}},{"selector":":where(abbr)","rules":{"required-attr":["title"]}},{"selector":":where(video, audio)","rules":{"required-element":["track"]}},{"selector":":where(video[autoplay])","rules":{"required-attr":["muted"]}},{"selector":":where(th, td)","rules":{"invalid-attr":{"options":{"disallowAttrs":["colspan","rowspan"]}}}},{"selector":":where(summary)","rules":{"disallowed-element":[":model(interactive)"]}},{"selector":":where(:not(dialog, dialog *))","rules":{"invalid-attr":{"options":{"disallowAttrs":["autofocus"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rules":{"attr-duplication":true,"
|
|
1
|
+
{"rules":{"attr-duplication":true,"deprecated-attr":true,"deprecated-element":true,"doctype":true,"heading-levels":true,"id-duplication":true,"ineffective-attr":true,"no-duplicate-dt":true,"no-refer-to-non-existent-id":true,"permitted-contents":true,"placeholder-label-option":true,"require-datetime":true,"required-attr":true},"nodeRules":[{"selector":":where(head)","rules":{"required-element":["meta[charset=\"UTF-8\" i]"]}},{"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"}}},{"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}},{"selector":":where(input[pattern])","rules":{"required-attr":{"value":[{"name":"title"}]}}},{"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."}}}]}
|
package/preset.performance.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"nodeRules":[{"selector":":where(head)","rules":{"required-element":["meta[charset=\"UTF-8\" i]"]}},{"selector":":where(script[src]:not([type=module]))","rules":{"required-attr":["defer"]}},{"selector":":where(img[src])","rules":{"required-attr":["width","height"]}},{"selector":":where(
|
|
1
|
+
{"nodeRules":[{"selector":":where(head)","rules":{"required-element":["meta[charset=\"UTF-8\" i]"]}},{"selector":":where(script[src]:not([type=module]))","rules":{"required-attr":["defer"]}},{"selector":":where(img[src])","rules":{"required-attr":["width","height"]}},{"selector":":where(iframe)","rules":{"required-attr":["title",{"name":"loading","value":"lazy"}]}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"extends":["markuplint:code-styles","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"end-tag":true}}
|
|
1
|
+
{"extends":["markuplint:code-styles","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"character-reference":true,"end-tag":true}}
|