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

Add stdin support to import-sort-cli #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ronyclau
Copy link

This PR add the support for applying import sort to a file passed in through stdin.

Two options are added to the import-sort CLI util:

  1. --stdin: Make import-sort read from stdin. Requires --stdin-filepath; conflicts with --write.
  2. --stdin-filepath=<path>: Assumed path to file.

Example invocation:

cat x.js \
  | import-sort-cli --stdin --stdin-filepath='src/model/A.js' \
  | prettier --stdin --stdin-filepath='src/model/A.js'

@bpinto
Copy link

bpinto commented Nov 12, 2020

This is excellent!

@abstracthat
Copy link

@renke Any chance you can merge this soon? My team could really use this feature.

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

Successfully merging this pull request may close these issues.

3 participants