# Htmlhint
> This is the full developer documentation for HTMLHint
---
# Htmlhint Documentation
Source: https://htmlhint.com/llms-full.txt
---
This is the full developer documentation for HTMLHint
---
# HTMLHint
> The web's most popular static code analysis tool you need for your HTML
Configure the rules
You can enable or disable [any of the rules](/rules/) and have them customized to fit your needs. Check out the guide to learn how to set up HTMLHint in your project.
VS Code Extension
Download the HTMLHint extension for Visual Studio Code to get real-time feedback on your HTML code.
* [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=HTMLHint.vscode-htmlhint)
* [Open VSX Registry](https://open-vsx.org/extension/HTMLHint/vscode-htmlhint)
---
# Changelog
> The release notes for HTMLHint, see what's changed with each new version.
## 1.8.0 *(2025-11-25)*
[Section titled “1.8.0 (2025-11-25)”](#180-2025-11-25)
* Feat Add support for disabling rules via HTML comments [#1767](https://github.com/htmlhint/HTMLHint/issues/1767)
* Feat Add ‘allow-non-blocking’ option to [`head-script-disabled`](/rules/head-script-disabled/) rule [#1765](https://github.com/htmlhint/HTMLHint/issues/1765)
## 1.7.1 *(2025-09-17)*
[Section titled “1.7.1 (2025-09-17)”](#171-2025-09-17)
* Fix Update Glob dependency to version 9
## 1.7.0 *(2025-09-11)*
[Section titled “1.7.0 (2025-09-11)”](#170-2025-09-11)
* Feat New rule: [`form-method-require`](/rules/form-method-require/) [#1670](https://github.com/htmlhint/HTMLHint/issues/1721)
* Feat New rule: [`link-rel-canonical-require`](/rules/link-rel-canonical-require/) [#1671](https://github.com/htmlhint/HTMLHint/issues/1710)
## 1.6.3 *(2025-06-18)*
[Section titled “1.6.3 (2025-06-18)”](#163-2025-06-18)
* Fix Improve [`attr-value-no-duplication`](/rules/attr-value-no-duplication/) logic
## 1.6.2 *(2025-06-18)*
[Section titled “1.6.2 (2025-06-18)”](#162-2025-06-18)
* Fix Improve [`attr-value-no-duplication`](/rules/attr-value-no-duplication/) logic
## 1.6.1 *(2025-06-17)*
[Section titled “1.6.1 (2025-06-17)”](#161-2025-06-17)
* Fix Improve SARIF report formatting
* Fix Improve [`attr-value-no-duplication`](/rules/attr-value-no-duplication/) logic
## 1.6.0 *(2025-06-17)*
[Section titled “1.6.0 (2025-06-17)”](#160-2025-06-17)
* Feat New rule: [`attr-value-no-duplication`](/rules/attr-value-no-duplication/) [#1650](https://github.com/htmlhint/HTMLHint/issues/1650)
* Feat New rule: [`tag-no-obsolete`](/rules/tag-no-obsolete/) [#1660](https://github.com/htmlhint/HTMLHint/issues/1660)
* Feat Improved SARIF formatter to output help text (useful for [GitHub Code Scanning](/usage/github-code-scanning/))
## 1.5.1 *(2025-06-07)*
[Section titled “1.5.1 (2025-06-07)”](#151-2025-06-07)
* Feat Update Node SARIF Builder [#1641](https://github.com/htmlhint/HTMLHint/pull/1641)
* Fix Fix SARIF formatter to output a `htmlhint.sarif` file [#1640](https://github.com/htmlhint/HTMLHint/pull/1640)
## 1.5.0 *(2025-06-06)*
[Section titled “1.5.0 (2025-06-06)”](#150-2025-06-06)
* Feat Add `htmlhint --init` command to create a `.htmlhintrc` file [#1630](https://github.com/htmlhint/HTMLHint/pull/1630)
* Feat Add SARIF formatter [#1627](https://github.com/htmlhint/HTMLHint/issues/1627)
* Feat New rule: [`frame-title-require`](/rules/frame-title-require/) [#1629](https://github.com/htmlhint/HTMLHint/issues/1629)
* Feat New rule: [`meta-charset-require`](/rules/meta-charset-require/) [#1628](https://github.com/htmlhint/HTMLHint/issues/1628)
* Fix Improve HTML report formatting (dark mode) [#1621](https://github.com/htmlhint/HTMLHint/issues/1621)
* Fix Special character escape in HTML reports [#1626](https://github.com/htmlhint/HTMLHint/issues/1626)
## 1.4.0 *(2025-06-03)*
[Section titled “1.4.0 (2025-06-03)”](#140-2025-06-03)
* Feat New rule: [`button-type-require`](/rules/button-type-require/) [#1615](https://github.com/htmlhint/HTMLHint/issues/1615)
* Feat New rule: [`meta-description-require`](/rules/meta-description-require/) [#1613](https://github.com/htmlhint/HTMLHint/issues/1613)
* Feat New rule: [`meta-viewport-require`](/rules/meta-viewport-require/) [#1618](https://github.com/htmlhint/HTMLHint/issues/1618)
* Fix Improved HTML Report formatting [#1617](https://github.com/htmlhint/HTMLHint/issues/1617)
## 1.3.0 *(2025-05-31)*
[Section titled “1.3.0 (2025-05-31)”](#130-2025-05-31)
* Feat New rule: [`main-require`](/rules/main-require/) [#1608](https://github.com/htmlhint/HTMLHint/issues/1608)
* Feat New rule: [`h1-require`](/rules/h1-require/) [#1605](https://github.com/htmlhint/HTMLHint/issues/1605)
* Feat Sort `data-*` attributes at end [#1591](https://github.com/htmlhint/HTMLHint/issues/1591)
* Feat Add `rel` to list of sorted attributes [#1579](https://github.com/htmlhint/HTMLHint/issues/1579)
* Fix `npx htmlhint -l` doesn’t list rules alphabetically [#1598](https://github.com/htmlhint/HTMLHint/issues/1598)
* Fix `doctype-first` does not account for comments being permitted beforehand [#1610](https://github.com/htmlhint/HTMLHint/issues/1610)
## 1.2.0 *(2025-05-26)*
[Section titled “1.2.0 (2025-05-26)”](#120-2025-05-26)
* Feat Sort unknown attributes alphabetically [#668](https://github.com/htmlhint/HTMLHint/issues/668)
* Feat display warning log message when it can not parse config [#893](https://github.com/htmlhint/HTMLHint/issues/893)
* Fix Point `tag-pair` error message to correct line and column [#1503](https://github.com/htmlhint/HTMLHint/issues/1503)
* Fix Remove ampersand from `spec-char-escape` [#1504](https://github.com/htmlhint/HTMLHint/issues/1504)
* Fix Typo in `idclassaddisabled` default export name [#728](https://github.com/htmlhint/HTMLHint/issues/728)
* Docs Switch website to use Astro Starlight
## 1.1.4 *(2022-04-11)*
[Section titled “1.1.4 (2022-04-11)”](#114-2022-04-11)
* Fix duplicate text [#981](https://github.com/htmlhint/HTMLHint/issues/981)
## 1.1.3 *(2022-03-28)*
[Section titled “1.1.3 (2022-03-28)”](#113-2022-03-28)
* Feat Replace parse-glob [#927](https://github.com/htmlhint/HTMLHint/issues/927)
## 1.1.2 *(2022-01-27)*
[Section titled “1.1.2 (2022-01-27)”](#112-2022-01-27)
* Fix Ignore hidden input without label, closes [#866](https://github.com/htmlhint/HTMLHint/issues/866)
## 1.1.1 *(2022-01-23)*
[Section titled “1.1.1 (2022-01-23)”](#111-2022-01-23)
* Fix Correct links to rule docs, closes [#867](https://github.com/htmlhint/HTMLHint/issues/867)
## 1.1.0 *(2021-12-31)*
[Section titled “1.1.0 (2021-12-31)”](#110-2021-12-31)
* Fix **attr-lowercase:** ignore camelCase SVG attributes
## 1.0.0 *(2021-11-26)*
[Section titled “1.0.0 (2021-11-26)”](#100-2021-11-26)
* Feat Set minimum support to es6
* Feat Upgrade to TypeScript 4
* Feat IE11 and older browsers are no longer supported
## 0.16.3 *(2021-11-24)*
[Section titled “0.16.3 (2021-11-24)”](#0163-2021-11-24)
* Revert “chore(deps-dev): upgrade strip-json-comments ([#763](https://github.com/htmlhint/HTMLHint/pull/763))” ([#767](https://github.com/htmlhint/HTMLHint/pull/767))
## 0.16.2 *(2021-11-23)*
[Section titled “0.16.2 (2021-11-23)”](#0162-2021-11-23)
* cleanup non-functional typos [#727](https://github.com/htmlhint/HTMLHint/issues/727)
## 0.16.1 *(2021-11-12)*
[Section titled “0.16.1 (2021-11-12)”](#0161-2021-11-12)
* tagname-specialchars description [#714](https://github.com/htmlhint/HTMLHint/issues/714)
## 0.16.0 *(2021-10-29)*
[Section titled “0.16.0 (2021-10-29)”](#0160-2021-10-29)
* **rules:** add `empty-tag-not-self-closed` rule [#696](https://github.com/htmlhint/HTMLHint/issues/696), closes [#311](https://github.com/htmlhint/HTMLHint/issues/311)
## 0.15.2 *(2021-09-16)*
[Section titled “0.15.2 (2021-09-16)”](#0152-2021-09-16)
* **htmlhint.ts:** replace deprecated request module with what-wg fetch [#670](https://github.com/htmlhint/HTMLHint/issues/670)
## 0.15.1 *(2021-06-11)*
[Section titled “0.15.1 (2021-06-11)”](#0151-2021-06-11)
* Unexpected behavior of the HTML lang require rule [#655](https://github.com/htmlhint/HTMLHint/issues/655)
## 0.15.0 *(2021-06-10)*
[Section titled “0.15.0 (2021-06-10)”](#0150-2021-06-10)
* **rules:** add `html-lang-require` rule [#632](https://github.com/htmlhint/HTMLHint/issues/632)
## 0.14.2 *(2020-11-11)*
[Section titled “0.14.2 (2020-11-11)”](#0142-2020-11-11)
* Link to configuration.md from options page [#563](https://github.com/htmlhint/HTMLHint/issues/563)
## 0.14.1 *(2020-06-25)*
[Section titled “0.14.1 (2020-06-25)”](#0141-2020-06-25)
* windows path separator [#443](https://github.com/htmlhint/HTMLHint/issues/443)
## 0.14.0 *(2020-05-31)*
[Section titled “0.14.0 (2020-05-31)”](#0140-2020-05-31)
* use chalk instead of colors [#433](https://github.com/htmlhint/HTMLHint/issues/433)
## 0.13.1 *(2020-05-31)*
[Section titled “0.13.1 (2020-05-31)”](#0131-2020-05-31)
* add missing branches to action release [#425](https://github.com/htmlhint/HTMLHint/issues/425)
* add missing plugins for docusaurus [#402](https://github.com/htmlhint/HTMLHint/issues/402)
* correctly call hint queue drain [#409](https://github.com/htmlhint/HTMLHint/issues/409)
* duplicate ga [#407](https://github.com/htmlhint/HTMLHint/issues/407)
* ESLint fix
* fix url repo pkg [#413](https://github.com/htmlhint/HTMLHint/issues/413)
* GitHub token
* remove unused dependency esm [#430](https://github.com/htmlhint/HTMLHint/issues/430)
* **attr-no-unnecessary-whitespace:** fix when equals symbol in value [#405](https://github.com/htmlhint/HTMLHint/issues/405)
## 0.13.1-beta.2 *(2020-05-31)*
[Section titled “0.13.1-beta.2 (2020-05-31)”](#0131-beta2-2020-05-31)
* remove unused dependency esm [#430](https://github.com/htmlhint/HTMLHint/issues/430)
## 0.13.1-beta.1 *(2020-05-30)*
[Section titled “0.13.1-beta.1 (2020-05-30)”](#0131-beta1-2020-05-30)
* add missing branches to action release [#425](https://github.com/htmlhint/HTMLHint/issues/425)
* add missing plugins for docusaurus [#402](https://github.com/htmlhint/HTMLHint/issues/402)
* correctly call hint queue drain [#409](https://github.com/htmlhint/HTMLHint/issues/409)
* duplicate ga [#407](https://github.com/htmlhint/HTMLHint/issues/407)
* eslint fix
* fix url repo pkg [#413](https://github.com/htmlhint/HTMLHint/issues/413)
* **attr-no-unnecessary-whitespace:** fix when equals symbol in value [#405](https://github.com/htmlhint/HTMLHint/issues/405)
* GitHub token
## 0.13.0 *(2020-05-18)*
[Section titled “0.13.0 (2020-05-18)”](#0130-2020-05-18)
* add prettier and eslint [#388](https://github.com/htmlhint/HTMLHint/issues/388)
* add semantic release test [#399](https://github.com/htmlhint/HTMLHint/issues/399)
* ignore `PULL_REQUEST_TEMPLATE.md`
* use yml in semantic.yml
* Add tags checking rule - allows specify rules for any tag and validate that [#384](https://github.com/htmlhint/HTMLHint/issues/384)
* added attr-no-unnecessary-whitespace rule [#385](https://github.com/htmlhint/HTMLHint/issues/385)
* new rule: input-requires-label - All inputs require a label [#159](https://github.com/htmlhint/HTMLHint/issues/159)
* new website for htmlhint.com [#395](https://github.com/htmlhint/HTMLHint/issues/395)
## 0.9.14 *(2016-5-2)*
[Section titled “0.9.14 (2016-5-2)”](#0914-2016-5-2)
add:
1. cli: support hint for url
2. attr-lowercase: add test case
## 0.9.13 *(2016-5-1)*
[Section titled “0.9.13 (2016-5-1)”](#0913-2016-5-1)
add:
1. change cli parameter: `--plugin` to `--rulesdir`
2. add formatter directory support
3. add formatters: compact, markdown
4. add cli parameter:`--nocolor`, disable color in cli
5. space-tab-mixed-disabled plugin: add space length require
6. add empty elements: track,command,source,keygen,wbr
7. add hint stdin for cli
fix:
1. report error evidence if tag attrs include `\r\n`
2. space-tab-mixed-disabled issue [#119](https://github.com/htmlhint/HTMLHint/issues/119)
3. attr name support all w3c defined characters
improve:
1. Parse inline ruleset after default ruleset
## 0.9.10 *(2015-10-12)*
[Section titled “0.9.10 (2015-10-12)”](#0910-2015-10-12)
add:
1. attr-unsafe-chars(rule): show unsafe code in message
2. support glob pattern for cli
3. support format as custom: json, junit, checkstyle
4. support plugin: `htmlhint --plugin ./plugins/`
5. add rule: inline-style-disabled
6. add rule: inline-script-disabled
fix:
1. title-require(rule): report error when `
test`
2. title-require(rule): report error when ``
## 0.9.9 *(2015-10-9)*
[Section titled “0.9.9 (2015-10-9)”](#099-2015-10-9)
add:
1. add config loaded message to cli log
2. support async for cli
fix:
1. close issue: [#79](https://github.com/htmlhint/HTMLHint/issues/79), fix exit with 0 when hint errors
2. fix end event col
3. attr-unsafe-chars(rule): exclude `\r\n`
## 0.9.8 *(2015-10-7)*
[Section titled “0.9.8 (2015-10-7)”](#098-2015-10-7)
add:
1. Search `.htmlhintrc` in parent directory
2. Allow comments in json
3. Support hint any file without `.html` or `.htm` extension, just like: `htmlhint test.xhtml`
4. Support json raw format in cli
5. tag-pair(rule): Show the line of the start tag
6. space-tab-mixed-disabled(rule): Support space and tab mode, for check only space or tab
7. Make cli logs more clear to people
8. add rule: title-require, `` must be present in `` tag.
fix:
1. Fix issue: #77 ``
2. Made the descriptions and error messages of rules more clear to people
3. head-script-disabled(rule): No head not result error
## 0.9.7 *(2015-3-8)*
[Section titled “0.9.7 (2015-3-8)”](#097-2015-3-8)
fix:
1. fix ‘No such file’ issue on mac
2. head-script-disabled: not match template script
## 0.9.6 *(2014-6-18)*
[Section titled “0.9.6 (2014-6-18)”](#096-2014-6-18)
add:
1. add rule: attr-no-duplication
2. add rule: space-tab-mixed-disabled
3. add rule: id-class-ad-disabled
4. add rule: href-abs-or-rel
5. add rule: attr-unsafe-chars
6. add default rule: attr-no-duplication
7. add inline ruleset support
8. add test spec: Set false to rule
9. add point: load default ruleset when use empty ruleset
## 0.9.4 *(2013-9-27)*
[Section titled “0.9.4 (2013-9-27)”](#094-2013-9-27)
1. add rule: src-not-empty
fix:
1. fix attr-value-double-quotes rule: `` should result error
## 0.9.3 *(2013-5-24)*
[Section titled “0.9.3 (2013-5-24)”](#093-2013-5-24)
add:
1. add ruleid to csslint message
fix:
1. fix csslint rule: del undefined of raw
2. fix parser for: `
```
---
# id-unique
> Ensures all id attributes in an HTML document are unique to prevent conflicts and unexpected behavior.
ID attributes must be unique in the document.
Level: Error
## Config value
[Section titled “Config value”](#config-value)
* `true`: enable rule
* `false`: disable rule
### The following patterns are **not** considered rule violations
[Section titled “The following patterns are not considered rule violations”](#the-following-patterns-are-not-considered-rule-violations)
```html
```
### The following pattern is considered a rule violation:
[Section titled “The following pattern is considered a rule violation:”](#the-following-pattern-is-considered-a-rule-violation)
```html
```
### Why this rule is important
[Section titled “Why this rule is important”](#why-this-rule-is-important)
Duplicate ID attributes can cause unexpected behavior and make the code harder to read and maintain.
Further reading: [Axe Rules - duplicate-id](https://dequeuniversity.com/rules/axe/4.1/duplicate-id)
---
# inline-script-disabled
> Disallows the use of inline JavaScript in HTML elements for improved security and maintainability.
Inline script cannot be used.
Level: Warning
## Config value
[Section titled “Config value”](#config-value)
* `true`: enable rule
* `false`: disable rule
### The following patterns are considered violations
[Section titled “The following patterns are considered violations”](#the-following-patterns-are-considered-violations)
```html
test1
```
---
# inline-style-disabled
> Disallows the use of inline style attributes to promote separation of content and presentation.
Inline style cannot be used.
Level: Warning
## Config value
[Section titled “Config value”](#config-value)
* `true`: enable rule
* `false`: disable rule
### The following pattern is considered a rule violation:
[Section titled “The following pattern is considered a rule violation:”](#the-following-pattern-is-considered-a-rule-violation)
```html
```
## Why this rule is important
[Section titled “Why this rule is important”](#why-this-rule-is-important)
Inline styles can make the code harder to read and maintain. They also make it harder to override styles with CSS.
---
# input-requires-label
> Requires every element to have an associated