document format options
This commit is contained in:
parent
aae7d8190b
commit
84332da399
30
doc/usage.md
30
doc/usage.md
@ -162,10 +162,6 @@ result.ast;
|
||||
// Default: false
|
||||
runtime: true,
|
||||
|
||||
// Output comments in generated output
|
||||
// Default: true
|
||||
comments: false,
|
||||
|
||||
// Enable support for experimental ES7 features
|
||||
// Default: false
|
||||
experimental: true,
|
||||
@ -178,7 +174,31 @@ result.ast;
|
||||
// Set this to `false` if you don't want the transformed code in the returned
|
||||
// result
|
||||
// Default: true
|
||||
code: true
|
||||
code: true,
|
||||
|
||||
format: {
|
||||
// Output comments in generated output
|
||||
// Default: true
|
||||
comments: true,
|
||||
|
||||
// Do not include superfluous whitespace characters and line terminators
|
||||
// Default: false
|
||||
compact: false,
|
||||
|
||||
indent: {
|
||||
// Adjust the indentation of multiline comments to keep asterisks vertically aligned
|
||||
// Default: true
|
||||
adjustMultilineComment: true,
|
||||
|
||||
// Indent string
|
||||
// Default: " "
|
||||
style: " ",
|
||||
|
||||
// Base indent level
|
||||
// Default: 0
|
||||
base: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ Buffer.prototype.dedent = function () {
|
||||
};
|
||||
|
||||
Buffer.prototype.semicolon = function () {
|
||||
if (this.format.semicolons) this.push(";");
|
||||
this.push(";");
|
||||
};
|
||||
|
||||
Buffer.prototype.ensureSemicolon = function () {
|
||||
|
||||
@ -36,8 +36,6 @@ _.each(Buffer.prototype, function (fn, key) {
|
||||
|
||||
CodeGenerator.normaliseOptions = function (opts) {
|
||||
return _.merge({
|
||||
parentheses: true,
|
||||
semicolons: true,
|
||||
comments: opts.comments == null || opts.comments,
|
||||
compact: false,
|
||||
indent: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user