25

How might I disable JSCS in the latest version of Web Essentials for Visual Studio 2013?

I was unable to find a relevant option in the menu.

I tried setting the JSCS configuration to ignore all files. This caused it to occasionally generate messages that wouldn't leave my Error List panel until I cleaned the solution.

Keen
  • 954
  • 12
  • 19

3 Answers3

15

I've found this settings file seems to quiet it down quite a bit. You can find this in Web Essentials > Edit Global JSCS settings.

{
    "requireCurlyBraces": ["if"],

    "excludeFiles": ["**"],
    "validateJSDoc": {
        "checkParamNames": true,
        "requireParamTypes": true
    }
}

It essentially disables JSCS while keeping JSHint open. Hopefully that helps.

Bryan Rayner
  • 4,172
  • 4
  • 26
  • 38
  • Thanks! I'd been trying to use a single `*`, as in `"excludeFiles": ["*"]`. Just adding the second asterisk solves my primary JSCS headache. – Keen Jun 13 '14 at 17:19
  • 1
    It seems as if correctly setting `excludeFiles` is sufficient. Should this be the case? – Keen Jun 13 '14 at 17:26
  • 2
    You know what, it is sufficient. I found the best solution (which didn't involve killing all the options) from a coworker after I posted here. At least in my project, "\*\*" wasn't cutting it. We had to go "Scripts/\*\*" or something along those lines. I'll update the post when I get back to the office and see what we actually had. – Bryan Rayner Jun 15 '14 at 04:32
  • 1
    I found that `"excludeFiles": ["/**"],'` disabled the checking for all files. Note the leading forward slash. It seems that this path is being interpreted as a full path rather than a relative path. I was able to target specific folders as well but you have to specify it assuming a full path e.g. `"/**/Scripts/*.js"`. I suspect you could research node file globbing documentation to really understand the options. – Martin Hollingsworth Jun 23 '14 at 01:57
  • I was encountering the same problem and used Bryan and Martin's comment solution to make it work. Change it to "excludeFiles": ["/**"] which stops it from hitting any of the JS files. – Clayton Sep 19 '14 at 15:52
  • 1
    I've added ""excludeFiles": ["/**"]" and still get JSCS messages. Any ideas? VS 2013 Update 4. – FOO Nov 23 '14 at 21:47
12

Web Essentials 2013 for Update 4 supports a .weignore file where you can disable JSCS, or other linters and compilers, independently of each other.

See https://github.com/madskristensen/WebEssentials2013/pull/1250

Create a .weignore file and add the following line:

**\*.js jscs

That's a tab character between the *.js and the jscs parts of the line.

You can create a global .weignore file in your user folder (C:\Users\username), or in your project or solution folder.

Bryan Knox
  • 645
  • 7
  • 12
1

Create a file .jscsrc in your project-root (e.g. via the command line: echo x > .jscsrc). Then use the following content:

{
    "excludeFiles": ["**"]
}

I just like to keep all the project-settings together and avoid global settings that need to be synchronized between developers manually.

Andreas
  • 1,997
  • 21
  • 35