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

天涯浪子 提交于 2019-12-05 11:59:31

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/22363026/how-can-i-disable-jscs-in-web-essentials-for-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!