From daa3ba4c93d0004bfc2a65457132fa73971f77eb Mon Sep 17 00:00:00 2001 From: andrewsuperlegit <47898478+andrewsuperlegit@users.noreply.github.com> Date: Sun, 25 Apr 2021 03:19:53 -0500 Subject: [PATCH] adds javascript comma first option to documentation See my other pull request; js-beautify has an option for comma first formatting; so I added it to the readme and also here so people know about it :-) --- docs/options.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/options.md b/docs/options.md index 51093eb..6449d27 100644 --- a/docs/options.md +++ b/docs/options.md @@ -2854,6 +2854,45 @@ Break chained method calls across subsequent lines (Supported by JS Beautify, Pr } } ``` +##### [Comma First](#comma-first) + +**Namespace**: `js` + +**Key**: `comma_first` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Allow comma first formatting (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "js": { + "comma_first": true + } +} +``` + +```javascript +// will transform this: +const obj = { + foo: 1, + bar: 2 +} + +// into this: +const obj = { + foo: 1 + , bar: 2 +} + +``` + ##### [Content unformatted](#content-unformatted)