Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include violated rule name in output #512

Closed
matthewadams opened this issue May 5, 2016 · 3 comments

Comments

@matthewadams
Copy link

commented May 5, 2016

I'm getting output from standard that doesn't include the name of the violated rule:

$ node_modules/.bin/standard
standard: Use JavaScript Standard Style (http://standardjs.com)
  /Users/matthew/Documents/github/.../socketApi.js:11:43: Getter is not present

This makes it difficult to conveniently add an // eslint-ignore-line or // eslint-ignore-next-line directive to include the name of the violated rule (which, in this case is accessor-pairs). For example:

$ node_modules/.bin/standard
standard: Use JavaScript Standard Style (http://standardjs.com)
  /Users/matthew/Documents/github/.../socketApi.js:11:43: Getter is not present:  accessor-pairs

would make it pretty easy to add.

Bonus points for emitting not just the rule name, but also something like to ignore: // eslint-ignore-line .. for quick copy & paste. For example, the above output could be augmented with:

$ node_modules/.bin/standard
standard: Use JavaScript Standard Style (http://standardjs.com)
  /Users/matthew/Documents/github/.../socketApi.js:11:43: Getter is not present:  accessor-pairs: to ignore, // eslint-disable-line accessor-pairs
@feross

This comment has been minimized.

Copy link
Member

commented May 5, 2016

You can get the rule name by running standard --verbose.

@feross feross closed this May 5, 2016

@matthewadams

This comment has been minimized.

Copy link
Author

commented May 6, 2016

Ok, but it'd still be nice to change the current output, (<rule-name>) to something like <rule-name>: ignore with // eslint-disable-next-line <rule-name> for easy copy/paste, don't you think? Reopen issue? #easeofusemakeskillerapps

@LinusU

This comment has been minimized.

Copy link
Member

commented May 6, 2016

I have yet to come up with one single case where I have had to ignore a rule, I don't think it should be in the output since we don't want to encourage anyone to do it. The real solution is to fix the problem, not ignore it...

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.