Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress "mixed spaces and tabs" warning in JSHint / JSLint or alternative service?

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?

like image 679
Crashalot Avatar asked Apr 23 '12 18:04

Crashalot


2 Answers

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.

like image 96
Wilfred Hughes Avatar answered Oct 09 '22 20:10

Wilfred Hughes


/*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.

like image 26
Matt Ball Avatar answered Oct 09 '22 21:10

Matt Ball