简体   繁体   English

JSCS如何为代码规则的特定部分禁用requireDotNotation?

[英]JSCS How to disable for a specific part of code rule requireDotNotation?

I am using JSCS to validate my code and I have requireDotNotation set to on for all my code base, but for a specific part of code I need to disable this rule. 我正在使用JSCS验证我的代码,并且我所有代码库都将requireDotNotation设置为on,但是对于代码特定部分,我需要禁用此规则。

Basically I would need to do something similar (example working for JSHint) but for JSCS: 基本上,我需要做一些类似的事情(为JSHint工作的示例),但对于JSCS:

/*jshint sub:true*/
//some code here
/*jshint sub:false*/

I was able to solve this issue using the following code: 我可以使用以下代码解决此问题:

//jscs:disable requireDotNotation
//some code here
//jscs:enable requireDotNotation

I am adding this answer hope can help others. 我正在添加此答案,希望可以对其他人有所帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM