How can I disable JSCS in Web Essentials for Visual Studio 2013?
Asked Answered
S

3

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.

Saccule answered 12/3, 2014 at 20:26 Comment(0)
L
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.

Leek answered 8/1, 2015 at 23:35 Comment(1)
I tried this, but it did not work for me (restarting VS did not help either).Holocene
B
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.

Borden answered 13/6, 2014 at 14:59 Comment(6)
Thanks! I'd been trying to use a single *, as in "excludeFiles": ["*"]. Just adding the second asterisk solves my primary JSCS headache.Saccule
It seems as if correctly setting excludeFiles is sufficient. Should this be the case?Saccule
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.Borden
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.Wengert
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.South
I've added ""excludeFiles": ["/**"]" and still get JSCS messages. Any ideas? VS 2013 Update 4.Interfluent
L
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.

Leek answered 8/1, 2015 at 23:35 Comment(1)
I tried this, but it did not work for me (restarting VS did not help either).Holocene
H
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.

Holocene answered 16/4, 2015 at 15:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.