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
|
// Default: false
|
||||||
runtime: true,
|
runtime: true,
|
||||||
|
|
||||||
// Output comments in generated output
|
|
||||||
// Default: true
|
|
||||||
comments: false,
|
|
||||||
|
|
||||||
// Enable support for experimental ES7 features
|
// Enable support for experimental ES7 features
|
||||||
// Default: false
|
// Default: false
|
||||||
experimental: true,
|
experimental: true,
|
||||||
@ -178,7 +174,31 @@ result.ast;
|
|||||||
// Set this to `false` if you don't want the transformed code in the returned
|
// Set this to `false` if you don't want the transformed code in the returned
|
||||||
// result
|
// result
|
||||||
// Default: true
|
// 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 () {
|
Buffer.prototype.semicolon = function () {
|
||||||
if (this.format.semicolons) this.push(";");
|
this.push(";");
|
||||||
};
|
};
|
||||||
|
|
||||||
Buffer.prototype.ensureSemicolon = function () {
|
Buffer.prototype.ensureSemicolon = function () {
|
||||||
|
|||||||
@ -36,8 +36,6 @@ _.each(Buffer.prototype, function (fn, key) {
|
|||||||
|
|
||||||
CodeGenerator.normaliseOptions = function (opts) {
|
CodeGenerator.normaliseOptions = function (opts) {
|
||||||
return _.merge({
|
return _.merge({
|
||||||
parentheses: true,
|
|
||||||
semicolons: true,
|
|
||||||
comments: opts.comments == null || opts.comments,
|
comments: opts.comments == null || opts.comments,
|
||||||
compact: false,
|
compact: false,
|
||||||
indent: {
|
indent: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user