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:
committed by
Brian Ng
parent
bc29145465
commit
b3372a572d
@@ -13,4 +13,5 @@ export default class App extends React.Component {
|
||||
render() {
|
||||
return _ref2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ var _ref3 = <p>Parent</p>;
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const AppItem = () => {
|
||||
|
||||
@@ -16,5 +16,6 @@ var _ref3 = <p>Parent</p>;
|
||||
render() {
|
||||
return _ref2;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -2,6 +2,7 @@ export default class App extends React.Component {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var _ref2 = <div>child</div>;
|
||||
|
||||
@@ -3,11 +3,10 @@ function _asyncToGenerator(fn) { return function () { return new Promise((resolv
|
||||
export default {
|
||||
function(name) {
|
||||
return _asyncToGenerator(function* () {
|
||||
const uppercasedName = name.upperCase();
|
||||
|
||||
// awaits depending on uppercasedName go here
|
||||
const uppercasedName = name.upperCase(); // awaits depending on uppercasedName go here
|
||||
|
||||
return <Foo name={uppercasedName} />;
|
||||
})();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -1,6 +1,4 @@
|
||||
import React from 'react';
|
||||
|
||||
// Regression test for https://github.com/babel/babel/issues/5552
|
||||
import React from 'react'; // Regression test for https://github.com/babel/babel/issues/5552
|
||||
|
||||
var _ref = <div />;
|
||||
|
||||
@@ -8,9 +6,13 @@ class BugReport extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
|
||||
return _temp = super(...args), this.thisWontWork = ({ color }) => data => {
|
||||
return _temp = super(...args), this.thisWontWork = ({
|
||||
color
|
||||
}) => data => {
|
||||
return <div color={color}>does not reference data</div>;
|
||||
}, this.thisWorks = ({ color }) => data => {
|
||||
}, this.thisWorks = ({
|
||||
color
|
||||
}) => data => {
|
||||
return <div color={color}>{data}</div>;
|
||||
}, _temp;
|
||||
}
|
||||
@@ -18,4 +20,5 @@ class BugReport extends React.Component {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,4 +10,5 @@ class AnchorLink extends Component {
|
||||
|
||||
return <Link>{children}</Link>;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@ var _ref2 = <div className="child">
|
||||
</div>;
|
||||
|
||||
let Child = () => _ref2;
|
||||
|
||||
Child = HOC(Child);
|
||||
|
||||
var _ref = <div className="parent">
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
function render(flag) {
|
||||
if (flag) {
|
||||
var bar = "bar";
|
||||
|
||||
[].map(() => bar);
|
||||
|
||||
return <foo bar={bar} />;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
function fn(Component, obj) {
|
||||
|
||||
var data = obj.data,
|
||||
_ref = <Component prop={data} />;
|
||||
|
||||
return () => _ref;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
// https://github.com/facebook/react/issues/3226
|
||||
// Not safe to reuse because it is mutable
|
||||
function render() {
|
||||
return <div style={{ width: 100 }} />;
|
||||
}
|
||||
return <div style={{
|
||||
width: 100
|
||||
}} />;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ class A {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default class B {}
|
||||
|
||||
@@ -2,6 +2,7 @@ class A {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class B {}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
function fn(Component) {
|
||||
|
||||
var data = "prop",
|
||||
_ref = <Component prop={data} />;
|
||||
|
||||
return () => _ref;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user