|
|
|
|
|
by gotofritz
4439 days ago
|
|
Linting is not THE answer, but it's surely a useful tool that catches a lot of potential mistakes, and has the nice side effect of enforcing some sort of house rules. The problem is with the linters themselves. JSLint is coded by Crockford, probably the most opinionated sw engineer on earth. It checks what he thinks is right, and mixes formatting checks with syntax checks. JSHint is a small improvement, it allows you to switch off rules that Crockford doesn't even want to talk about, but apart from that it's not a great step forward. Plus, for no good reason at all they decided to rename some of the rules from JSLint, and switch some of the flags, so that sometimes "true" means enforce something, something it means refuse it. It's rather confusing. Neither allow you to add your own rules easily. The new kid on the block is ESLint. It has a pluggable architecture, different warning levels, and make no assumptions whatsoever. With its open architecture and access to the syntax tree it should be possible to create a plugin to check just about anything you care about. It is just coming out of alpha, their first step is to duplicate JSHint's functionality and then move forward from there. It looks very promising. |
|