简体   繁体   English

如何在Visual Studio 2013的Web Essentials中禁用JSCS?

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

How might I disable JSCS in the latest version of Web Essentials for Visual Studio 2013? 如何在最新版本的Visual Studio 2013 Web Essentials中禁用JSCS?

I was unable to find a relevant option in the menu. 我无法在菜单中找到相关选项。

I tried setting the JSCS configuration to ignore all files. 我尝试将JSCS配置设置为忽略所有文件。 This caused it to occasionally generate messages that wouldn't leave my Error List panel until I cleaned the solution. 这导致它偶尔生成的消息在我清除解决方案之前不会离开我的错误列表面板。

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. 您可以在Web Essentials>编辑全局JSCS设置中找到它。

{
    "requireCurlyBraces": ["if"],

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

It essentially disables JSCS while keeping JSHint open. 它实际上禁用了JSCS,同时保持JSHint打开。 Hopefully that helps. 希望这会有所帮助。

Web Essentials 2013 for Update 4 supports a .weignore file where you can disable JSCS, or other linters and compilers, independently of each other. Web Essentials 2013 for Update 4支持.weignore文件,您可以在其中相互独立地禁用JSCS或其他链接和编译器。

See https://github.com/madskristensen/WebEssentials2013/pull/1250 请参阅https://github.com/madskristensen/WebEssentials2013/pull/1250

Create a .weignore file and add the following line: 创建.weignore文件并添加以下行:

**\*.js jscs

That's a tab character between the *.js and the jscs parts of the line. 这是*.js和行的jscs部分之间的tab符。

You can create a global .weignore file in your user folder (C:\\Users\\username), or in your project or solution folder. 您可以在用户文件夹(C:\\ Users \\ username)或项目或解决方案文件夹中创建全局.weignore文件。

Create a file .jscsrc in your project-root (eg via the command line: echo x > .jscsrc). 在项目根目录中创建一个.jscsrc文件(例如,通过命令行: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. 我只想将所有项目设置保持在一起,并避免需要在开发人员之间手动同步的全局设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio 2013中抑制JSHint“JSCS:非法空间”警告? - How can I suppress the JSHint “JSCS: Illegal Space” warnings in Visual Studio 2013? 如何在Visual Studio 2013 Web Essentials扩展中使用JsHint“.jshintrc”文件? - How do you use JsHint “.jshintrc” file with Visual Studio 2013 Web Essentials extension? Visual Studio MacOS上的Web Essentials - Web Essentials on Visual Studio MacOS 是否可以将Web Essentials配置为不将* .css文件添加到Visual Studio项目中? - Can Web Essentials be configured to NOT add *.css files to Visual Studio project? 如何使用Visual Studio和Web Essentials 2012将Bootstrap-3.0.0-wip less文件夹编译为.css? - How do I compile the Bootstrap-3.0.0-wip less folder to .css with Visual Studio and Web Essentials 2012? Visual Studio Web Essentials 2013无法编译bootstrap.less V3.1.1 - Visual studio web essentials 2013 cannot compile bootstrap.less V3.1.1 如何在 Visual Studio Web 2013 中添加 app.config 或 web.config 文件? - How can I add an app.config or web.config file in Visual Studio Web 2013? 使用Visual Studio Web Essentials捆绑目录 - Bundle directory using Visual Studio Web Essentials 如何关闭Visual Studio 2013 Preview? - How can I turn off Visual Studio 2013 Preview? 如何复制Visual Studio 2013试用版? - How can I copy visual studio 2013 trial?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM