Skip to content

Commit 06851f5

Browse files
committed
Docs: formatting
format mdx with Prettier
1 parent 1312a4b commit 06851f5

38 files changed

+37
-54
lines changed

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ npm-debug.log*
2020
/test/**/*.html
2121
/test/**/*.xml
2222

23-
# CHANGELOG.md will be generated by semantic-release
24-
CHANGELOG.md
23+
changelog.mdx
2524

2625
# Report created by test
2726
report.html
2827

2928
# Miscellaneous
3029
CODEOWNERS
31-
*.mdx
3230
*.txt
3331

3432
## Website

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"semi": false,
33
"singleQuote": true,
44
"bracketSpacing": true,
5+
"embeddedLanguageFormatting": "off",
56
"trailingComma": "es5",
67
"useTabs": false,
78
"tabWidth": 2,

website/.htmlhintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"attr-whitespace": false,
1212
"doctype-first": false,
1313
"doctype-html5": true,
14+
"h1-require": true,
1415
"head-script-disabled": false,
1516
"href-abs-or-rel": false,
1617
"html-lang-require": true,
@@ -20,6 +21,7 @@
2021
"inline-script-disabled": false,
2122
"inline-style-disabled": false,
2223
"input-requires-label": false,
24+
"main-require": true,
2325
"script-disabled": false,
2426
"space-tab-mixed-disabled": false,
2527
"spec-char-escape": false,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ keywords:
1010

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

13-
1413
Alt of `img` must be present and alt of `area[href]` and `input[type=image]` must be set with a value.
1514

1615
Level: <Badge text="Warning" variant="caution" />

website/src/content/docs/rules/attr-lowercase.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ description: Enforces all attribute names in HTML to be lowercase for consistenc
66

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

9-
109
Attribute name must be lowercase.
1110

1211
Level: <Badge text="Error" variant="danger" />
@@ -27,7 +26,6 @@ Level: <Badge text="Error" variant="danger" />
2726
}
2827
```
2928

30-
3129
### The following pattern is **not** considered a rule violation:
3230

3331
```html
@@ -37,7 +35,6 @@ Level: <Badge text="Error" variant="danger" />
3735
<svg width="200" height="200" viewBox="0 0 200 200" />
3836
```
3937

40-
4138
### The following pattern is considered a rule violation:
4239

4340
```html

website/src/content/docs/rules/attr-no-unnecessary-whitespace.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: attr-no-unnecessary-whitespace
33
title: attr-no-unnecessary-whitespace
44
description: Disallows unnecessary spaces between attribute names and values in HTML elements.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
No spaces between attribute names and values.

website/src/content/docs/rules/attr-sorted.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: attr-sorted
33
title: attr-sorted
44
description: Enforces a specific order for attributes in HTML elements to improve readability and consistency.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Attributes should be sorted in the following order:
@@ -26,15 +27,12 @@ Level: <Badge text="Error" variant="danger" />
2627
1. true: enable rule
2728
2. false: disable rule
2829

29-
3030
### The following patterns are **not** considered rule violations:
3131

3232
```html
3333
<div img="image" meta="meta" font="font"></div>
3434
```
3535

36-
37-
3836
### The following pattern is considered a rule violation:
3937

4038
```html

website/src/content/docs/rules/attr-unsafe-chars.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: attr-unsafe-chars
33
title: attr-unsafe-chars
44
description: Disallows unsafe characters in attribute values to prevent rendering and security issues.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Attribute value cannot use unsafe chars.
@@ -16,7 +17,6 @@ Level: <Badge text="Warning" variant="caution" />
1617
1. true: enable rule
1718
2. false: disable rule
1819

19-
2020
### The following patterns are **not** considered rule violations:
2121

2222
```html
@@ -25,7 +25,6 @@ Level: <Badge text="Warning" variant="caution" />
2525
</li>
2626
```
2727

28-
2928
### The following pattern is considered a rule violation:
3029

3130
```html

