Suppressing JSHint mixed spaces and tabs warning

March 24, 2016, 7:01 pm
Author: James Griffiths

If you've been using JSHint for an extended period of time you may have encountered warnings being printed to the console akin to the following:

scripts.js: line 23, col 1, Mixed spaces and tabs.
scripts.js: line 44, col 1, Mixed spaces and tabs.

This warning occurs as JSHint will not allow spaces and tabs to be used together.

Switching this off is quite easy...

In your .jshintrc file (which you should be using - if you follow best practice recommendations for working with JSHint) add the following configuration rule:

"-W099" : true

Which will stop warnings about mixed spaces and tabs being printed to the console.

A full list of error and warning codes that can be used in your .jshintrc file are available here.


« Return to Posts

Post a comment

All comments are welcome and the rules are simple - be nice and do NOT engage in trolling, spamming, abusiveness or illegal behaviour. If you fail to observe these rules you will be permanently banned from being able to comment.