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

forbidding --fix with --stdin makes it incompatible with vim-autoformat #163

Closed
gautaz opened this issue Nov 15, 2016 · 6 comments
Closed

Comments

@gautaz
Copy link
Contributor

gautaz commented Nov 15, 2016

vim-autoformat documentation states:

The formatprogram must read the unformatted code from the standard input, and write the formatted code to the standard output.

I guess this limitation (forbidden --fix --stdin) comes from eslint but I still ask in case there is anything that can be done to work around the limitation on xo's side.

@sindresorhus
Copy link
Member

I just followed ESLint's lead, but in hindsight it doesn't make sense. Added in #164. Please try it out and report back :)

@gautaz
Copy link
Contributor Author

gautaz commented Nov 16, 2016

@sindresorhus Just tried your stdin-fix branch, works like a charm with vim-autoformat!
Thanks! :-)

gautaz added a commit to gautaz/dotfiles that referenced this issue Nov 16, 2016
@sindresorhus
Copy link
Member

@gautaz Cool. Would you be willing to submit a short instruction on how to use the VIM autoformat and XO? Here: https://github.com/sindresorhus/xo#vim

@gautaz
Copy link
Contributor Author

gautaz commented Nov 16, 2016

Done in #165, hope it is enough.
Additional configuration might be needed in case you want to use the XO's module from the current project but it seems a bit out of scope (for an example see this autoformat config using these utilities).

@sindresorhus
Copy link
Member

Additional configuration might be needed in case you want to use the XO's module from the current project but it seems a bit out of scope

XO already handles that. If you call the global XO binary and there's one in your project, it will defer to that one instead.

@gautaz
Copy link
Contributor Author

gautaz commented Nov 16, 2016

XO already handles that. If you call the global XO binary and there's one in your project, it will defer to that one instead.

Gosh! If only all linters could do that ;-).

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

No branches or pull requests

2 participants