Remove whitespace generation (#5833)

* Remove whitespace generation and rely on default printing

Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines

* Fix a few more fixtures
This commit is contained in:
Daniel Tschinder
2017-06-27 19:57:02 -07:00
committed by Brian Ng
parent bc29145465
commit b3372a572d
379 changed files with 1974 additions and 1109 deletions

View File

@@ -3,7 +3,11 @@ var _i = function i() {
};
var _j = function j() {
({ j: _j } = 5);
({ y: _j } = 5);
({
j: _j
} = 5);
({
y: _j
} = 5);
;
};
};

View File

@@ -1,3 +1,4 @@
export {};
var obj = { await: function _await() {} };
var obj = {
await: function _await() {}
};

View File

@@ -1,9 +1,13 @@
var obj = {
search: function search({ search: _search }) {
search: function search({
search: _search
}) {
console.log(_search);
}
};
function search({ search }) {
function search({
search
}) {
console.log(search);
}
}

View File

@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
exports.default = function (_ref) {
var _onClick = _ref.onClick;
return React.createElement("div", { onClick: function onClick() {
return React.createElement("div", {
onClick: function onClick() {
return _onClick();
} });
};
}
});
};

View File

@@ -2,8 +2,8 @@ export { _whatever as whatever };
export { _wowzers as default };
var _foo = "yes",
foob = "no";
export { _foo as foo, foob };
function _whatever() {}
function _wowzers() {}
@@ -12,12 +12,10 @@ var bar = {
foo: function foo() {
_foo;
},
whatever: function whatever() {
_whatever;
},
wowzers: function wowzers() {
_wowzers;
}
};
};

View File

@@ -1,10 +1,13 @@
var foo;
foo = function foo() {};
var _baz;
_baz = function baz() {
_baz();
};
_baz = 12;
bar = function (_bar) {

View File

@@ -1,8 +1,9 @@
export { _foo as foo };
function _foo(bar) {}
var bar = {
foo: function foo() {
_foo;
}
};
};

View File

@@ -4,7 +4,6 @@ var obj = {
console.log(f);
})();
},
h: function (_h) {
function h() {
return _h.apply(this, arguments);
@@ -18,8 +17,7 @@ var obj = {
}(function () {
console.log(h);
}),
m: function m() {
doSmth();
}
};
};

View File

@@ -1,20 +1,22 @@
var Utils = {
get: function get() {}
};
var { get: _get } = Utils;
var {
get: _get
} = Utils;
var bar = {
get: function get(arg) {
_get(arg, "baz");
}
};
var f = function f({ foo: _foo = "bar" }) {
var f = function f({
foo: _foo = "bar"
}) {
var obj = {
// same name as parameter
foo: function foo() {
_foo;
}
};
};
};

View File

@@ -5,11 +5,15 @@ const x = function x() {
babelHelpers.newArrowCheck(this, _this);
return x;
}.bind(this);
const y = function y(x) {
babelHelpers.newArrowCheck(this, _this);
return x();
}.bind(this);
const z = { z: function z() {
const z = {
z: function z() {
babelHelpers.newArrowCheck(this, _this);
return y(x);
}.bind(this) }.z;
}.bind(this)
}.z;

View File

@@ -1,9 +1,13 @@
const x = function x() {
return x;
};
const y = function y(x) {
return x();
};
const z = { z: function z() {
const z = {
z: function z() {
return y(x);
} }.z;
}
}.z;

View File

@@ -1,2 +1,4 @@
export const x = ({ x }) => x;
export const x = ({
x
}) => x;
export const y = function y() {};