import-sort icon indicating copy to clipboard operation
import-sort copied to clipboard

Add stdin support to import-sort-cli

Open ronyclau opened this issue 4 years ago • 2 comments

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'

ronyclau avatar Aug 11 '20 08:08 ronyclau

This is excellent!

bpinto avatar Nov 12 '20 14:11 bpinto

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

abstracthat avatar Nov 12 '20 14:11 abstracthat