File tree 2 files changed +43
-0
lines changed
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ title: List of rules
9
9
10
10
- [ ` doctype-first ` ] ( /docs/user-guide/rules/doctype-first ) : Doctype must be declared first.
11
11
- [ ` 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.
12
13
- [ ` head-script-disabled ` ] ( /docs/user-guide/rules/head-script-disabled ) : The ` <script> ` tag cannot be used in a tag.
13
14
- [ ` style-disabled ` ] ( /docs/user-guide/rules/style-disabled ) : ` <style> ` tags cannot be used.
14
15
- [ ` title-require ` ] ( /docs/user-guide/rules/title-require ) : ` <title> ` must be present in ` <head> ` tag.
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments