- Move the very important options --write and --list-different to the
top, in the new Output category. It could be argued that --help and
--version also belong there, but I don't think they deserve such a
prominent position, so they are left in the Other category.
--find-config-path could also be considered an Output option, but I
think it fits better in the Config category.
- Now that there's an Output category, should there also be an Input
category? I thought about that, but the only candidates for such a
category are --stdin and --stdin-filepath and I don't think they are
important enough to have their own category, so they stay in Other.
- Move --cursor-offset, --range-end and --range-start to a new Editor
category, since they are mainly for editor integrations.
- Document how Prettier deals with input and output by default.
- Move Format options first, since they feel the most important.
- Move --find-config-path to the Config category.
- Merge Command into Other. It wasn't clear what "Command" options are,
and the Other category isn't too long anyway.
- Move --range-end and --range-start into Other. The aren't Format
options.
* Implement cosmiconfig
* Add resolveOptions API and extname support
* Add --resolve-config and --config, rename resolveOptions to resolveConfig
* Move color to top-level CLI options
* Fix unknown param warning
* Change from {} to null when no config is found
* Change override API to emulate eslint
* Add test for eslint-style overrides
* Delete overrides from resolveConfig
* feat(api): add custom parser API
* test(api): add integration test for parser resolution
* chore(api): fix build after resolving conflicts
* docs(api): document custom parser API
* docs(api): fix typo
* chore(build): add parse5 to build and support yarn test --prod
* Allow --debug-check to work with stdin
This makes it easier to quickly test formatting code snippets with e.g.
pbpaste | prettier --debug-check
Before, the following would happen:
$ pbpaste | prettier --debug-check
stdin: TypeError: Invalid data, chunk must be a string or buffer, not undefined
at WriteStream.Socket.write (net.js:693:11)
at writeOutput (/Users/josephfrazier/workspace/prettier/bin/prettier.js:375:18)
at getStdin.then.input (/Users/josephfrazier/workspace/prettier/bin/prettier.js:275:7)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
$
Now, it looks like this:
$ pbpaste | prettier --debug-check
(stdin)
$
* Test that --debug-check still prints filenames
See https://github.com/prettier/prettier/pull/2013#discussion_r120499306