Most coding languages have a lint tool or another way of enforcing coding conventions. HTML does not. In fact, the one lingering reason to use XHTML syntax seem to be that it enforces a strict syntax, that helps you to avoid errors.
Validation is not enough. Consider the following criteria, which is a set of rules that makes sense to me:
- Attributes that may take more than one word as a value must be quoted.
- Attributes that are boolean should be shortened.
- Attributes that take exactly one word or an integer as a value may be quoted.
- Tags that have optional closing tags must be manually closed.
- Void elements must not be manually closed.
Those requirements would IMHO strike a balance between readability, robustness, while allowing for the removal of redundant characters (=less page weight).
My question: Would you be interested in an HTML lint tool that could check your code for things like these?
If so, what else or what other conventions would you like to be able to enforce?