By default, htmlhint looks for a .htmlhintrc file in the current directory and all parent directories, and applies its rules when parsing a file:

$ htmlhint index.html

To provide a custom configuration file to the command, use the --config option:

$ htmlhint --config htmlhint.conf index.html

Custom rules can also be specified individually, via the --rules option:

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

Finally, rules can be specified inline directly in the HTML document:

<!-- htmlhint tag-pair,id-class-value:underline -->
Last updated on by Waldir Pimenta