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
@@ -1,2 +1,3 @@
|
||||
React.createElement(Component, babelHelpers.extends({}, props, {
|
||||
sound: "moo" }));
|
||||
sound: "moo"
|
||||
}));
|
||||
@@ -1,8 +1,7 @@
|
||||
var Component;
|
||||
Component = React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,6 @@
|
||||
export default React.createClass({
|
||||
displayName: "actual",
|
||||
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -4,10 +4,9 @@ var Whateva = React.createClass({
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
var Bar = React.createClass({
|
||||
"displayName": "Ba",
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,9 +1,8 @@
|
||||
exports = {
|
||||
Component: React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
exports.Component = React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,6 @@
|
||||
var Component = React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,14 +1,15 @@
|
||||
/** @jsx dom */
|
||||
|
||||
dom(Foo, null);
|
||||
|
||||
var profile = dom(
|
||||
"div",
|
||||
null,
|
||||
dom("img", { src: "avatar.png", className: "profile" }),
|
||||
dom("img", {
|
||||
src: "avatar.png",
|
||||
className: "profile"
|
||||
}),
|
||||
dom(
|
||||
"h3",
|
||||
null,
|
||||
[user.firstName, user.lastName].join(" ")
|
||||
)
|
||||
);
|
||||
);
|
||||
@@ -1,14 +1,15 @@
|
||||
/** @jsx dom */
|
||||
|
||||
dom(Foo, null);
|
||||
|
||||
var profile = dom(
|
||||
"div",
|
||||
null,
|
||||
dom("img", { src: "avatar.png", className: "profile" }),
|
||||
dom("img", {
|
||||
src: "avatar.png",
|
||||
className: "profile"
|
||||
}),
|
||||
dom(
|
||||
"h3",
|
||||
null,
|
||||
[user.firstName, user.lastName].join(" ")
|
||||
)
|
||||
);
|
||||
);
|
||||
@@ -1,12 +1,14 @@
|
||||
dom(Foo, null);
|
||||
|
||||
var profile = dom(
|
||||
"div",
|
||||
null,
|
||||
dom("img", { src: "avatar.png", className: "profile" }),
|
||||
dom("img", {
|
||||
src: "avatar.png",
|
||||
className: "profile"
|
||||
}),
|
||||
dom(
|
||||
"h3",
|
||||
null,
|
||||
[user.firstName, user.lastName].join(" ")
|
||||
)
|
||||
);
|
||||
);
|
||||
@@ -1 +1,3 @@
|
||||
React.createElement(Component, { constructor: "foo" });
|
||||
React.createElement(Component, {
|
||||
constructor: "foo"
|
||||
});
|
||||
@@ -3,21 +3,18 @@ var x = React.createElement(
|
||||
null,
|
||||
React.createElement(Component, null)
|
||||
);
|
||||
|
||||
var x = React.createElement(
|
||||
"div",
|
||||
null,
|
||||
props.children
|
||||
);
|
||||
|
||||
var x = React.createElement(
|
||||
Composite,
|
||||
null,
|
||||
props.children
|
||||
);
|
||||
|
||||
var x = React.createElement(
|
||||
Composite,
|
||||
null,
|
||||
React.createElement(Composite2, null)
|
||||
);
|
||||
);
|
||||
@@ -1,3 +1,9 @@
|
||||
React.createElement("div", { id: "w\xF4w" });
|
||||
React.createElement("div", { id: "\\w" });
|
||||
React.createElement("div", { id: "w < w" });
|
||||
React.createElement("div", {
|
||||
id: "w\xF4w"
|
||||
});
|
||||
React.createElement("div", {
|
||||
id: "\\w"
|
||||
});
|
||||
React.createElement("div", {
|
||||
id: "w < w"
|
||||
});
|
||||
@@ -8,7 +8,6 @@ React.createElement(
|
||||
null,
|
||||
"w\xF4w"
|
||||
);
|
||||
|
||||
React.createElement(
|
||||
"div",
|
||||
null,
|
||||
@@ -19,7 +18,6 @@ React.createElement(
|
||||
null,
|
||||
"w & w"
|
||||
);
|
||||
|
||||
React.createElement(
|
||||
"div",
|
||||
null,
|
||||
@@ -41,7 +39,6 @@ React.createElement(
|
||||
"this should parse as unicode: ",
|
||||
'\u00a0 '
|
||||
);
|
||||
|
||||
React.createElement(
|
||||
"div",
|
||||
null,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
var HelloMessage = React.createClass({
|
||||
displayName: "HelloMessage",
|
||||
|
||||
render: function () {
|
||||
return React.createElement(
|
||||
"div",
|
||||
@@ -10,9 +9,10 @@ var HelloMessage = React.createClass({
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(React.createElement(HelloMessage, { name: React.createElement(
|
||||
React.render(React.createElement(HelloMessage, {
|
||||
name: React.createElement(
|
||||
"span",
|
||||
null,
|
||||
"Sebastian"
|
||||
) }), mountNode);
|
||||
)
|
||||
}), mountNode);
|
||||
@@ -2,4 +2,5 @@ var x = React.createElement("div", {
|
||||
attr1: "foo" + "bar",
|
||||
attr2: "foo" + "bar" + "baz" + "bug",
|
||||
attr3: "foo" + "bar" + "baz" + "bug",
|
||||
attr4: "baz" });
|
||||
attr4: "baz"
|
||||
});
|
||||
@@ -1,5 +1,7 @@
|
||||
React.createElement(
|
||||
"button",
|
||||
{ "data-value": "a value\n with\nnewlines\n and spaces" },
|
||||
{
|
||||
"data-value": "a value\n with\nnewlines\n and spaces"
|
||||
},
|
||||
"Button"
|
||||
);
|
||||
);
|
||||
@@ -1,5 +1,7 @@
|
||||
React.createElement(
|
||||
"button",
|
||||
{ "data-value": "a value" },
|
||||
{
|
||||
"data-value": "a value"
|
||||
},
|
||||
"Button"
|
||||
);
|
||||
@@ -1 +1,4 @@
|
||||
React.createElement(Component, babelHelpers.extends({}, x, { y: 2, z: true }));
|
||||
React.createElement(Component, babelHelpers.extends({}, x, {
|
||||
y: 2,
|
||||
z: true
|
||||
}));
|
||||
@@ -1 +1,4 @@
|
||||
React.createElement(Component, babelHelpers.extends({ y: 2, z: true }, x));
|
||||
React.createElement(Component, babelHelpers.extends({
|
||||
y: 2,
|
||||
z: true
|
||||
}, x));
|
||||
@@ -1 +1,5 @@
|
||||
React.createElement(Component, babelHelpers.extends({ y: 2 }, x, { z: true }));
|
||||
React.createElement(Component, babelHelpers.extends({
|
||||
y: 2
|
||||
}, x, {
|
||||
z: true
|
||||
}));
|
||||
@@ -1 +1,3 @@
|
||||
var div = React.createElement(Component, Object.assign({}, props, { foo: "bar" }));
|
||||
var div = React.createElement(Component, Object.assign({}, props, {
|
||||
foo: "bar"
|
||||
}));
|
||||
Reference in New Issue
Block a user