@markuplint/config-presets 3.0.0-alpha.6 → 3.0.0-dev.176
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 +12 -9
- package/package.json +3 -3
- package/preset.a11y.json +1 -1
- package/preset.code-styles.json +1 -1
- package/preset.html-standard.json +1 -1
- package/preset.rdfa.json +1 -1
- package/preset.security.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# @markuplint/config-presets
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@markuplint/config-presets)
|
|
4
|
-
[](https://travis-ci.org/markuplint/markuplint)
|
|
5
|
-
[](https://coveralls.io/github/markuplint/markuplint?branch=main)
|
|
6
4
|
|
|
7
5
|
## Usage
|
|
8
6
|
|
|
@@ -22,13 +20,12 @@ You can choose some presets appropriately for your preference.
|
|
|
22
20
|
}
|
|
23
21
|
```
|
|
24
22
|
|
|
25
|
-
##
|
|
23
|
+
## Ruleset Mapping
|
|
26
24
|
|
|
27
25
|
Ruleset|Description|`recommended`|`recommended-vue`|`recommended-svelte`|`recommended-static-html`|`recommended-react`|`a11y`|`code-styles`|`html-standard`|`performance`|`rdfa`|`security`|
|
|
28
26
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
29
|
-
[Disallow `<hgroup>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup)|The hgroup element should not be used because no assistive technology supports it.|✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
30
27
|
[Must not duplicate **ID**](https://www.w3.org/WAI/WCAG21/Techniques/html/H93.html)|Be able to avoid problems in assistive technologies from the viewpoint of machine readability.|✅|✅|✅|✅|✅|✅|❌|✅|❌|❌|❌|
|
|
31
|
-
[Disallow `
|
|
28
|
+
[Disallow `accesskey` attr](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey#accessibility_concerns)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
32
29
|
[`tabindex` attr only `-1` or `0`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#accessibility_concerns)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
33
30
|
`<label>` should have control| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
34
31
|
[Use **landmark**](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
@@ -43,6 +40,8 @@ Require `<track>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
|
43
40
|
Require `<video muted>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
44
41
|
No merge cells| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
45
42
|
[`<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
|
+
[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
|
+
[`<search>` requires `search` role](https://github.com/markuplint/markuplint/issues/762#issuecomment-1483113405)|It requires the role of an interim measure because some browsers or ATs are not supporting it yet.|✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
|
|
46
45
|
[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.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
47
46
|
Use **character reference**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
48
47
|
No use deprecated attr|You should not use deprecated attributes from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
@@ -50,6 +49,8 @@ No use deprecated element|You should not use deprecated elements from the viewpo
|
|
|
50
49
|
[Require `doctype`](https://html.spec.whatwg.org/multipage/syntax.html#syntax-doctype)|It has the effect of avoiding quirks mode.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
51
50
|
No use ineffective attr| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
52
51
|
Allow only **permitted contents**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
52
|
+
Need **placeholder label option**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
53
|
+
Require the `datetime` attribute if the content of the `time` element is invalid| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
53
54
|
Specify required attr| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
54
55
|
[Specify `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
55
56
|
[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>`.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
|
|
@@ -62,16 +63,18 @@ Require loading `<iframe>` lazily|Require `loading=lazy` with `<iframe>` to avoi
|
|
|
62
63
|
Allow `property` attr with `<meta>`|Be able to use **Open-Graph** etc.|✅|✅|✅|✅|✅|❌|❌|❌|❌|✅|❌|
|
|
63
64
|
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.|❌|✅|✅|❌|✅|❌|❌|❌|❌|❌|❌|
|
|
64
65
|
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
|
-
Require `noreferrer` with `target=_blank`|Require `rel=noreferrer` with an element that has `target=_blank` to prevent leaking referrer information and to block operating referrer documents.|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|✅|
|
|
66
66
|
|
|
67
67
|
## Install
|
|
68
68
|
|
|
69
|
-
`markuplint` package includes this package.
|
|
69
|
+
[`markuplint`](https://www.npmjs.com/package/markuplint) package includes this package.
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
<details>
|
|
72
|
+
<summary>If you are installing purposely, how below:</summary>
|
|
72
73
|
|
|
73
|
-
```
|
|
74
|
+
```shell
|
|
74
75
|
$ npm install @markuplint/config-presets
|
|
75
76
|
|
|
76
77
|
$ yarn add @markuplint/config-presets
|
|
77
78
|
```
|
|
79
|
+
|
|
80
|
+
</details>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/config-presets",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-dev.176+f6ad62e9",
|
|
4
4
|
"description": "markuplint config presets",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"build": "node build.mjs"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"glob": "^
|
|
16
|
+
"glob": "^10.2.2",
|
|
17
17
|
"jsonc-parser": "^3.2.0",
|
|
18
18
|
"mustache": "^4.2.0"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "f6ad62e992e1569be4067f1e90d2d6017a658f57"
|
|
21
21
|
}
|
package/preset.a11y.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rules":{"
|
|
1
|
+
{"rules":{"id-duplication":true,"invalid-attr":{"options":{"disallowAttrs":["disallowed"],"allowAttrs":[{"name":"tabindex","value":{"enum":["-1","0"]}}]}},"label-has-control":true,"landmark-roles":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"]}}}},{"selector":":where(search)","rules":{"required-attr":{"value":[{"name":"role"}]},"wai-aria":{"options":{"disallowSetImplicitRole":false}}}}]}
|
package/preset.code-styles.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{
|
|
1
|
+
{}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rules":{"attr-duplication":true,"character-reference":true,"deprecated-attr":true,"deprecated-element":true,"doctype":true,"id-duplication":true,"ineffective-attr":true,"no-refer-to-non-existent-id":true,"permitted-contents":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}}]}
|
|
1
|
+
{"rules":{"attr-duplication":true,"character-reference":true,"deprecated-attr":true,"deprecated-element":true,"doctype":true,"id-duplication":true,"ineffective-attr":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}}]}
|
package/preset.rdfa.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"nodeRules":[{"selector":":where(meta[property])","rules":{"invalid-attr":{"
|
|
1
|
+
{"nodeRules":[{"selector":":where(meta[property])","rules":{"invalid-attr":{"options":{"allowAttrs":[{"name":"property","value":{"type":"NoEmptyAny"}},{"name":"content","value":{"type":"NoEmptyAny"}}]}},"required-attr":false}}]}
|
package/preset.security.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{
|
|
1
|
+
{}
|