@markuplint/config-presets 3.0.0-alpha.2 → 3.0.0-alpha.27

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
@@ -1,8 +1,6 @@
1
1
  # @markuplint/config-presets
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/%40markuplint%2Fconfig-presets.svg)](https://www.npmjs.com/package/@markuplint/config-presets)
4
- [![Build Status](https://travis-ci.org/markuplint/markuplint.svg?branch=main)](https://travis-ci.org/markuplint/markuplint)
5
- [![Coverage Status](https://coveralls.io/repos/github/markuplint/markuplint/badge.svg?branch=main)](https://coveralls.io/github/markuplint/markuplint?branch=main)
6
4
 
7
5
  ## Usage
8
6
 
@@ -22,37 +20,39 @@ You can choose some presets appropriately for your preference.
22
20
  }
23
21
  ```
24
22
 
25
- ## Presets
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
27
  [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
28
  [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 `autofocus` attr](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_considerations)||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
32
- [`tabindex` attr only `-1` or `0`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#accessibility_concerns)||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
33
- [Use **landmark**](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/)||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
34
- No refer to no existent **ID**||✅|✅|✅|✅|✅|✅|❌|✅|❌|❌|❌|
35
- Require **accessible name**||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
36
- Require `<h1>`||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
37
- Use `<ul>`||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
38
- Conform to **WAI-ARIA**||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
39
- Require `<html lang>`||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
40
- Require `<abbr title>`||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
41
- Require `<track>`||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
42
- Require `<video muted>`||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
43
- No merge cells||✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
29
+ [Disallow `autofocus` attr](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_considerations)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
30
+ [`tabindex` attr only `-1` or `0`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#accessibility_concerns)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
31
+ `<label>` should have control| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
32
+ [Use **landmark**](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/)| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
33
+ No refer to no existent **ID**| |✅|✅|✅|✅|✅|✅|❌|✅|❌|❌|❌|
34
+ Require **accessible name**| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
35
+ Require `<h1>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
36
+ Use `<ul>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
37
+ Conform to **WAI-ARIA**| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
38
+ Require `<html lang>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
39
+ Require `<abbr title>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
40
+ Require `<track>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
41
+ Require `<video muted>`| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
42
+ No merge cells| |✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
43
+ [`<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>`.|✅|✅|✅|✅|✅|✅|❌|❌|❌|❌|❌|
44
44
  [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
- No use depreacted attr|You should not use deprecated attributes from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
47
- No use depreacted element|You should not use deprecated elements from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
45
+ Use **character reference**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
46
+ No use deprecated attr|You should not use deprecated attributes from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
47
+ No use deprecated element|You should not use deprecated elements from the viewpoint of compatibility.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
48
48
  [Require `doctype`](https://html.spec.whatwg.org/multipage/syntax.html#syntax-doctype)|It has the effect of avoiding quirks mode.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
49
- No use ineffective attr||✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
50
- Allow only **permitted contents**||✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
51
- Specify required attr||✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
52
- [Specify `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)||✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
49
+ No use ineffective attr| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
50
+ Allow only **permitted contents**| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
51
+ Specify required attr| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
52
+ [Specify `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)| |✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
53
53
  [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>`.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
54
54
  [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>`.|✅|✅|✅|✅|✅|❌|❌|✅|❌|❌|❌|
55
- [Require `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)||✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
55
+ [Require `charset=UTF-8`](https://html.spec.whatwg.org/multipage/semantics.html#charset)| |✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
56
56
  Require `defer` attr|Should load and parse scripts lazily to avoid render-blocking.|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
57
57
  Require **aspect-ratio**|Require `width` and `height` attr with `<img>` to avoid **Cumulative Layout Shift**|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
58
58
  Require async decoding image|Require `decoding=async` with `<img>` to avoid render-blocking.|✅|✅|✅|✅|✅|❌|❌|❌|✅|❌|❌|
@@ -64,12 +64,15 @@ Require `noreferrer` with `target=_blank`|Require `rel=noreferrer` with an eleme
64
64
 
65
65
  ## Install
66
66
 
67
- `markuplint` package includes this package.
67
+ [`markuplint`](https://www.npmjs.com/package/markuplint) package includes this package.
68
68
 
69
- If you are installing purposely, how below:
69
+ <details>
70
+ <summary>If you are installing purposely, how below:</summary>
70
71
 
71
- ```sh
72
+ ```shell
72
73
  $ npm install @markuplint/config-presets
73
74
 
74
75
  $ yarn add @markuplint/config-presets
75
76
  ```
77
+
78
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/config-presets",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.27+b5eef04a",
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.0",
18
18
  "mustache": "^4.2.0"
19
19
  },
20
- "gitHead": "830bf8187b81bf5ca2f5f09b6f85a98395a58bdb"
20
+ "gitHead": "b5eef04a99177b25dccb164b486fba9fa01893ae"
21
21
  }
package/preset.a11y.json CHANGED
@@ -1 +1 @@
1
- {"rules":{"disallowed-element":["hgroup"],"id-duplication":true,"invalid-attr":{"option":{"attrs":{"autofocus":{"disallowed":true},"accesskey":{"disallowed":true},"tabindex":{"enum":["-1","0"]}}}},"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":{"option":{"attrs":{"colspan":{"disallowed":true},"rowspan":{"disallowed":true}}}}}}]}
1
+ {"rules":{"disallowed-element":["hgroup"],"id-duplication":true,"invalid-attr":{"options":{"attrs":{"autofocus":{"disallowed":true},"accesskey":{"disallowed":true},"tabindex":{"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":{"attrs":{"colspan":{"disallowed":true},"rowspan":{"disallowed":true}}}}}},{"selector":":where(summary)","rules":{"disallowed-element":[":model(interactive)"]}}]}
package/preset.rdfa.json CHANGED
@@ -1 +1 @@
1
- {"nodeRules":[{"selector":":where(meta[property])","rules":{"invalid-attr":{"option":{"attrs":{"property":{"type":"NoEmptyAny"},"content":{"type":"NoEmptyAny"}}}},"required-attr":false}}]}
1
+ {"nodeRules":[{"selector":":where(meta[property])","rules":{"invalid-attr":{"options":{"attrs":{"property":{"type":"NoEmptyAny"},"content":{"type":"NoEmptyAny"}}}},"required-attr":false}}]}
@@ -1 +1 @@
1
- {"extends":["markuplint:code-style","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"no-hard-code-id":true}}
1
+ {"extends":["markuplint:code-styles","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"no-hard-code-id":true}}
@@ -1 +1 @@
1
- {"extends":["markuplint:code-style","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":{"end-tag":true}}
@@ -1 +1 @@
1
- {"extends":["markuplint:code-style","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"no-hard-code-id":true}}
1
+ {"extends":["markuplint:code-styles","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"no-hard-code-id":true}}
@@ -1 +1 @@
1
- {"extends":["markuplint:code-style","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"no-hard-code-id":true}}
1
+ {"extends":["markuplint:code-styles","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"],"rules":{"no-hard-code-id":true}}
@@ -1 +1 @@
1
- {"extends":["markuplint:code-style","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"]}
1
+ {"extends":["markuplint:code-styles","markuplint:html-standard","markuplint:a11y","markuplint:performance","markuplint:security","markuplint:rdfa"]}
package/build.mjs DELETED
@@ -1,99 +0,0 @@
1
- import { readFile, rm, writeFile } from 'fs/promises';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- import glob from 'glob';
5
- import { promisify } from 'util';
6
- import { stripComments, visit } from 'jsonc-parser';
7
- import mustache from 'mustache';
8
-
9
- const asyncGlob = promisify(glob);
10
-
11
- const dirname = path.dirname(fileURLToPath(import.meta.url));
12
- const srcDir = path.resolve(dirname, 'src');
13
-
14
- const currents = await asyncGlob('preset.*.json,!preset.___json');
15
- await Promise.all(currents.map(current => rm(current)));
16
-
17
- const files = await asyncGlob(path.resolve(srcDir, '*.json'));
18
- const md = await readFile(path.resolve(srcDir, 'README.md'), { encoding: 'utf-8' });
19
-
20
- const presets = [];
21
- const rules = {};
22
- const extended = {};
23
-
24
- for (const file of files) {
25
- const filename = path.basename(file);
26
- const code = await readFile(path.resolve(dirname, 'src', filename), { encoding: 'utf-8' });
27
- const json = JSON.parse(stripComments(code));
28
- const compressed = JSON.stringify(json);
29
- await writeFile(path.resolve(dirname, filename), compressed, { encoding: 'utf-8' });
30
-
31
- const name = filename.replace(/^preset\.|\.json/g, '');
32
- presets.push(name);
33
- extended[name] = (json['extends'] || []).map(name => name.replace('markuplint:', ''));
34
-
35
- visit(
36
- code,
37
- {
38
- onComment(offset, length) {
39
- const comment = code.substring(offset, offset + length);
40
- const line = comment.split('\n');
41
- const text = line
42
- .map(line =>
43
- line
44
- .trim()
45
- .replace(/^\/\*\*|^\*\/|^\*\s*/g, '')
46
- .trim(),
47
- )
48
- .filter(s => s);
49
- const heading = text.shift();
50
- const desc = text.filter(t => !/^@see\s/i.test(t));
51
- const url = (text.find(t => /^@see\s/i.test(t)) || '').replace(/^@see\s/i, '');
52
-
53
- if (!heading) {
54
- return;
55
- }
56
-
57
- if (rules[heading]?.config) {
58
- rules[heading].config.push(name);
59
- } else {
60
- rules[heading] = {
61
- desc,
62
- url,
63
- config: [name],
64
- };
65
- }
66
- },
67
- },
68
- { disallowComments: false },
69
- );
70
- }
71
-
72
- presets.sort((a, b) => {
73
- if (a.includes('recommended')) {
74
- return -1;
75
- }
76
- return a - b;
77
- });
78
-
79
- const renderMd = mustache.render(md, {
80
- presets: () => {
81
- const line = [];
82
- line.push(`Ruleset|Description|${presets.map(p => `\`${p}\``).join('|')}|`);
83
- line.push(`---|---|${'---|'.repeat(presets.length)}`);
84
-
85
- Object.entries(rules).forEach(([name, context]) => {
86
- const title = context.url ? `[${name}](${context.url})` : name;
87
- const checks = presets.map(preset => {
88
- const configs = [preset, ...extended[preset]];
89
- const has = configs.some(config => context.config?.includes(config));
90
- return has ? '✅' : '❌';
91
- });
92
- line.push(`${title}|${context.desc.join(' ')}|${checks.join('|')}|`);
93
- });
94
-
95
- return line.join('\n');
96
- },
97
- });
98
-
99
- await writeFile('README.md', renderMd, { encoding: 'utf-8' });
@@ -1,3 +0,0 @@
1
- {
2
- "___configs": "test"
3
- }
package/src/README.md DELETED
@@ -1,39 +0,0 @@
1
- # @markuplint/config-presets
2
-
3
- [![npm version](https://badge.fury.io/js/%40markuplint%2Fconfig-presets.svg)](https://www.npmjs.com/package/@markuplint/config-presets)
4
- [![Build Status](https://travis-ci.org/markuplint/markuplint.svg?branch=main)](https://travis-ci.org/markuplint/markuplint)
5
- [![Coverage Status](https://coveralls.io/repos/github/markuplint/markuplint/badge.svg?branch=main)](https://coveralls.io/github/markuplint/markuplint?branch=main)
6
-
7
- ## Usage
8
-
9
- To the `extends` property of the configuration, specify like below:
10
-
11
- ```json
12
- {
13
- "extends": ["markuplint:recommended"]
14
- }
15
- ```
16
-
17
- You can choose some presets appropriately for your preference.
18
-
19
- ```json
20
- {
21
- "extends": ["markuplint:html-standard", "markuplint:a11y"]
22
- }
23
- ```
24
-
25
- ## Presets
26
-
27
- {{{ presets }}}
28
-
29
- ## Install
30
-
31
- `markuplint` package includes this package.
32
-
33
- If you are installing purposely, how below:
34
-
35
- ```sh
36
- $ npm install @markuplint/config-presets
37
-
38
- $ yarn add @markuplint/config-presets
39
- ```
@@ -1,153 +0,0 @@
1
- {
2
- "rules": {
3
- "disallowed-element": [
4
- /**
5
- * Disallow `<hgroup>`
6
- *
7
- * The hgroup element should not be used because no assistive technology supports it.
8
- *
9
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup
10
- */
11
- "hgroup"
12
- ],
13
-
14
- /**
15
- * Must not duplicate **ID**
16
- *
17
- * Be able to avoid problems in assistive technologies from the viewpoint of machine readability.
18
- *
19
- * @see https://www.w3.org/WAI/WCAG21/Techniques/html/H93.html
20
- */
21
- "id-duplication": true,
22
-
23
- "invalid-attr": {
24
- "option": {
25
- "attrs": {
26
- /**
27
- * Disallow `autofocus` attr
28
- *
29
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_considerations
30
- */
31
- "autofocus": {
32
- "disallowed": true
33
- },
34
-
35
- /**
36
- * Disallow `autofocus` attr
37
- *
38
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey#accessibility_concerns
39
- */
40
- "accesskey": {
41
- "disallowed": true
42
- },
43
-
44
- /**
45
- * `tabindex` attr only `-1` or `0`
46
- *
47
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#accessibility_concerns
48
- */
49
- "tabindex": {
50
- "enum": ["-1", "0"]
51
- }
52
- }
53
- }
54
- },
55
-
56
- /**
57
- * Use **landmark**
58
- *
59
- * @see https://www.w3.org/TR/wai-aria-practices/examples/landmarks/
60
- */
61
- "landmark-roles": true,
62
-
63
- /**
64
- * No refer to no existent **ID**
65
- */
66
- "no-refer-to-non-existent-id": true,
67
-
68
- /**
69
- * Require **accessible name**
70
- */
71
- "require-accessible-name": true,
72
-
73
- /**
74
- * Require `<h1>`
75
- *
76
- */
77
- "required-h1": true,
78
-
79
- /**
80
- * Use `<ul>`
81
- *
82
- */
83
- "use-list": true,
84
-
85
- /**
86
- * Conform to **WAI-ARIA**
87
- *
88
- */
89
- "wai-aria": true
90
- },
91
- "nodeRules": [
92
- {
93
- "selector": ":where(html)",
94
- "rules": {
95
- /**
96
- * Require `<html lang>`
97
- *
98
- */
99
- "required-attr": ["lang"]
100
- }
101
- },
102
- {
103
- "selector": ":where(abbr)",
104
- "rules": {
105
- /**
106
- * Require `<abbr title>`
107
- */
108
- "required-attr": ["title"]
109
- }
110
- },
111
- {
112
- "selector": ":where(video, audio)",
113
- "rules": {
114
- /**
115
- * Require `<track>`
116
- *
117
- */
118
- "required-element": ["track"]
119
- }
120
- },
121
- {
122
- "selector": ":where(video[autoplay])",
123
- "rules": {
124
- /**
125
- * Require `<video muted>`
126
- *
127
- */
128
- "required-attr": ["muted"]
129
- }
130
- },
131
- {
132
- /**
133
- * No merge cells
134
- *
135
- */
136
- "selector": ":where(th, td)",
137
- "rules": {
138
- "invalid-attr": {
139
- "option": {
140
- "attrs": {
141
- "colspan": {
142
- "disallowed": true
143
- },
144
- "rowspan": {
145
- "disallowed": true
146
- }
147
- }
148
- }
149
- }
150
- }
151
- }
152
- ]
153
- }
@@ -1,3 +0,0 @@
1
- {
2
- "rules": {}
3
- }
@@ -1,116 +0,0 @@
1
- {
2
- "rules": {
3
- /**
4
- * No duplicate attr
5
- *
6
- * The parser ignores all such duplicate occurrences of the attribute.
7
- *
8
- * @see https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute
9
- */
10
- "attr-duplication": true,
11
-
12
- /**
13
- * Use **character reference**
14
- *
15
- */
16
- "character-reference": true,
17
-
18
- /**
19
- * No use depreacted attr
20
- *
21
- * You should not use deprecated attributes from the viewpoint of compatibility.
22
- */
23
- "deprecated-attr": true,
24
-
25
- /**
26
- * No use depreacted element
27
- *
28
- * You should not use deprecated elements from the viewpoint of compatibility.
29
- */
30
- "deprecated-element": true,
31
-
32
- /**
33
- * Require `doctype`
34
- *
35
- * It has the effect of avoiding quirks mode.
36
- *
37
- * @see https://html.spec.whatwg.org/multipage/syntax.html#syntax-doctype
38
- */
39
- "doctype": true,
40
-
41
- /**
42
- * Must not duplicate **ID**
43
- *
44
- */
45
- "id-duplication": true,
46
-
47
- /**
48
- * No use ineffective attr
49
- *
50
- */
51
- "ineffective-attr": true,
52
-
53
- /**
54
- * No refer to no existent **ID**
55
- */
56
- "no-refer-to-non-existent-id": true,
57
-
58
- /**
59
- * Allow only **permitted contents**
60
- *
61
- */
62
- "permitted-contents": true,
63
-
64
- /**
65
- * Specify required attr
66
- *
67
- */
68
- "required-attr": true
69
- },
70
- "nodeRules": [
71
- {
72
- /**
73
- * Specify `charset=UTF-8`
74
- *
75
- * @see https://html.spec.whatwg.org/multipage/semantics.html#charset
76
- */
77
- "selector": ":where(head)",
78
- "rules": {
79
- "required-element": ["meta[charset=\"UTF-8\" i]"]
80
- }
81
- },
82
- {
83
- /**
84
- * No use `<small>` as **subheadings**
85
- *
86
- * Should not use it in `<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`, and `<h6>`.
87
- *
88
- * @see https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-small-element
89
- */
90
- "selector": "h1, h2, h3, h4, h5, h6",
91
- "rules": {
92
- "disallowed-element": {
93
- "value": ["small"],
94
- "reason": "The small element must not be used for subheadings. https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-small-element"
95
- }
96
- }
97
- },
98
- {
99
- /**
100
- * No use `<caption>` within `<figure>`
101
- *
102
- * When `<table>` is the only content in `<figure>` other than `<figcaption>`, `<caption>` should be omitted in favor of `<figcaption>`.
103
- *
104
- * @see https://html.spec.whatwg.org/multipage/tables.html#the-caption-element
105
- */
106
- "selector": ":where(figcaption ~ table, table:has(~ figcaption))",
107
- "rules": {
108
- "disallowed-element": {
109
- "value": ["caption"],
110
- "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)"
111
- },
112
- "require-accessible-name": false
113
- }
114
- }
115
- ]
116
- }
@@ -1,70 +0,0 @@
1
- {
2
- "nodeRules": [
3
- {
4
- /**
5
- * Require `charset=UTF-8`
6
- *
7
- * @see https://html.spec.whatwg.org/multipage/semantics.html#charset
8
- */
9
- "selector": ":where(head)",
10
- "rules": {
11
- "required-element": ["meta[charset=\"UTF-8\" i]"]
12
- }
13
- },
14
- {
15
- /**
16
- * Require `defer` attr
17
- *
18
- * Should load and parse scripts lazily to avoid render-blocking.
19
- */
20
- "selector": ":where(script[src]:not([type=module]))",
21
- "rules": {
22
- "required-attr": ["defer"]
23
- }
24
- },
25
- {
26
- /**
27
- * Require **aspect-ratio**
28
- *
29
- * Require `width` and `height` attr with `<img>` to avoid **Cumulative Layout Shift**
30
- */
31
- "selector": ":where(img[src])",
32
- "rules": {
33
- "required-attr": ["width", "height"]
34
- }
35
- },
36
- {
37
- /**
38
- * Require async decoding image
39
- *
40
- * Require `decoding=async` with `<img>` to avoid render-blocking.
41
- */
42
- "selector": ":where(img[src][width][height])",
43
- "rules": {
44
- "required-attr": [
45
- {
46
- "name": "decoding",
47
- "value": "async"
48
- }
49
- ]
50
- }
51
- },
52
- {
53
- /**
54
- * Require loading `<iframe>` lazily
55
- *
56
- * Require `loading=lazy` with `<iframe>` to avoid render-blocking that causes loading if its element is out of the viewport.
57
- */
58
- "selector": ":where(iframe)",
59
- "rules": {
60
- "required-attr": [
61
- "title",
62
- {
63
- "name": "loading",
64
- "value": "lazy"
65
- }
66
- ]
67
- }
68
- }
69
- ]
70
- }
@@ -1,27 +0,0 @@
1
- {
2
- "nodeRules": [
3
- {
4
- /**
5
- * Allow `property` attr with `<meta>`
6
- *
7
- * Be able to use **Open-Graph** etc.
8
- */
9
- "selector": ":where(meta[property])",
10
- "rules": {
11
- "invalid-attr": {
12
- "option": {
13
- "attrs": {
14
- "property": {
15
- "type": "NoEmptyAny"
16
- },
17
- "content": {
18
- "type": "NoEmptyAny"
19
- }
20
- }
21
- }
22
- },
23
- "required-attr": false
24
- }
25
- }
26
- ]
27
- }
@@ -1,19 +0,0 @@
1
- {
2
- "extends": [
3
- "markuplint:code-style",
4
- "markuplint:html-standard",
5
- "markuplint:a11y",
6
- "markuplint:performance",
7
- "markuplint:security",
8
- "markuplint:rdfa"
9
- ],
10
- "rules": {
11
- /**
12
- * No hard coding **ID**
13
- *
14
- * The component that hard-coded ID cannot mount to an app duplicated because the IDs must be unique in a document.
15
- * Recommend to specify dynamic IDs to avoid doing that.
16
- */
17
- "no-hard-code-id": true
18
- }
19
- }
@@ -1,19 +0,0 @@
1
- {
2
- "extends": [
3
- "markuplint:code-style",
4
- "markuplint:html-standard",
5
- "markuplint:a11y",
6
- "markuplint:performance",
7
- "markuplint:security",
8
- "markuplint:rdfa"
9
- ],
10
- "rules": {
11
- /**
12
- * No omit **end-tag**
13
- *
14
- * Recommend to write an end-tag always because it is too difficult
15
- * for a human decide an element is end-tag omittable.
16
- */
17
- "end-tag": true
18
- }
19
- }
@@ -1,19 +0,0 @@
1
- {
2
- "extends": [
3
- "markuplint:code-style",
4
- "markuplint:html-standard",
5
- "markuplint:a11y",
6
- "markuplint:performance",
7
- "markuplint:security",
8
- "markuplint:rdfa"
9
- ],
10
- "rules": {
11
- /**
12
- * No hard coding **ID**
13
- *
14
- * The component that hard-coded ID cannot mount to an app duplicated because the IDs must be unique in a document.
15
- * Recommend to specify dynamic IDs to avoid doing that.
16
- */
17
- "no-hard-code-id": true
18
- }
19
- }
@@ -1,19 +0,0 @@
1
- {
2
- "extends": [
3
- "markuplint:code-style",
4
- "markuplint:html-standard",
5
- "markuplint:a11y",
6
- "markuplint:performance",
7
- "markuplint:security",
8
- "markuplint:rdfa"
9
- ],
10
- "rules": {
11
- /**
12
- * No hard coding **ID**
13
- *
14
- * The component that hard-coded ID cannot mount to an app duplicated because the IDs must be unique in a document.
15
- * Recommend to specify dynamic IDs to avoid doing that.
16
- */
17
- "no-hard-code-id": true
18
- }
19
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": [
3
- "markuplint:code-style",
4
- "markuplint:html-standard",
5
- "markuplint:a11y",
6
- "markuplint:performance",
7
- "markuplint:security",
8
- "markuplint:rdfa"
9
- ]
10
- }
@@ -1,23 +0,0 @@
1
- {
2
- "nodeRules": [
3
- {
4
- /**
5
- * Require `noreferrer` with `target=_blank`
6
- *
7
- * Require `rel=noreferrer` with an element that has `target=_blank` to prevent leaking referrer information and to block operating referrer documents.
8
- */
9
- "selector": ":where(a[target=_blank], area[target=_blank])",
10
- "rules": {
11
- "required-attr": {
12
- "value": [
13
- {
14
- "name": "rel",
15
- "value": "/(?<![^\\s]+)noreferrer(?![^\\s]+)/"
16
- }
17
- ],
18
- "reason": "The \"rel\" attribute should be required with \"noreferrer\" if the \"a\" element has the \"target=_blank\""
19
- }
20
- }
21
- }
22
- ]
23
- }