Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show all of the errors with JSHint

Tags:

jshint

Say I run JSHint on a file. It reports back 83% of the errors. I want 100% of the errors, but by default it says "Too many errors". Running jshint filename.js, how would I lift this limit and show all of the errors?

like image 679
tester Avatar asked Jul 13 '12 17:07

tester


People also ask

How do I ignore JSHint warning?

In October 2013 jshint added a way to ignore blocks of code like this: // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be ignored by JSHint. /* jshint ignore:end */ // Code here will be linted with JSHint.

What is Jshintrc file?

JSHint is a program that flags suspicious usage in programs written in JavaScript. The core project consists of a library itself as well as a CLI program distributed as a Node module.


2 Answers

see this issue : https://github.com/jshint/jshint/issues/180

from there :

/*jshint maxerr: 10000 */

like image 182
h4ck3rm1k3 Avatar answered Nov 26 '22 10:11

h4ck3rm1k3


By default, JSHint will produce 50 warnings before giving up. Unfortunately, there is not an option to turn that off completely. The reason is because on large scripts JSHint would be too slow.

If you want to increase the amount of warnings that JSHint will produce, just edit file .jshintrc and add the option:

{     "maxerr" : 999 } 
like image 35
Hemerson Varela Avatar answered Nov 26 '22 09:11

Hemerson Varela