diff --git a/doc/usage.md b/doc/usage.md index 3e81e93a21..801f544db3 100644 --- a/doc/usage.md +++ b/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 + } + } } ``` diff --git a/lib/6to5/generation/buffer.js b/lib/6to5/generation/buffer.js index 9bfa757816..afd9c4dd23 100644 --- a/lib/6to5/generation/buffer.js +++ b/lib/6to5/generation/buffer.js @@ -35,7 +35,7 @@ Buffer.prototype.dedent = function () { }; Buffer.prototype.semicolon = function () { - if (this.format.semicolons) this.push(";"); + this.push(";"); }; Buffer.prototype.ensureSemicolon = function () { diff --git a/lib/6to5/generation/generator.js b/lib/6to5/generation/generator.js index 63919c94d3..f10e729ec4 100644 --- a/lib/6to5/generation/generator.js +++ b/lib/6to5/generation/generator.js @@ -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: {