website/src/content/docs/rules/attr-value-double-quotes.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: attr-value-double-quotes
33
title: attr-value-double-quotes
44
description: Requires attribute values in HTML to be enclosed in double quotes for consistency and standards compliance.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Attribute value must closed by double quotes.
@@ -14,14 +15,12 @@ Level: <Badge text="Error" variant="danger" />
1415
1. true: enable rule
1516
2. false: disable rule
1617

17-
1818
### The following patterns are **not** considered rule violations:
1919

2020
```html
2121
<a href="" title="abc"></a>
2222
```
2323

24-
2524
### The following pattern is considered a rule violation:
2625

2726
```html

website/src/content/docs/rules/attr-value-not-empty.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: attr-value-not-empty
33
title: attr-value-not-empty
44
description: Ensures all attributes have non-empty values to prevent invalid or ambiguous HTML.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Attribute must set value.
@@ -20,7 +21,6 @@ Level: <Badge text="Warning" variant="caution" />
2021
<input type="button" disabled="disabled" />
2122
```
2223

23-
2424
### The following pattern is considered a rule violation:
2525

2626
```html

website/src/content/docs/rules/attr-value-single-quotes.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ id: attr-value-single-quotes
33
title: attr-value-single-quotes
44
description: Requires attribute values in HTML to be enclosed in single quotes for consistency.
55
---
6-
import { Badge } from '@astrojs/starlight/components';
76

7+
import { Badge } from '@astrojs/starlight/components';
88

99
Attribute value must closed by single quotes.
1010

@@ -15,7 +15,6 @@ Level: <Badge text="Error" variant="danger" />
1515
1. true: enable rule
1616
2. false: disable rule
1717

18-
1918
### The following patterns are **not** considered rule violations:
2019

2120
```html

website/src/content/docs/rules/attr-whitespace.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ id: attr-whitespace
33
title: attr-whitespace
44
description: Disallows leading or trailing spaces inside attribute values to ensure clean and valid HTML.
55
---
6-
import { Badge } from '@astrojs/starlight/components';
76

7+
import { Badge } from '@astrojs/starlight/components';
88

99
No leading or trailing spaces inside attribute values.
1010

website/src/content/docs/rules/doctype-first.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: doctype-first
33
title: doctype-first
44
description: Ensures the doctype declaration appears before any non-comment content in HTML documents.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Doctype must be declared before any non-comment content. Comments and whitespace are allowed before the DOCTYPE declaration.
@@ -14,7 +15,6 @@ Level: <Badge text="Error" variant="danger" />
1415
1. true: enable rule
1516
2. false: disable rule
1617

17-
1818
### The following patterns are **not** considered rule violations:
1919

2020
```html

website/src/content/docs/rules/doctype-html5.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: doctype-html5
33
title: doctype-html5
44
description: Ensures the doctype is HTML5.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Doctype must be HTML5.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: empty-tag-not-self-closed
33
title: empty-tag-not-self-closed
44
description: Ensures empty HTML tags are not self-closed, following HTML standards for void elements.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
The empty tag should not be closed by self.
@@ -14,14 +15,12 @@ Level: <Badge text="Warning" variant="caution" />
1415
1. true: enable rule
1516
2. false: disable rule
1617

17-
1818
### The following patterns are **not** considered rule violations:
1919

2020
```html
2121
<br>
2222
```
2323

24-
2524
### The following pattern is considered a rule violation:
2625

2726
```html

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description: Ensures that an HTML document contains at least one `<h1>` element
55
sidebar:
66
badge: New
77
---
8+
89
import { Badge } from '@astrojs/starlight/components';
910

1011
A H1 heading element is required in HTML documents. The heading can not be empty. This rule ensures that the document has a clear and accessible structure, which is important for both users and search engines.
@@ -16,7 +17,6 @@ Level: <Badge text="Warning" variant="caution" />
1617
1. true: enable rule
1718
2. false: disable rule
1819

19-
2020
### The following patterns are **not** considered rule violations:
2121

2222
```html

website/src/content/docs/rules/head-script-disabled.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Level: <Badge text="Warning" variant="caution" />
1515
1. true: enable rule
1616
2. false: disable rule
1717

18-
1918
### The following patterns are **not** considered rule violations:
2019

2120
```html

