JSHint and JSLint are awesome tools.
However, the "mixed spaces and tabs" warning dominates the report. Is there a way to suppress these warnings, or is there a similar service that allows white space warnings to get suppressed?
JSHint and JSLint are awesome tools.
However, the "mixed spaces and tabs" warning dominates the report. Is there a way to suppress these warnings, or is there a similar service that allows white space warnings to get suppressed?
It's not possible to switch off this warning with a flag, and the JSHint maintainer doesn't want to add a flag for this.
However, it is possible to turn off warnings according to their number. In this case, you'd write:
/* jshint -W099 */
If you're using a JSHint configuration file, you can specify this there too:
{
"-W099": true, // allowed mixed tabs and spaces
}
Alternatively, there's a custom reporter available to switch off this warning.
/*jshint smarttabs:true */
See smarttabs
, under "Relaxing Options." http://www.jshint.com/docs/options/
This option suppresses warnings about mixed tabs and spaces when the latter are used for alignmnent only. The technique is called SmartTabs.
Answer for 2014: upgrade jshint As @RobW mentioned earlier, jshint no longer complains about mixed spaces and tabs. I have tested this by upgrading to jshint@2.5.10 and re-linting my document, which no longer complains (I consistently indent using tabs, but commenting out lines in SublimeText triggered this warning).
sudo npm update -g jshint