Skip to content

Instantly share code, notes, and snippets.

@ricealexander
Created September 11, 2020 16:24
Show Gist options
  • Save ricealexander/8acf1e7d451dc96e66890083d3e0d5cb to your computer and use it in GitHub Desktop.
Save ricealexander/8acf1e7d451dc96e66890083d3e0d5cb to your computer and use it in GitHub Desktop.
HTMLHint Configuration
{
// Enabled Rules
"doctype-first": true, // require doctype declaration at the very top of the HTML document
"doctype-html5": true, // require doctype to be HTML5’s <!DOCTYPE html>
"style-disabled": true, // prefer definining styles in external stylesheets
"title-require": true, // require <title> element in the <head>
"attr-lowercase": true, // disallow capital letters in attribute names
"attr-no-duplication": true, // disallow duplicate attributes on an element
"attr-no-unnecessary-whitespace": true, // disallow whitespace around attribute assignment operator =
"attr-value-double-quotes": true, // disallow single-quotes around attribute values
"alt-require": true, // require alt attributes on image tags: img input[type=image] area[href]
"tag-pair": true, // require closing-tags for non-void elements
"tagname-lowercase": true, // disallow capital letters in tag names
"empty-tag-not-self-closed": true, // ⭐ disallow self-closed void tags
"src-not-empty": true, // require source attribute: img[src] script[src] embed[src] bgsound[src] iframe[src] link[href] object[data]
"id-class-ad-disabled": true, // disallow phrases in classes and IDs which may be flagged by ad-blockers
"id-unique": true, // disallow non-unique IDs
"inline-script-disabled": true, // disallow inline scripts
"inline-style-disabled": true, // prefer definining styles in external stylesheets
"space-tab-mixed-disabled": "space2", // disallow tabs; require indentation length to be %2
// Disabled Rules
// (💥 rule enforces a bad practice)
"attr-value-not-empty": false, // 💥 boolean attributes do not need values
"head-script-disabled": false, // 💥 <head> is the correct place for external scripts
"tag-self-close": false, // 💥 void tags do not need to be self-closed in HTML5
"attr-unsafe-chars": false, // insufficient documentation
"href-abs-or-rel": false, // not a practical convention in this project
"id-class-value": false, // disallows common CSS naming-conventions such as BEM
"spec-char-escape": false, // special characters are not a source of errors nowadays and escaping them makes markup less-readable
"tags-check": false // insufficient documentation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment