JSHint

JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team’s coding conventions.

It is very flexible so you can easily adjust it to your particular coding guidelines and the environment you expect your code to execute in.

JSHint is a fork of JSLint, the tool written and maintained by Douglas Crockford.

The project originally started as an effort to make a more configurable version of JSLint—the one that doesn’t enforce one particular coding style on its users—but then transformed into a separate static analysis tool with its own goals and ideals.

The goal is to help JavaScript developers write complex programs without worrying about typos and language gotchas.

Sstatic code analysis programs—as well as other code quality tools—are important and beneficial to the JavaScript community and, thus, should not alienate their users (see why Anton Kovalyov forked JSLint to JSHint).

Why static code analysis tool?

Any code base eventually becomes huge at some point, and simple mistakes—that would not show themselves when written—can become show stoppers and waste hours of debugging. And this is when static code analysis tools come into play and help developers to spot such problems. JSHint scans a program written in JavaScript and reports about commonly made mistakes and potential bugs. The potential problem could be a syntax error, a bug due to implicit type conversion, a leaking variable or something else.

JSHint uses a Pratt parser implementation written by Douglas Crockford to scan your program.

Please note, that while static code analysis tools can spot many different kind of mistakes, it can’t detect if your program is correct, fast or has memory leaks. You should always combine tools like JSHint with unit and functional tests as well as with code reviews.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s