document format options

This commit is contained in:
Sebastian McKenzie 2014-12-13 12:52:31 +11:00
parent aae7d8190b
commit 84332da399
3 changed files with 26 additions and 8 deletions

View File

@ -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
}
}
}
```

View File

@ -35,7 +35,7 @@ Buffer.prototype.dedent = function () {
};
Buffer.prototype.semicolon = function () {
if (this.format.semicolons) this.push(";");
this.push(";");
};
Buffer.prototype.ensureSemicolon = function () {

View File

@ -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: {