Skip to content

Commit

Permalink
build(lint): Add htmlhint to lint htm and html (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
aifrak authored Oct 17, 2021
1 parent 953f285 commit 19b1061
Show file tree
Hide file tree
Showing 12 changed files with 635 additions and 1 deletion.
1 change: 1 addition & 0 deletions .check.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
{:css_lint, "./run css:lint"},
{:dockerfile_lint, "./run dockerfile:lint"},
{:elixir_eex_lint, "./run elixir:eex:lint"},
{:html_lint, "./run html:lint"},
{:markdown_lint, "./run markdown:lint"},
{:prettier_lint, "./run prettier:lint"},
{:shell_lint, "./run shell:lint"},
Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// EditorConfig
"editorconfig.editorconfig",

// HTML
"mkaufman.htmlhint",

// CSS, SCSS, SASS, LESS
"stylelint.vscode-stylelint",

Expand Down
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ chore:
- "**/.gitignore"
- "**/.gitkeep"
- .hadolint*
- .htmlhint*
- .husky/**/*
- .lintstaged*
- .markdownlint*
- .stylelint*
- "**/.npmrc"
- .prettier*
- .vscode/**/*
Expand Down
35 changes: 35 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"alt-require": true,
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-no-unnecessary-whitespace": true,
"attr-sorted": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": false,
"attr-value-single-quotes": false,
"attr-whitespace": true,
"doctype-first": false,
"doctype-html5": true,
"empty-tag-not-self-closed": true,
"head-script-disabled": false,
"html-lang-require": true,
"href-abs-or-rel": false,
"id-class-ad-disabled": true,
"id-class-value": false,
"id-unique": true,
"inline-script-disabled": true,
"inline-style-disabled": true,
"input-requires-label": false,
"script-disabled": true,
"space-tab-mixed-disabled": true,
"spec-char-escape": false,
"src-not-empty": true,
"style-disabled": true,
"tag-pair": false,
"tag-self-close": true,
"tagname-lowercase": true,
"tagname-specialchars": true,
"tags-check": true,
"title-require": true
}
7 changes: 6 additions & 1 deletion .lintstagedrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
- ./run css:lint
- ./run prettier:lint

"*.{htm,html}":
- ./run prettier:format
- ./run html:lint
- ./run prettier:lint

"*.html.{eex,leex}":
- ./run elixir:eex:format
- ./run elixir:eex:lint
Expand All @@ -23,7 +28,7 @@
- ./run dockerfile:format
- ./run dockerfile:lint

"*.{json,yaml,yml}":
"*.{json,yaml,yml,htmlhintrc}":
- ./run prettier:format
- ./run prettier:lint

Expand Down
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
// Remote container
"ms-vscode-remote.remote-containers",

// HTML:
"mkaufman.htmlhint",

// CSS, SCSS, SASS, LESS:
"stylelint.vscode-stylelint",

// EditorConfig:
"editorconfig.editorconfig",

Expand Down
30 changes: 30 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,36 @@
"args": ["dockerfile:lint"],
"problemMatcher": [],
"detail": "Lint all Dockerfiles"
},
/* -------------------------------------------- */
/* CSS, SCSS, SASS, LESS */
/* -------------------------------------------- */
{
"label": "css:format",
"type": "shell",
"command": "./run",
"args": ["css:format "],
"problemMatcher": [],
"detail": "Format CSS, SCSS, SASS, LESS and any files containing CSS"
},
{
"label": "css:lint",
"type": "shell",
"command": "./run",
"args": ["css:lint "],
"problemMatcher": [],
"detail": "Lint CSS, SCSS, SASS, LESS and any files containing CSS"
},
/* -------------------------------------------- */
/* HTML */
/* -------------------------------------------- */
{
"label": "html:lint",
"type": "shell",
"command": "./run",
"args": ["html:lint"],
"problemMatcher": [],
"detail": "Lint HTML files and templates"
}
],
"inputs": [
Expand Down
Loading

0 comments on commit 19b1061

Please sign in to comment.