jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

Rule shown in message for programmatic API #2235

Closed Arcanemagus closed 8 years ago

Arcanemagus commented 8 years ago

It seems that with the changes in https://github.com/jscs-dev/node-jscs/commit/dc468431aa19b6373e6fdc67b8d8bde40d7528d1 a bug was introduced where when getting the rules via the API the ruleID is shown in the message attribute as well as the rule attribute.

image

Since the information is already accessible it should be up to the consumer of the API what to do with it, instead of being forced to have it in the message.

qfox commented 8 years ago

Guess we can move _prepareMessage call from https://github.com/jscs-dev/node-jscs/blob/master/lib/errors.js#L86 to https://github.com/jscs-dev/node-jscs/blob/master/lib/errors.js#L211

Need to try to not break something else.

markelog commented 8 years ago

@zxqfox are you on it?

markelog commented 8 years ago

Nope that was the point - always show the error, rule property only for the convenience