Skip to content

Commit 1ae6468

Browse files
authored
Update docs and config for rules and keywords (#1738)
* Update docs and config for rules and keywords Added keywords for accessibility and SEO to several rule docs, clarified rule incompatibility with Prettier, and improved explanations for tagname rules. Updated configuration example for clarity and bumped embedded HTMLHint version in VS Code extension docs. Minor spelling update in cspell config and commit message instructions. * Update documentation rules and fix trailing newline Added guidelines for documentation language and referencing authoritative sources in general.mdc. Removed a trailing newline from attr-value-single-quotes.mdx.
1 parent 196e9f4 commit 1ae6468

15 files changed

+86
-47
lines changed

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"nomix",
6060
"noopener",
6161
"npmjs",
62+
"onclick",
6263
"onttt",
6364
"opencollective",
6465
"ossf",

.cursor/rules/general.mdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ alwaysApply: true
1616
- The workflows should be named `<workflow-name>.yml`.
1717
- All GitHub Actions should be pinned versions to avoid breaking changes (SHA-1).
1818
- If using actions/checkout, it should have `persist-credentials: false` set.
19+
20+
## Documentation
21+
22+
- All documentation should be written in US English.
23+
- For the 'Why this rule is important' section, always include a link to the relevant documentation and prefer MDN and Google documentation along with official documentation from the W3C.

.github/copilot-instructions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@
2626
- The workflows should be named `<workflow-name>.yml`.
2727
- All GitHub Actions should be pinned versions to avoid breaking changes (SHA-1).
2828
- If using actions/checkout, it should have `persist-credentials: false` set.
29+
30+
## GitHub Commit Messages
31+
32+
- If multiple changes are made then list changes using bullet points.

website/src/content/docs/configuration.md

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,52 +39,50 @@ An example configuration file (with all rules disabled):
3939

4040
```json
4141
{
42-
"rules": {
43-
"alt-require": false,
44-
"attr-lowercase": false,
45-
"attr-no-duplication": false,
46-
"attr-no-unnecessary-whitespace": false,
47-
"attr-sorted": false,
48-
"attr-unsafe-chars": false,
49-
"attr-value-double-quotes": false,
50-
"attr-value-no-duplication": false,
51-
"attr-value-not-empty": false,
52-
"attr-value-single-quotes": false,
53-
"attr-whitespace": false,
54-
"button-type-require": false,
55-
"doctype-first": false,
56-
"doctype-html5": false,
57-
"empty-tag-not-self-closed": false,
58-
"form-method-require": false,
59-
"frame-title-require": false,
60-
"h1-require": false,
61-
"head-script-disabled": false,
62-
"href-abs-or-rel": false,
63-
"html-lang-require": false,
64-
"id-class-ad-disabled": false,
65-
"id-class-value": false,
66-
"id-unique": false,
67-
"inline-script-disabled": false,
68-
"inline-style-disabled": false,
69-
"input-requires-label": false,
70-
"link-rel-canonical-require": false,
71-
"main-require": false,
72-
"meta-charset-require": false,
73-
"meta-description-require": false,
74-
"meta-viewport-require": false,
75-
"script-disabled": false,
76-
"space-tab-mixed-disabled": false,
77-
"spec-char-escape": false,
78-
"src-not-empty": false,
79-
"style-disabled": false,
80-
"tag-no-obsolete": false,
81-
"tag-pair": false,
82-
"tag-self-close": false,
83-
"tagname-lowercase": false,
84-
"tagname-specialchars": false,
85-
"tags-check": false,
86-
"title-require": false
87-
}
42+
"alt-require": false,
43+
"attr-lowercase": false,
44+
"attr-no-duplication": false,
45+
"attr-no-unnecessary-whitespace": false,
46+
"attr-sorted": false,
47+
"attr-unsafe-chars": false,
48+
"attr-value-double-quotes": false,
49+
"attr-value-no-duplication": false,
50+
"attr-value-not-empty": false,
51+
"attr-value-single-quotes": false,
52+
"attr-whitespace": false,
53+
"button-type-require": false,
54+
"doctype-first": false,
55+
"doctype-html5": false,
56+
"empty-tag-not-self-closed": false,
57+
"form-method-require": false,
58+
"frame-title-require": false,
59+
"h1-require": false,
60+
"head-script-disabled": false,
61+
"href-abs-or-rel": false,
62+
"html-lang-require": false,
63+
"id-class-ad-disabled": false,
64+
"id-class-value": false,
65+
"id-unique": false,
66+
"inline-script-disabled": false,
67+
"inline-style-disabled": false,
68+
"input-requires-label": false,
69+
"link-rel-canonical-require": false,
70+
"main-require": false,
71+
"meta-charset-require": false,
72+
"meta-description-require": false,
73+
"meta-viewport-require": false,
74+
"script-disabled": false,
75+
"space-tab-mixed-disabled": false,
76+
"spec-char-escape": false,
77+
"src-not-empty": false,
78+
"style-disabled": false,
79+
"tag-no-obsolete": false,
80+
"tag-pair": false,
81+
"tag-self-close": false,
82+
"tagname-lowercase": false,
83+
"tagname-specialchars": false,
84+
"tags-check": false,
85+
"title-require": false
8886
}
8987
```
9088

website/src/content/docs/rules/empty-tag-not-self-closed.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ Level: <Badge text="Warning" variant="caution" />
2626
```html
2727
<br />
2828
```
29+
30+
:::note
31+
This rule is incompatible with Prettier. If you use Prettier, you should disable this rule.
32+
:::

website/src/content/docs/rules/frame-title-require.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: frame-title-require
44
description: Requires that frame and iframe elements have an accessible name for screen readers and assistive technologies.
55
sidebar:
66
badge: New
7+
keywords:
8+
- accessibility
79
---
810

911
import { Badge } from '@astrojs/starlight/components';

website/src/content/docs/rules/h1-require.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
id: h1-require
33
title: h1-require
44
description: Ensures that an HTML document contains at least one `<h1>` element for proper document structure and accessibility.
5+
keywords:
6+
- accessibility
57
---
68

79
import { Badge } from '@astrojs/starlight/components';

website/src/content/docs/rules/html-lang-require.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: html-lang-require
44
description: Requires the lang attribute on the <html> element to ensure proper language declaration for accessibility and SEO.
55
keywords:
66
- i18n
7+
- accessibility
8+
- SEO
79
---
810

911
import { Badge } from '@astrojs/starlight/components';

website/src/content/docs/rules/main-require.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
id: main-require
33
title: main-require
44
description: Ensures that an HTML document contains a `<main>` element within the `<body>` tag for proper document structure and accessibility.
5+
keywords:
6+
- accessibility
57
---
68

79
import { Badge } from '@astrojs/starlight/components';

website/src/content/docs/rules/meta-description-require.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ title: meta-description-require
44
description: Ensures every HTML document includes a non-blank meta description tag within the head element for better SEO.
55
sidebar:
66
badge: New
7+
keywords:
8+
- accessibility
9+
- SEO
710
---
811

912
import { Badge } from '@astrojs/starlight/components';

0 commit comments

Comments
 (0)