Skip to content

Commit 796fe17

Browse files
authored
build(lint): Add htmlhint to lint htm and html (#104)
1 parent 1b560a0 commit 796fe17

14 files changed

+621
-10
lines changed

.devcontainer/devcontainer.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
// EditorConfig
1515
"editorconfig.editorconfig",
1616

17+
// HTML
18+
"mkaufman.htmlhint",
19+
20+
// CSS, SCSS, SASS, LESS
21+
"stylelint.vscode-stylelint",
22+
1723
// Commit:
1824
"joshbolduc.commitlint",
1925
"vivaxy.vscode-conventional-commits",
@@ -44,9 +50,6 @@
4450
// Formatters
4551
"esbenp.prettier-vscode",
4652

47-
// Lints
48-
"stylelint.vscode-stylelint",
49-
5053
// Comments
5154
"stackbreak.comment-divider",
5255

.github/labeler.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ documentation:
1616
- "**/*.md"
1717

1818
chore:
19-
- .commitlintrc.js
19+
- .commitlint*
2020
- .cz.json
2121
- .devcontainer
2222
- .editorconfig
2323
- "**/.gitignore"
2424
- "**/.gitkeep"
2525
- .hadolint*
26+
- .htmlhint*
2627
- .husky/**/*
2728
- .lintstaged*
2829
- .markdownlint*
30+
- .stylelint*
2931
- "**/.npmrc"
3032
- .prettier*
3133
- .vscode/**/*

.htmlhintrc

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"alt-require": true,
3+
"attr-lowercase": true,
4+
"attr-no-duplication": true,
5+
"attr-no-unnecessary-whitespace": true,
6+
"attr-sorted": true,
7+
"attr-unsafe-chars": true,
8+
"attr-value-double-quotes": true,
9+
"attr-value-not-empty": false,
10+
"attr-value-single-quotes": false,
11+
"attr-whitespace": true,
12+
"doctype-first": false,
13+
"doctype-html5": true,
14+
"empty-tag-not-self-closed": true,
15+
"head-script-disabled": false,
16+
"html-lang-require": true,
17+
"href-abs-or-rel": false,
18+
"id-class-ad-disabled": true,
19+
"id-class-value": false,
20+
"id-unique": true,
21+
"inline-script-disabled": true,
22+
"inline-style-disabled": true,
23+
"input-requires-label": false,
24+
"script-disabled": true,
25+
"space-tab-mixed-disabled": true,
26+
"spec-char-escape": false,
27+
"src-not-empty": true,
28+
"style-disabled": true,
29+
"tag-pair": false,
30+
"tag-self-close": true,
31+
"tagname-lowercase": true,
32+
"tagname-specialchars": true,
33+
"tags-check": true,
34+
"title-require": true
35+
}

.lintstagedrc.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- ./run css:lint
88
- ./run prettier:lint
99

10+
"*.{htm,html}":
11+
- ./run prettier:format
12+
- ./run html:lint
13+
- ./run prettier:lint
14+
1015
"{run,.husky/*,*.sh}":
1116
- ./run shell:format
1217
- ./run shell:lint
@@ -15,7 +20,7 @@
1520
- ./run dockerfile:format
1621
- ./run dockerfile:lint
1722

18-
"*.{json,yaml,yml}":
23+
"*.{json,yaml,yml,htmlhintrc}":
1924
- ./run prettier:format
2025
- ./run prettier:lint
2126

.vscode/extensions.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
// Remote container
44
"ms-vscode-remote.remote-containers",
55

6+
// HTML:
7+
"mkaufman.htmlhint",
8+
9+
// CSS, SCSS, SASS, LESS:
10+
"stylelint.vscode-stylelint",
11+
612
// EditorConfig:
713
"editorconfig.editorconfig",
814

@@ -34,9 +40,6 @@
3440
"shd101wyy.markdown-preview-enhanced",
3541
"yzhang.markdown-all-in-one",
3642

37-
// Lints:
38-
"stylelint.vscode-stylelint",
39-
4043
// Formatters:
4144
"esbenp.prettier-vscode",
4245

.vscode/tasks.json

+11
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@
190190
"args": ["css:lint "],
191191
"problemMatcher": [],
192192
"detail": "Lint SCSS, Sass, Less and all files containing CSS"
193+
},
194+
/* -------------------------------------------- */
195+
/* HTML */
196+
/* -------------------------------------------- */
197+
{
198+
"label": "html:lint",
199+
"type": "shell",
200+
"command": "./run",
201+
"args": ["html:lint"],
202+
"problemMatcher": [],
203+
"detail": "Lint HTML files and templates"
193204
}
194205
],
195206
"inputs": [

0 commit comments

Comments
 (0)