![]() * Add `--help` CLI flag * Don't pick up unknown CLI options This prevents people from adding new CLI options in the future, but forgetting to add it explicitly to minimist, resulting in a false "Ignored unknown option" warning. * Add `-h` and `-v` option aliases It always bugs me when those don't do `--help` and `--version` for no reason in CLIs. * Allow `echo 'test' | prettier` without the `--stdin` flag * Improve CLI error handling and validation - Handle errors the same way both when using stdin and when using files. - Print validation errors nicely. - Validate int options, instead of silently ignoring bad input. - Warn about unknown parsers, falling back to babylon. If a new parser is added in the future, this allows graceful degradation for tools running an older version of prettier. (Just like how unknown options are warnings instead of errors.) - Add comments. * Run prettier on bin/prettier.js |
||
---|---|---|
.. | ||
prettier.js |