website/src/content/docs/rules/href-abs-or-rel.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: href-abs-or-rel
33
title: href-abs-or-rel
44
description: Enforces href attributes to be either absolute or relative URLs as specified in the configuration.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Href must be absolute or relative.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description: Requires the lang attribute on the <html> element to ensure proper
55
keywords:
66
- i18n
77
---
8-
import { Badge } from '@astrojs/starlight/components';
98

9+
import { Badge } from '@astrojs/starlight/components';
1010

1111
The lang attribute of an `<html>` element must be present and should be valid.
1212

website/src/content/docs/rules/id-class-ad-disabled.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: id-class-ad-disabled
33
title: id-class-ad-disabled
44
description: Prevents the use of 'ad' in id or class attributes to avoid issues with ad blockers.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Id and class can not use ad keyword, it will blocked by adblock software.
@@ -14,14 +15,12 @@ Level: <Badge text="Warning" variant="caution" />
1415
1. true: enable rule
1516
2. false: disable rule
1617

17-
1818
### The following patterns are **not** considered rule violations:
1919

2020
```html
2121
<div id="adcontainer"></div>
2222
```
2323

24-
2524
### The following pattern is considered a rule violation:
2625

2726
```html

website/src/content/docs/rules/id-class-value.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ id: id-class-value
33
title: id-class-value
44
description: Enforces specific naming conventions for id and class attribute values in HTML elements.
55
---
6-
import { Badge } from '@astrojs/starlight/components';
76

7+
import { Badge } from '@astrojs/starlight/components';
88

99
Id and class value must meet some rules: underline, dash, hump.
1010

@@ -17,7 +17,6 @@ Level: <Badge text="Warning" variant="caution" />
1717
3. hump: enable rule ( aaaBbb )
1818
4. false: disable rule
1919

20-
2120
### The following patterns are **not** considered rule violations:
2221

2322
```html

website/src/content/docs/rules/id-unique.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ id: id-unique
33
title: id-unique
44
description: Ensures all id attributes in an HTML document are unique to prevent conflicts and unexpected behavior.
55
---
6-
import { Badge } from '@astrojs/starlight/components';
76

7+
import { Badge } from '@astrojs/starlight/components'
88

99
ID attributes must be unique in the document.
1010

@@ -15,14 +15,12 @@ Level: <Badge text="Error" variant="danger" />
1515
1. true: enable rule
1616
2. false: disable rule
1717

18-
1918
### The following patterns are **not** considered rule violations:
2019

2120
```html
2221
<div id="id1"></div><div id="id2"></div>
2322
```
2423

25-
2624
### The following pattern is considered a rule violation:
2725

2826
```html

website/src/content/docs/rules/inline-script-disabled.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ id: inline-script-disabled
33
title: inline-script-disabled
44
description: Disallows the use of inline JavaScript in HTML elements for improved security and maintainability.
55
---
6-
import { Badge } from '@astrojs/starlight/components';
76

7+
import { Badge } from '@astrojs/starlight/components';
88

99
Inline script cannot be used.
1010

website/src/content/docs/rules/inline-style-disabled.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: inline-style-disabled
33
title: inline-style-disabled
44
description: Disallows the use of inline style attributes to promote separation of content and presentation.
55
---
6+
67
import { Badge } from '@astrojs/starlight/components';
78

89
Inline style cannot be used.

website/src/content/docs/rules/input-requires-label.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ keywords:
77
- label
88
- accessibility
99
---
10-
import { Badge } from '@astrojs/starlight/components';
1110

11+
import { Badge } from '@astrojs/starlight/components';
1212

1313
All `<input>` tags must have a corresponding `<label>` tag.
1414

@@ -19,7 +19,6 @@ Level: <Badge text="Warning" variant="caution" />
1919
1. true: enable rule
2020
2. false: disable rule
2121

22-
2322
### The following patterns are **not** considered rule violations:
2423

2524
```html

0 commit comments

Comments
 (0)