diff --git a/.cspell.json b/.cspell.json index 18c0527a6..1b567ea39 100644 --- a/.cspell.json +++ b/.cspell.json @@ -59,6 +59,7 @@ "nomix", "noopener", "npmjs", + "onclick", "onttt", "opencollective", "ossf", diff --git a/.cursor/rules/general.mdc b/.cursor/rules/general.mdc index af842668c..03f52526c 100644 --- a/.cursor/rules/general.mdc +++ b/.cursor/rules/general.mdc @@ -16,3 +16,8 @@ alwaysApply: true - The workflows should be named `.yml`. - All GitHub Actions should be pinned versions to avoid breaking changes (SHA-1). - If using actions/checkout, it should have `persist-credentials: false` set. + +## Documentation + +- All documentation should be written in US English. +- 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. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f270365f0..b7d8fc4df 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -26,3 +26,7 @@ - The workflows should be named `.yml`. - All GitHub Actions should be pinned versions to avoid breaking changes (SHA-1). - If using actions/checkout, it should have `persist-credentials: false` set. + +## GitHub Commit Messages + +- If multiple changes are made then list changes using bullet points. diff --git a/website/src/content/docs/configuration.md b/website/src/content/docs/configuration.md index 183f67430..dff5782a0 100644 --- a/website/src/content/docs/configuration.md +++ b/website/src/content/docs/configuration.md @@ -39,52 +39,50 @@ An example configuration file (with all rules disabled): ```json { - "rules": { - "alt-require": false, - "attr-lowercase": false, - "attr-no-duplication": false, - "attr-no-unnecessary-whitespace": false, - "attr-sorted": false, - "attr-unsafe-chars": false, - "attr-value-double-quotes": false, - "attr-value-no-duplication": false, - "attr-value-not-empty": false, - "attr-value-single-quotes": false, - "attr-whitespace": false, - "button-type-require": false, - "doctype-first": false, - "doctype-html5": false, - "empty-tag-not-self-closed": false, - "form-method-require": false, - "frame-title-require": false, - "h1-require": false, - "head-script-disabled": false, - "href-abs-or-rel": false, - "html-lang-require": false, - "id-class-ad-disabled": false, - "id-class-value": false, - "id-unique": false, - "inline-script-disabled": false, - "inline-style-disabled": false, - "input-requires-label": false, - "link-rel-canonical-require": false, - "main-require": false, - "meta-charset-require": false, - "meta-description-require": false, - "meta-viewport-require": false, - "script-disabled": false, - "space-tab-mixed-disabled": false, - "spec-char-escape": false, - "src-not-empty": false, - "style-disabled": false, - "tag-no-obsolete": false, - "tag-pair": false, - "tag-self-close": false, - "tagname-lowercase": false, - "tagname-specialchars": false, - "tags-check": false, - "title-require": false - } + "alt-require": false, + "attr-lowercase": false, + "attr-no-duplication": false, + "attr-no-unnecessary-whitespace": false, + "attr-sorted": false, + "attr-unsafe-chars": false, + "attr-value-double-quotes": false, + "attr-value-no-duplication": false, + "attr-value-not-empty": false, + "attr-value-single-quotes": false, + "attr-whitespace": false, + "button-type-require": false, + "doctype-first": false, + "doctype-html5": false, + "empty-tag-not-self-closed": false, + "form-method-require": false, + "frame-title-require": false, + "h1-require": false, + "head-script-disabled": false, + "href-abs-or-rel": false, + "html-lang-require": false, + "id-class-ad-disabled": false, + "id-class-value": false, + "id-unique": false, + "inline-script-disabled": false, + "inline-style-disabled": false, + "input-requires-label": false, + "link-rel-canonical-require": false, + "main-require": false, + "meta-charset-require": false, + "meta-description-require": false, + "meta-viewport-require": false, + "script-disabled": false, + "space-tab-mixed-disabled": false, + "spec-char-escape": false, + "src-not-empty": false, + "style-disabled": false, + "tag-no-obsolete": false, + "tag-pair": false, + "tag-self-close": false, + "tagname-lowercase": false, + "tagname-specialchars": false, + "tags-check": false, + "title-require": false } ``` diff --git a/website/src/content/docs/rules/empty-tag-not-self-closed.mdx b/website/src/content/docs/rules/empty-tag-not-self-closed.mdx index 1bdda4f41..3b13c1167 100644 --- a/website/src/content/docs/rules/empty-tag-not-self-closed.mdx +++ b/website/src/content/docs/rules/empty-tag-not-self-closed.mdx @@ -26,3 +26,7 @@ Level: ```html
``` + +:::note +This rule is incompatible with Prettier. If you use Prettier, you should disable this rule. +::: diff --git a/website/src/content/docs/rules/frame-title-require.mdx b/website/src/content/docs/rules/frame-title-require.mdx index 039331e35..bcb0a36ef 100644 --- a/website/src/content/docs/rules/frame-title-require.mdx +++ b/website/src/content/docs/rules/frame-title-require.mdx @@ -4,6 +4,8 @@ title: frame-title-require description: Requires that frame and iframe elements have an accessible name for screen readers and assistive technologies. sidebar: badge: New +keywords: + - accessibility --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/rules/h1-require.mdx b/website/src/content/docs/rules/h1-require.mdx index 31519cc2f..584bc7283 100644 --- a/website/src/content/docs/rules/h1-require.mdx +++ b/website/src/content/docs/rules/h1-require.mdx @@ -2,6 +2,8 @@ id: h1-require title: h1-require description: Ensures that an HTML document contains at least one `

