Add linting
This commit is contained in:
parent
3ea69c95c8
commit
1bb4339364
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"extends": ["html-validate:recommended"],
|
||||
"rules": {
|
||||
"doctype-style": ["off"],
|
||||
"void-style": ["error", { "style": "selfclosing" }],
|
||||
"valid-id": ["warn", { "relaxed": true}],
|
||||
"no-autoplay": ["warn"],
|
||||
"no-inline-style": ["warn", { "allowedProperties": [
|
||||
"display",
|
||||
"font-size",
|
||||
"font-family",
|
||||
"margin-bottom",
|
||||
"margin-top",
|
||||
"margin-left",
|
||||
"margin-right"
|
||||
] }]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
bracketSameLine = false
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "stylelint-config-recommended",
|
||||
"rules": {
|
||||
"no-descending-specificity": null
|
||||
}
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
public/
|
||||
resources/
|
||||
.hugo_build.lock
|
||||
tmp
|
||||
node_modules
|
||||
hint-report
|
||||
|
|
13
Makefile
13
Makefile
|
@ -21,6 +21,17 @@ DEPLOY_GEMINI_DIST=gemini.tar.gz
|
|||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
lint-css:
|
||||
pnpm exec stylelint --config .config/stylelint.json --rd --rdd assets/main.css
|
||||
|
||||
lint-html-validate:
|
||||
pnpm exec html-validate --config .config/htmlvalidate.json $(HTML_DEST)
|
||||
|
||||
lint-html-proofer:
|
||||
htmlproofer $(HTML_DEST) --checks Links,Images,Scripts,Favicon,OpenGraph --no-allow-missing-href --no-ignore-empty-alt
|
||||
|
||||
lint: lint-css lint-html-validate lint-html-proofer
|
||||
|
||||
deploy-html:
|
||||
tar -C $(HTML_DEST) -cvz . > $(DEPLOY_HTML_DIST)
|
||||
$(HUT) pages publish --protocol HTTPS -d $(DEPLOY_DOMAIN) $(DEPLOY_HTML_DIST)
|
||||
|
@ -58,7 +69,7 @@ html:
|
|||
$(RSYNC) $(RSYNC_FLAGS) public/ --exclude '*.gmi' --exclude gemini $(HTML_DEST)
|
||||
@# Manually include gemini tag (because it was excluded above)
|
||||
$(RSYNC) $(RSYNC_FLAGS) public/tags/gemini $(HTML_DEST)/tags/
|
||||
$(PRETTIER) --write $(HTML_DEST)"/**/*.html"
|
||||
$(PRETTIER) --config .config/prettier.toml --write $(HTML_DEST)"/**/*.html"
|
||||
|
||||
finish-clean:
|
||||
rm -rf $(GEMINI_DEST)-back $(HTML_DEST)-back
|
||||
|
|
|
@ -45,6 +45,10 @@ css](https://simplecss.org) and sometimes [seirdy's site](https://seirdy.one).
|
|||
### deploy
|
||||
- **hut** - publishes HTML/gemini files to srht.site
|
||||
|
||||
### lint
|
||||
- `pnpm` - install dev dependencies in `package.json`
|
||||
- `ruby >= 2.7` - for `htmlproofer`
|
||||
|
||||
## hardcoded values
|
||||
|
||||
### resources
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"@hint/hint-doctype": "^3.3.20",
|
||||
"hint": "^7.1.0",
|
||||
"html-validate": "^8.18.1",
|
||||
"stylelint": "^14.8.1",
|
||||
"stylelint-config-recommended": "^7.0.0",
|
||||
"stylelint-config-standard": "^25.0.0"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue