Clarify --trailing-comma a bit

Refs. #2655
master
Simon Lydell 2017-08-23 17:44:07 +02:00
parent 854bb3ccc5
commit cd9ad2c57c
2 changed files with 4 additions and 3 deletions

View File

@ -549,12 +549,13 @@ Default | CLI Override | API Override
`false` | `--single-quote` | `singleQuote: <bool>`
### Trailing Commas
Print trailing commas wherever possible.
Print trailing commas wherever possible when multi-line. (A single-line array,
for example, never gets trailing commas.)
Valid options:
* `"none"` - No trailing commas.
* `"es5"` - Trailing commas where valid in ES5 (objects, arrays, etc.)
* `"all"` - Trailing commas wherever possible (function arguments). This requires node 8 or a [transform](https://babeljs.io/docs/plugins/syntax-trailing-function-commas/).
* `"all"` - Trailing commas wherever possible (including function arguments). This requires node 8 or a [transform](https://babeljs.io/docs/plugins/syntax-trailing-function-commas/).
Default | CLI Override | API Override
--------|--------------|-------------

View File

@ -305,7 +305,7 @@ if (
" --no-bracket-spacing Do not print spaces between brackets.\n" +
" --jsx-bracket-same-line Put > on the last line instead of at a new line.\n" +
" --trailing-comma <none|es5|all>\n" +
" Print trailing commas wherever possible. Defaults to none.\n" +
" Print trailing commas wherever possible when multi-line. Defaults to none.\n" +
" --parser <flow|babylon|typescript|postcss|json|graphql>\n" +
" Specify which parse to use. Defaults to babylon.\n" +
" --cursor-offset <int> Print (to stderr) where a cursor at the given position would move to after formatting.\n" +