DEV Community

Discussion on: Why is HTML linting not a common practice?

Collapse
 
ben profile image
Ben Halpern

I think by the time linting became a thing, HTML sort of started being treated more like a build target than code itself. I may be offbase, but I feel like templating languages like erb, ejs, etc. plus pseudo-html now with React.

I just feel like cleanliness of HTML is not really "a thing".

This is me riffing, not really sure.

Collapse
 
dandevri profile image
Danny de Vries

I just feel like cleanliness of HTML is not really "a thing".

Isn't that a shame? Or shouldn't we care more about this? Writing semantic and clean HTML is really important for screen readers.

Collapse
 
ben profile image
Ben Halpern

Yeah I agree. At least about the semantic part. It doesn't necessarily have to be human readable if it's more of a build target, but yeah it should definitely be semantic. And in this case, it seems like it should especially be linted. It's no longer about the developer experience here, it's the user experience.

In this way, linters are not like spell check because they're not going to necessarily affect the way the end user "reads" things, but for HTML it would be like a true spell check.

I'm sold.