` element for proper document structure and accessibility. +keywords: + - accessibility --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/rules/html-lang-require.mdx b/website/src/content/docs/rules/html-lang-require.mdx index 484d8776a..843be0606 100644 --- a/website/src/content/docs/rules/html-lang-require.mdx +++ b/website/src/content/docs/rules/html-lang-require.mdx @@ -4,6 +4,8 @@ title: html-lang-require description: Requires the lang attribute on the element to ensure proper language declaration for accessibility and SEO. keywords: - i18n + - accessibility + - SEO --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/rules/main-require.mdx b/website/src/content/docs/rules/main-require.mdx index c9926dd60..970898b58 100644 --- a/website/src/content/docs/rules/main-require.mdx +++ b/website/src/content/docs/rules/main-require.mdx @@ -2,6 +2,8 @@ id: main-require title: main-require description: Ensures that an HTML document contains a `
` element within the `` tag for proper document structure and accessibility. +keywords: + - accessibility --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/rules/meta-description-require.mdx b/website/src/content/docs/rules/meta-description-require.mdx index c77a86332..9b8deb7b6 100644 --- a/website/src/content/docs/rules/meta-description-require.mdx +++ b/website/src/content/docs/rules/meta-description-require.mdx @@ -4,6 +4,9 @@ title: meta-description-require description: Ensures every HTML document includes a non-blank meta description tag within the head element for better SEO. sidebar: badge: New +keywords: + - accessibility + - SEO --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/rules/meta-viewport-require.mdx b/website/src/content/docs/rules/meta-viewport-require.mdx index b5300426a..e1ac81e20 100644 --- a/website/src/content/docs/rules/meta-viewport-require.mdx +++ b/website/src/content/docs/rules/meta-viewport-require.mdx @@ -4,6 +4,8 @@ title: meta-viewport-require description: Ensures every HTML document includes a meta viewport tag within the head element for proper responsive design. sidebar: badge: New +keywords: + - accessibility --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/rules/tagname-lowercase.mdx b/website/src/content/docs/rules/tagname-lowercase.mdx index 35a49074a..f0d26d7f4 100644 --- a/website/src/content/docs/rules/tagname-lowercase.mdx +++ b/website/src/content/docs/rules/tagname-lowercase.mdx @@ -27,3 +27,8 @@ Level: ```html
``` + +### Why this rule is important + +Lowercase tagnames typically have higher compression rates compared to uppercase tagnames allowing for slightly faster page loads. +Lowercase tagnames are also more readable and easier to understand. diff --git a/website/src/content/docs/rules/tagname-specialchars.mdx b/website/src/content/docs/rules/tagname-specialchars.mdx index fcf105f85..7281f2c63 100644 --- a/website/src/content/docs/rules/tagname-specialchars.mdx +++ b/website/src/content/docs/rules/tagname-specialchars.mdx @@ -27,3 +27,9 @@ Level: <@ href="link"> <$pan>aab ``` + +### Why this rule is important + +Tagnames should only contain allowed characters to ensure consistency and readability. + +Further reading: [HTML5 Specification - Tag names](https://html.spec.whatwg.org/multipage/syntax.html#syntax-tag-name) diff --git a/website/src/content/docs/rules/title-require.mdx b/website/src/content/docs/rules/title-require.mdx index b8eab01df..75fff8746 100644 --- a/website/src/content/docs/rules/title-require.mdx +++ b/website/src/content/docs/rules/title-require.mdx @@ -2,6 +2,9 @@ id: title-require title: title-require description: Ensures every HTML document includes a tag within the <head> for accessibility and SEO. +keywords: + - accessibility + - SEO --- import { Badge } from '@astrojs/starlight/components'; diff --git a/website/src/content/docs/vs-code-extension.mdx b/website/src/content/docs/vs-code-extension.mdx index 369e439ab..c1a2a172a 100644 --- a/website/src/content/docs/vs-code-extension.mdx +++ b/website/src/content/docs/vs-code-extension.mdx @@ -9,7 +9,7 @@ import { LinkCard, CardGrid } from '@astrojs/starlight/components' Get realtime linting feedback in Visual Studio Code with the HTMLHint extension. This extension provides a seamless integration of HTMLHint into your development workflow, allowing you to catch HTML issues as you type. -The HTMLHint extension will attempt to use the locally installed HTMLHint module (the project-specific module if present, or a globally installed HTMLHint module). If a locally installed HTMLHint isn't available, the extension will use the embedded version (current version 1.6.3). +The HTMLHint extension will attempt to use the locally installed HTMLHint module (the project-specific module if present, or a globally installed HTMLHint module). If a locally installed HTMLHint isn't available, the extension will use the embedded version (current version 1.7.0). ## Download