Created
          October 13, 2012 18:12 
        
      - 
      
- 
        Save valueof/3885619 to your computer and use it in GitHub Desktop. 
    A reporter that discards all warnings about mixed tabs and errors
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * notabs.js | |
| * | |
| * A reporter that discards all warnings about mixed tabs and errors. | |
| * This file was based on our default reporter so output is the same. | |
| * | |
| * Usage: | |
| * jshint myfile.js --reporter=notabs.js | |
| */ | |
| module.exports = { | |
| reporter: function (results) { | |
| var len = results.length; | |
| var str = ""; | |
| results.forEach(function (result) { | |
| var file = result.file; | |
| var error = result.error; | |
| if (error.reason === "Mixed spaces and tabs.") { | |
| return; | |
| } | |
| str += file + ': line ' + error.line + ', col ' + | |
| error.character + ', ' + error.reason + '\n'; | |
| }); | |
| if (str) { | |
| process.stdout.write(str + "\n" + len + ' error' + ((len === 1) ? '' : 's') + "\n"); | |
| } | |
| } | |
| }; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Since it wasn't clear to me, @jlgrall's suggested options can be dropped into your
~/.jshintrcconfig file or (I think) SublimeLinter'sjshint_optionsconfig block.