Search code examples
jscs

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*/

Solution

  • 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.