We're using JSHint in a Visual Studio 2013 solution. When building, we are seeing some formatting warnings for items that break style warnings, but are functionally valid. Specifically, I would like to suppress the "Illegal Space" warnings. I consider warnings like this in the build error list visual chaff:
- JSCS: Illegal space before opening curly brace
- JSCS: Illegal space before opening round brace
Here's why. I'm a fan of using the Visual Studio auto-formatting feature (Ctrl+K+D). In a scenario where a function is defined as follows...
$select.find('option').each(function(){
... the auto formatting feature will change it to this:
$select.find('option').each(function () {
JSHint is valuable for finding other problems, like missing semicolons, so I'd prefer to continue using it in this project. There is a settings file via Web Essentials > Edit Global JSHint Settings. But it's unclear to me what setting in that file I need to adjust to suppress those Illegal Space warnings.
=== Update 4/6/2015 ===
Based on the recommendation from Mike C below, the fix I applied is as follows:
- Select Web Essentials > Edit global JSCS Settings.
- Search for these strings in the .jscsrc file, and set their related properties to false: "RoundBrace", "CurlyBrace".
- Close and reopen Visual Studio 2013 with your solution.
- Rebuild and those warnings will disappear.