Skip to content
⚙️ The static code analysis tool you need for your HTML
JavaScript HTML
Branch: develop
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml (#350) Feb 1, 2020
bin html.js (#304) Feb 1, 2020
dist feat(htmlhint): added attribute sorting (#309) (#332) Feb 1, 2020
src feat(htmlhint): add RegExp and regex string (#346) Feb 1, 2020
test feat(htmlhint): add RegExp and regex string (#346) Feb 1, 2020
.editorconfig style(htmlhint): change from 4 spacing to 2 spacing Sep 3, 2018
.gitignore Migrate to Webpack & ES6 modules (#325) Feb 23, 2019
.jshintrc-browser fix(htmlhint): version up and jshint line break Sep 4, 2018
.jshintrc-node style(htmlhint): formatted test files (#276) Sep 3, 2018
.npmignore Add WHOUSE.md May 1, 2016
.nvmrc [#256] Add sematic-release to package.json Aug 23, 2018
.prettierignore chore(htmlhint) feature/add commitizen package, husky and prettier (#287 Sep 3, 2018
.prettierrc.json style(htmlhint): change from 4 spacing to 2 spacing Sep 3, 2018
.travis.yml fix: missing test cases (#327) Feb 1, 2020
CHANGELOG.md chore(htmlhint) feature/add commitizen package, husky and prettier (#287 Sep 3, 2018
CODE_OF_CONDUCT.md refactor(htmlhint): merge branch 'develop' Sep 4, 2018
CONTRIBUTING.md Create CONTRIBUTING.md Aug 22, 2018
LICENSE.md style(htmlhint): fix typo on Yanis name (#293) Sep 3, 2018
README.md update links back to htmlhint.com (#359) Feb 1, 2020
codecov.yml Add codecov.yml file and add badge Aug 23, 2018
commitizen.config.js chore(htmlhint) feature/add commitizen package, husky and prettier (#287 Sep 3, 2018
commitlint.config.js chore(htmlhint) feature/add commitizen package, husky and prettier (#287 Sep 3, 2018
package-lock.json chore: update commitizen and semantic release (#357) Feb 1, 2020
package.json chore: update commitizen and semantic release (#357) Feb 1, 2020
parser-preset.js chore(htmlhint) feature/add commitizen package, husky and prettier (#287 Sep 3, 2018
webpack.config.js feat(htmlhint): add new rule for whitespace in attributes (#310) (#322) Feb 1, 2020

README.md


Logo HTMLHint
HTMLHint

The static code analysis tool you need for your HTML.

Travis Build Status Codecov NPM count MIT Licence Chat Chat

  How To UseContributingRoadmapWebsite

Table of Contents

📟 Installation and Usage

Prerequisites: Node.js (>=6.14), npm version 3+.

There are two ways to install HTMLHint: globally and locally.

Local Installation and Usage

In case you want to include HTMLHint as part of your project, you can install it locally using NPM:

$ npm install htmlhint --save-dev

After that, You can run HTMLHint on any file or directory like this:

$ ./node_modules/.bin/htmlhint www/index.html
$ ./node_modules/.bin/htmlhint www/**/*.html

Global Installation and Usage

If you want to make HTMLHint available to tools that run across all of your projects, you can install HTMLHint globally using NPM:

$ npm install htmlhint -g

After that, you can run HTMLHint on any file like this:

$ htmlhint www/index.html
$ htmlhint www/**/*.html

You can even launch HTMLHint to analyse an URL:

$ htmlhint https://htmlhint.com/

📃 Example output

🔧 Configuration

Search .htmlhintrc file in current directory and all parent directories:

$ htmlhint
$ htmlhint test.html

Custom config file:

$ htmlhint --config htmlhint.conf test.html

Custom rules:

$ htmlhint --rules tag-pair,id-class-value=underline index.html

Inline rules in test.html:

<!--htmlhint tag-pair,id-class-value:underline -->
<html>
<head>
...

📙 Docs

  1. How to use
  2. All Rules
  3. How to Develop

© License

MIT License

💪🏻 Contributors

This project exists thanks to all these people. Contribute.

🏅 Backers

Thank you to all our backers! Become a backer.

🎖 Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.

You can’t perform that action at this time.