Skip to content

Commit 8b9ddd3

Browse files
committed
docs(html-lang-require): add missing documentation
1 parent 1e85c6e commit 8b9ddd3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

docs/user-guide/list-rules.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ title: List of rules
99

1010
- [`doctype-first`](/docs/user-guide/rules/doctype-first): Doctype must be declared first.
1111
- [`doctype-html5`](/docs/user-guide/rules/doctype-html5): Invalid doctype.
12+
- [`html-lang-require`](/docs/user-guide/rules/html-lang-require): The HTML lang attribute is required.
1213
- [`head-script-disabled`](/docs/user-guide/rules/head-script-disabled): The `<script>` tag cannot be used in a tag.
1314
- [`style-disabled`](/docs/user-guide/rules/style-disabled): `<style>` tags cannot be used.
1415
- [`title-require`](/docs/user-guide/rules/title-require): `<title>` must be present in `<head>` tag.
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
id: html-lang-require
3+
title: html-lang-require
4+
keywords:
5+
- i18n
6+
---
7+
8+
The lang attribute of an `<html>` element must be present and should be valid.
9+
10+
Level: warning
11+
12+
## Config value
13+
14+
1. true: enable rule
15+
2. false: disable rule
16+
17+
The following pattern are **not** considered rule violations:
18+
19+
<!-- prettier-ignore -->
20+
```html
21+
<html lang="en"></html>
22+
```
23+
24+
The following patterns are considered a rule violations:
25+
26+
<!-- prettier-ignore -->
27+
```html
28+
<!-- missing lang tag -->
29+
<html></html>
30+
```
31+
32+
<!-- prettier-ignore -->
33+
```html
34+
<!-- empty lang tag -->
35+
<html lang=""></html>
36+
```
37+
38+
<!-- prettier-ignore -->
39+
```html
40+
<!-- invalid BCP 47 lang value -->
41+
<html lang="-"></html>
42+
```

0 commit comments

Comments
 (0)