-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htmlvalidate.js
27 lines (20 loc) · 985 Bytes
/
.htmlvalidate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { defineConfig } = require("html-validate");
module.exports = defineConfig({
extends: ["html-validate:recommended"],
rules: {
/* Define <!DOCTYPE html> to lowercase because Hugo minify does it */
"doctype-style": ["error", {"style": "lowercase"}],
/* Allow images to not have alt="" attribute */
"wcag/h37": ["off"],
/* Disable because markdown does not generate tables with scope attribut */
"wcag/h63": ["off"],
/* Only validates the ID is non-empty and contains no whitespace */
"valid-id": ["error", {"relaxed": true}],
/* Increase max <title> size */
"long-title": ["error", {"maxlength": 120}],
/* Validates BEM class names, based on https://github.com/potherca-blog/BEM-Regex */
"class-pattern": ["error", {"pattern": "^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$"}],
/* Allow the use of unescaped special characters */
"no-raw-characters": ["error", {"relaxed": true}],
}
});