-
Notifications
You must be signed in to change notification settings - Fork 515
Ignore unrecognized rules to maintain forward compatibility #334
Comments
I believe this is not a good approach: you think you are using declared rules, but some of them might be unsupported yet. |
Yes, but these rules shouldn't prevent you from using JSCS completely. JSHint contains a decent compromise: Report bad rules as errors just like any other error:
|
@mdevils I like JSHint's approach as well. |
I wanted to comment out some rules, like "// requireSpaceBeforeBlockStatements", but then it starts complaining. It's nice to be able to leave unsupported rules in. It would also be nice if you could explicitly set something to |
+1 for JSHint's approach and +2 for comments and allowing to set an option to false. |
Comments should be already supported. At least with I'm guessing the |
You can disable a rule with |
Yes it does work! Thank you. |
@mdevils id like to implement the JSHint approach here. Once per file complain about unsupported rules on line 1, column 1 like we did for deprecated rules. This also allows us to remove the deprecated rules as they'll now just complain about being unsupported. We can revisit in 2.0 if we want a better mechanism for reporting non code style errors, but right now the behavior of "just not working" if you're using an editor plugin is pretty bad. Thoughts? |
+1 |
@mikesherov I think it's a definitely a good approach, 👍 for it |
@mikesherov I agree |
Is this as simple as setting a new property like Then, right before returning the errors, we check |
@mrjoelkemp it's even simpler. For each unsupported rule found, when it's found, add a single error, once for each rule. |
But you don't have access to the error instance in I don't see an alternative. |
|
… exceptions Closes jscs-devgh-710 Fixes jscs-dev#334
Why is this 2.0 and not 1.8? I'm moving it to 1.8, because it doesn't break backwards compatibility. |
… exceptions Closes jscs-devgh-710 Fixes jscs-dev#334
… exceptions Closes jscs-devgh-710 Fixes jscs-dev#334
… exceptions Closes jscs-devgh-710 Fixes jscs-dev#334
… exceptions Closes jscs-devgh-710 Fixes jscs-dev#334
… exceptions Closes jscs-devgh-710 Fixes jscs-dev#334
Currently jscs raises error if it encounters a rule it doesn't recognize. This causes problems when new rules, that old jscs versions do not recognize, are added to project's jscsrc file.
Obviously the recommended solution is for everyone to update their jscs at this point, but this isn't necessarily possible. Jscs might be bundled inside another product for example (e.g. Visual Studio Web Essentials).
The text was updated successfully, but these errors were encountered: