-
Notifications
You must be signed in to change notification settings - Fork 515
ability to ignore all rules for specific lines #20
Comments
Reasonable. But due to Syntax Tree Structure, I have no good ideas how to implement. But you can try :) |
May be useful: https://code.google.com/p/esprima/issues/detail?id=197 |
@mdevils I has reviewed this issue and has found that comments' array contains locations of the comments, so we can found all comments for BlockStatements, parse these comments and set temporary options for checks. |
Yeah, I see. It is possible. The thing is that I can't find good, easy solution for implementing this in the current rule behavior. |
Got an easy implementation idea. I suggest these regions: |
Am i right that you propose to turn on/off jscs at all for region? |
Yep. |
See also #223 (requests inline configuration in general, as opposed to just disabling everything). This seems especially needed in case one is dealing with an upstream interface. For example, enforcing camel case identifiers and properties but encountering something like I'm referencing #102 as this is somewhat of a regression when coming from JSHint as migrating from |
Ran into this well when referencing third-party "G_vmlCanvasManager" (from excanvas.js), which doesn't satisfy camelcase, otherwise enforced in our project. +1 |
Another way to allow for 3rd-party exceptions like {
requireCamelCaseOrUpperCaseIdentifiers: true,
identifierCaseExceptions: [ 'G_vmlCanvasManager', '...' ]
} or even: {
requireCamelCaseOrUpperCaseIdentifiers: [ 'G_vmlCanvasManager', '...' ]
} ..although this might be too confusing. |
@kangax I like the approach, but maybe requireCamelCaseOrUpperCaseIdentifiers: {
ignore: [ 'G_vmlCanvasManager', '...' ]
} The first way would require a second rule, and the second is a little confusing since it seems like you are trying to enforce the camel casing on the exceptions. |
I have this issue as well. I think it would be nicer to just be able to turn off specific rules (or jscs checking entirely) for certain regions - having to put this stuff in the config requires the developer to be aware of more places in the code at once. |
+1 I need this for calls to a different library. |
Why not to comply with jshint in such case?
Would be much better to have a common api between similar tools.
|
+1 for interaction with external library |
+1 -- would like to have some way to ignore ala |
I need this too, for the use of an external library.... I prefer the inline comments like in JSHint and ESLint too. |
This is fixed in fa5527a and will be release with version 1.6.0! |
Great, thanks! :) Le 3 août 2014 à 02:02, Mike Sherov notifications@github.com a écrit :
|
@mikesherov thanks! any idea when you'll be tagging 1.6.0? |
Should happen on this week |
Inside
/*jscs: false*/ ... /*jscs: true*/
jscs will ignore all code.What do you think?
The text was updated successfully, but these errors were encountered: