Linters
What is JSHint? An introduction to the community-driven JavaScript code analysis tool
JSHint is a community-driven static code analysis tool that detects errors and potential problems in JavaScript code. It scans JavaScript programs and reports commonly made mistakes and potential bugs. The project aims to help developers write complex programs without worrying about typos and language gotchas.
- Tool
- JSHint
- Made by
- JSHint
- Official site
- jshint.com
- Category
- Linters
Who makes JSHint
JSHint is a community-driven project. It originated from the JSLint project in 2010, and it is licensed under the MIT Expat license.
The project states that JSHint will always remain publicly available. The official website is linked below.
Official website: jshint.com
What JSHint is for
JSHint is for finding errors and potential problems in JavaScript code. It scans programs and reports commonly made mistakes and potential bugs.
Reported problems can include syntax errors, implicit type conversion bugs and leaking variables. It also checks for issues such as cyclomatic complexity, unused variables and undefined variables.
It has limits. JSHint cannot verify correctness, speed or memory leaks, so it should be combined with tests and code review.
Who JSHint is for
JSHint is for JavaScript developers. The project aims to help them write complex programs without worrying about typos and language gotchas.
Its flexibility suits developers whose code runs in different places, since it can be adjusted to the environment where the code will run.
Notable capabilities
JSHint is a focused linter for one language. Its capabilities cover the kinds of problems it reports and the environments it can be configured for.
The list below comes from the project's own description.
- Error detection: it detects errors and potential problems in JavaScript code.
- Common mistakes: it reports commonly made mistakes and potential bugs, including syntax errors, implicit type conversion bugs and leaking variables.
- Code checks: it checks for issues such as cyclomatic complexity, unused variables and undefined variables.
- Environment options: it has options for environments including browser, Node.js, jQuery, ES6, Mozilla extensions and ES3.
- Adjustable behavior: it is flexible and can be adjusted to the environment where the code will run.
- Community-driven development: it is a community-driven tool that will always remain publicly available.
How JSHint fits linters
JSHint is a linter in the traditional sense. It reads JavaScript source and flags likely errors and suspicious constructs. It is not a substitute for testing, because it cannot verify correctness, speed or memory leaks.
For readers of Linthelm, which covers linters, static analysis and code quality tools, JSHint is a clear example of a single-language linter. It catches problems cheaply while code is being written, and tests and code review handle what static checks cannot.
Frequently asked questions
What is JSHint used for?
JSHint is used to detect errors and potential problems in JavaScript code. It reports commonly made mistakes and potential bugs, such as syntax errors, implicit type conversion bugs and leaking variables.
Who develops JSHint?
JSHint is a community-driven project. It originated from the JSLint project in 2010.
What license does JSHint use?
JSHint is licensed under the MIT Expat license.
Does JSHint support Node.js and ES6?
Yes. It has options for environments including browser, Node.js, jQuery, ES6, Mozilla extensions and ES3.
Can JSHint verify that my code is correct?
No. JSHint cannot verify correctness, speed or memory leaks, so it should be combined with tests and code review.
Linthelm is independent and is not affiliated with JSHint. Product names belong to their owners. Features change; confirm details on the official website.