Added pretty diff ternaryline option - Issue 524
This commit is contained in:
parent
7dbf1a3d5e
commit
a6410d540d
|
@ -1322,6 +1322,30 @@ Break chained method calls across subsequent lines (Supported by JS Beautify, Pr
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### [JavaScript - Preserve Ternary On Single Line](#javascript---preserve-ternary-lines)
|
||||||
|
|
||||||
|
**Namespace**: `js`
|
||||||
|
|
||||||
|
**Key**: `preserve_ternary_lines`
|
||||||
|
|
||||||
|
**Type**: `boolean`
|
||||||
|
|
||||||
|
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
|
||||||
|
|
||||||
|
**Description**:
|
||||||
|
|
||||||
|
Preserve ternary methods on a single line (Supported by JS Beautify, Pretty Diff)
|
||||||
|
|
||||||
|
**Example `.jsbeautifyrc` Configuration**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"js": {
|
||||||
|
"preserve_ternary_lines": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
#### [JavaScript - Keep array indentation](#javascript---keep-array-indentation)
|
#### [JavaScript - Keep array indentation](#javascript---keep-array-indentation)
|
||||||
|
|
||||||
**Namespace**: `js`
|
**Namespace**: `js`
|
||||||
|
|
|
@ -33,6 +33,7 @@ module.exports = class PrettyDiff extends Beautifier
|
||||||
if (break_chained_methods is true ) then \
|
if (break_chained_methods is true ) then \
|
||||||
false else true
|
false else true
|
||||||
]
|
]
|
||||||
|
ternaryline: "preserve_ternary_lines"
|
||||||
# Apply language-specific options
|
# Apply language-specific options
|
||||||
CSV: true
|
CSV: true
|
||||||
ERB: true
|
ERB: true
|
||||||
|
|
Loading…
Reference in New Issue