简体   繁体   中英

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.

Basically I would need to do something similar (example working for JSHint) but for 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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