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

Expose eslint's output formatting flag #222

Closed
abacon opened this issue Aug 4, 2015 · 3 comments

Comments

@abacon
Copy link

commented Aug 4, 2015

I'd love to be able to use sindresorhus/eslint-tap with standard, but standard doesn't expose eslint's -f flag for formatting the output of the linter itself.

In fact, standard already overloads the term 'format' by providing a (lovely) way to automatically format source code.

What do y'all think about exposing an --output-format flag, or something similar, to support this use case?

@Flet

This comment has been minimized.

Copy link
Member

commented Aug 4, 2015

How about standard-tap :)

npm install -g standard-tap
standard | standard-tap

Or standard-json

npm install -g standard-json
standard | standard-json
@abacon

This comment has been minimized.

Copy link
Author

commented Aug 4, 2015

Nice! That's certainly enough for my purposes. Did you just whip those up? Thanks!

It's a bit odd to see you basically reverse-engineer the -f interface in your standard-json implementation, though. Isn't it better to work with the json in the first place, instead of going eslint json -> standard output plaintext -> json? And if standard ever changes its output format -- e.g. adding another line of preamble, or allowing multiline error messages -- then someone will have to dig through var re = /\s*([^:]+):([^:]+):([^:]+): ([^(]*) ?(\((.*)\))?/.exec(line). :\ Of course, I'm not super familiar with how tough it'd be to pipe -f through, so I understand if it's not worth the effort there.

Thanks again so much for your help!

@feross

This comment has been minimized.

Copy link
Member

commented Aug 5, 2015

Nice, there's plenty of choice now. The built-in reporter, snazzy, standard-json, and standard-tap.

I'd rather stick with this approach than add formatters to standard. This is better than standard being a gatekeeper of which formatters get in.

@feross feross closed this Aug 5, 2015

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 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.