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

Open files with problems #38

Closed
oskarrough opened this issue Oct 16, 2015 · 3 comments · Fixed by #55
Closed

Open files with problems #38

oskarrough opened this issue Oct 16, 2015 · 3 comments · Fixed by #55

Comments

@oskarrough
Copy link

While not directly related to xo, is there a way to open all files with problems found by xo,

xo app/**/*.js | subl *

… or something like that?

@sindresorhus
Copy link
Member

Interesting. Hadn't thought of this. I'll think about adding something like git diff --name-only, but in the meantime you can use xo --compact | cut -d ':' -f 1 -s | uniq | xargs subl.

Might be useful to output the following format:

/Users/sindresorhus/dev/pageres/lib/index.js:1:6
/Users/sindresorhus/dev/pageres/lib/util.js:5:15

As subl and probably other tools support the line:column format:

Filenames may be given a :line or :line:column suffix to open at a specific
location.

@vadimdemedes
Copy link

What about using $EDITOR environment variable in a combination with a CLI flag (e.g. --open) to open failed files? Indeed a great feature!

$ EDITOR=atom # example value of $EDITOR
$ xo --open

@sindresorhus
Copy link
Member

PR welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants