Skip to content

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'

Signed-off-by: Ron Lau <ron@ronlau.hk>
@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