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

@@ -11,6 +11,7 @@ let A = function (_B) {
} else {
var _this = _B.call(this) || this;
}
return _this;
}

View File

@@ -15,9 +15,11 @@ var Test = function (_Foo) {
var _this = _Foo.call.apply(_Foo, [this, "test"].concat(Array.prototype.slice.call(arguments))) || this;
(_Foo$prototype$test = _Foo.prototype.test).call.apply(_Foo$prototype$test, [_this].concat(Array.prototype.slice.call(arguments)));
(_Foo$prototype$test2 = _Foo.prototype.test).call.apply(_Foo$prototype$test2, [_this, "test"].concat(Array.prototype.slice.call(arguments)));
return _this;
}
return Test;
}(Foo);
}(Foo);

View File

@@ -5,7 +5,9 @@ var Test = function (_Foo) {
var _this = _Foo.call(this) || this;
_Foo.prototype.test.whatever();
_Foo.prototype.test.call(_this);
return _this;
}
@@ -14,4 +16,4 @@ var Test = function (_Foo) {
};
return Test;
}(Foo);
}(Foo);

View File

@@ -12,4 +12,4 @@ var x = function () {
}
return x;
}();
}();

View File

@@ -1,3 +1,3 @@
var Test = function Test() {
Function.prototype.hasOwnProperty.call(this, "test");
};
};

View File

@@ -16,7 +16,6 @@ var _binarySerializer = require("./helpers/binary-serializer");
var _binarySerializer2 = babelHelpers.interopRequireDefault(_binarySerializer);
// import ...
var Connection = function (_EventEmitter) {
babelHelpers.inherits(Connection, _EventEmitter);
@@ -26,9 +25,8 @@ var Connection = function (_EventEmitter) {
var _this = babelHelpers.possibleConstructorReturn(this, (Connection.__proto__ || Object.getPrototypeOf(Connection)).call(this));
_this.isConnected = false;
_this.roomId = roomId;
_this.roomId = roomId; // ...
// ...
return _this;
}

View File

@@ -22,7 +22,9 @@ var RandomComponent = function (_Component) {
value: function render() {
return _react2.default.createElement(
"div",
{ className: "sui-RandomComponent" },
{
className: "sui-RandomComponent"
},
_react2.default.createElement(
"h2",
null,

View File

@@ -19,6 +19,7 @@ var a1 = function (_b) {
_this.x = function () {
return _this;
};
return _this;
}
@@ -36,10 +37,11 @@ var a2 = function (_b2) {
_this2.x = function () {
return _this2;
};
return _this2;
}
return a2;
}(b);
exports.default = a2;
exports.default = a2;

View File

@@ -11,9 +11,8 @@ var B = function (_A) {
var _this, _ret;
babelHelpers.classCallCheck(this, B);
return _ret = (_this = babelHelpers.possibleConstructorReturn(this, (B.__proto__ || Object.getPrototypeOf(B)).call(this)), _this), babelHelpers.possibleConstructorReturn(_this, _ret);
}
return B;
}(A);
}(A);

View File

@@ -3,6 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
function _default() {
return function () {
function Select() {
@@ -16,4 +17,5 @@ function _default() {
return Select;
}();
}
exports.default = _default;
exports.default = _default;

View File

@@ -3,7 +3,6 @@
var Foo = function () {
function Foo(val) {
babelHelpers.classCallCheck(this, Foo);
this._val = val;
}
@@ -24,4 +23,4 @@ var Foo = function () {
})
}]);
return Foo;
}();
}();

View File

@@ -21,8 +21,9 @@ var A = function (_B) {
} else {
var _this = _possibleConstructorReturn(this, (A.__proto__ || Object.getPrototypeOf(A)).call(this));
}
return _possibleConstructorReturn(_this);
}
return A;
}(B);
}(B);

View File

@@ -5,7 +5,6 @@ var Test = function (_Foo) {
var _ref, _babelHelpers$get;
babelHelpers.classCallCheck(this, Test);
woops.super.test();
var _this = babelHelpers.possibleConstructorReturn(this, (Test.__proto__ || Object.getPrototypeOf(Test)).call(this));
@@ -17,7 +16,9 @@ var Test = function (_Foo) {
var _this = babelHelpers.possibleConstructorReturn(this, (_ref = Test.__proto__ || Object.getPrototypeOf(Test)).call.apply(_ref, [this, "test"].concat(Array.prototype.slice.call(arguments))));
babelHelpers.get(Test.prototype.__proto__ || Object.getPrototypeOf(Test.prototype), "test", _this).apply(_this, arguments);
(_babelHelpers$get = babelHelpers.get(Test.prototype.__proto__ || Object.getPrototypeOf(Test.prototype), "test", _this)).call.apply(_babelHelpers$get, [_this, "test"].concat(Array.prototype.slice.call(arguments)));
return _this;
}
@@ -28,6 +29,7 @@ var Test = function (_Foo) {
babelHelpers.get(Test.prototype.__proto__ || Object.getPrototypeOf(Test.prototype), "test", this).call(this);
babelHelpers.get(Test.prototype.__proto__ || Object.getPrototypeOf(Test.prototype), "test", this).apply(this, arguments);
(_babelHelpers$get2 = babelHelpers.get(Test.prototype.__proto__ || Object.getPrototypeOf(Test.prototype), "test", this)).call.apply(_babelHelpers$get2, [this, "test"].concat(Array.prototype.slice.call(arguments)));
}
}], [{
@@ -37,8 +39,9 @@ var Test = function (_Foo) {
babelHelpers.get(Test.__proto__ || Object.getPrototypeOf(Test), "foo", this).call(this);
babelHelpers.get(Test.__proto__ || Object.getPrototypeOf(Test), "foo", this).apply(this, arguments);
(_babelHelpers$get3 = babelHelpers.get(Test.__proto__ || Object.getPrototypeOf(Test), "foo", this)).call.apply(_babelHelpers$get3, [this, "test"].concat(Array.prototype.slice.call(arguments)));
}
}]);
return Test;
}(Foo);
}(Foo);

View File

@@ -1,6 +1,5 @@
var Test = function Test() {
babelHelpers.classCallCheck(this, Test);
this.state = "test";
};
@@ -21,9 +20,8 @@ var Foo = function (_Bar) {
var ConstructorScoping = function ConstructorScoping() {
babelHelpers.classCallCheck(this, ConstructorScoping);
var bar = void 0;
{
var _bar = void 0;
}
};
};

View File

@@ -1,3 +1,5 @@
var o = { foo: function foo() {
var o = {
foo: function foo() {
babelHelpers.classCallCheck(this, foo);
} };
}
};

View File

@@ -1,5 +1,4 @@
// #1649
var Foo = function () {
function Foo() {
babelHelpers.classCallCheck(this, Foo);
@@ -13,4 +12,4 @@ var Foo = function () {
value: function value() {}
}]);
return Foo;
}();
}();

View File

@@ -1,12 +1,10 @@
var BaseView = function BaseView() {
babelHelpers.classCallCheck(this, BaseView);
this.autoRender = true;
};
var BaseView = function BaseView() {
babelHelpers.classCallCheck(this, BaseView);
this.autoRender = true;
};
@@ -22,4 +20,4 @@ var BaseView = function () {
}
}]);
return BaseView;
}();
}();

View File

@@ -1,5 +1,4 @@
var Test = function Test() {
babelHelpers.classCallCheck(this, Test);
babelHelpers.get(Test.prototype.__proto__ || Object.getPrototypeOf(Test.prototype), "hasOwnProperty", this).call(this, "test");
};
};

View File

@@ -7,8 +7,9 @@ var Foo = function (_Bar) {
babelHelpers.classCallCheck(this, Foo);
var t = () => babelHelpers.get(Foo.prototype.__proto__ || Object.getPrototypeOf(Foo.prototype), "test", _this).call(_this);
return _this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this));
}
return Foo;
}(Bar);
}(Bar);

View File

@@ -5,10 +5,9 @@ var Foo = function (_Bar) {
var _this;
babelHelpers.classCallCheck(this, Foo);
babelHelpers.get(Foo.prototype.__proto__ || Object.getPrototypeOf(Foo.prototype), (_this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this)), _this).method, _this).call(_this);
return _this;
}
return Foo;
}(Bar);
}(Bar);