Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(transformer): fix indentation in transformer test fixtures #6346

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ function outer() {
var _this4, _this$foo$bar2, _this5, _this6, _fn4$foo$bar$qux2;
(_this4 = this), (_this4["prop"] = Math.pow(_this4["prop"], 28));
(_this$foo$bar2 = this.foo.bar),
(_this$foo$bar2["qux"] = Math.pow(_this$foo$bar2["qux"], 29));
(_this$foo$bar2["qux"] = Math.pow(_this$foo$bar2["qux"], 29));
(_this5 = this), (_this5["prop blah"] = Math.pow(_this5["prop blah"], 30));
(_this6 = this),
(_fn4$foo$bar$qux2 = fn4().foo.bar.qux()),
(_this6[_fn4$foo$bar$qux2] = Math.pow(_this6[_fn4$foo$bar$qux2], 31));
(_fn4$foo$bar$qux2 = fn4().foo.bar.qux()),
(_this6[_fn4$foo$bar$qux2] = Math.pow(_this6[_fn4$foo$bar$qux2], 31));
}

// Underscore var names
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class C {
#p = 1;
#p = 1;

method(obj) {
this.#p **= 1;
obj.#p **= 2;
this.x.y.z.#p **= 3;
obj.x.y.z.#p **= 4;
fn().x.y.z.#p **= 5;
}
method(obj) {
this.#p **= 1;
obj.#p **= 2;
this.x.y.z.#p **= 3;
obj.x.y.z.#p **= 4;
fn().x.y.z.#p **= 5;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class C {
#p = 1;
#p = 1;

method(obj) {
var _this, _this$x$y$z, _obj$x$y$z, _fn$x$y$z;
_this = this, _this.#p = Math.pow(_this.#p, 1);
obj.#p = Math.pow(obj.#p, 2);
_this$x$y$z = this.x.y.z, _this$x$y$z.#p = Math.pow(_this$x$y$z.#p, 3);
_obj$x$y$z = obj.x.y.z, _obj$x$y$z.#p = Math.pow(_obj$x$y$z.#p, 4);
_fn$x$y$z = fn().x.y.z, _fn$x$y$z.#p = Math.pow(_fn$x$y$z.#p, 5);
}
method(obj) {
var _this, _this$x$y$z, _obj$x$y$z, _fn$x$y$z;
_this = this, _this.#p = Math.pow(_this.#p, 1);
obj.#p = Math.pow(obj.#p, 2);
_this$x$y$z = this.x.y.z, _this$x$y$z.#p = Math.pow(_this$x$y$z.#p, 3);
_obj$x$y$z = obj.x.y.z, _obj$x$y$z.#p = Math.pow(_obj$x$y$z.#p, 4);
_fn$x$y$z = fn().x.y.z, _fn$x$y$z.#p = Math.pow(_fn$x$y$z.#p, 5);
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
var _s = $RefreshSig$(), _s2 = $RefreshSig$(), _s3 = $RefreshSig$(), _s4 = $RefreshSig$(), _s5 = $RefreshSig$(), _s6 = $RefreshSig$();
export default _s(() => {
_s();
return useContext(X);
_s();
return useContext(X);
}, "useContext{}");
export const Foo = () => {
_s2();
return useContext(X);
_s2();
return useContext(X);
};
_s2(Foo, "useContext{}");
_c = Foo;
module.exports = _s3(() => {
_s3();
return useContext(X);
_s3();
return useContext(X);
}, "useContext{}");
const Bar = () => {
_s4();
return useContext(X);
_s4();
return useContext(X);
};
_s4(Bar, "useContext{}");
_c2 = Bar;
const Baz = _s5(memo(_c3 = _s5(() => {
_s5();
return useContext(X);
_s5();
return useContext(X);
}, "useContext{}")), "useContext{}");
_c4 = Baz;
const Qux = () => {
_s6();
return 0, useContext(X);
_s6();
return 0, useContext(X);
};
_s6(Qux, "useContext{}");
_c5 = Qux;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const B = foo ? require("X") : require("Y");
const C = requireCond(gk, "C");
const D = import("D");
export default function App() {
return _jsxs("div", { children: [_jsx(A, {}), _jsx(B, {}), _jsx(C, {}), _jsx(D, {})] });
return _jsxs("div", { children: [_jsx(A, {}), _jsx(B, {}), _jsx(C, {}), _jsx(D, {})] });
}
_c = App;
var _c;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
while (item) {
var _s = $RefreshSig$();
_s((item) => {
_s();
useFoo();
}, "useFoo{}", true)(item);
var _s = $RefreshSig$();
_s((item) => {
_s();
useFoo();
}, "useFoo{}", true)(item);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { jsx as _jsx } from "react/jsx-runtime";
var _s = $RefreshSig$();
export default function Bar() {
_s();
useContext(X);
return _jsx(Foo, {});
_s();
useContext(X);
return _jsx(Foo, {});
}
_s(Bar, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
_c = Bar;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { jsx as _jsx } from "react/jsx-runtime";
var _s = $RefreshSig$();
export default function App() {
_s();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", { children: foo });
_s();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", { children: foo });
}
_s(App, "useState{[foo, setFoo](0)}\\nuseEffect{}");
_c = App;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { jsx as _jsx } from "react/jsx-runtime";
var _s = $RefreshSig$(), _s2 = $RefreshSig$();
export const A = _s(React.memo(_c2 = _s(React.forwardRef(_c = _s((props, ref) => {
_s();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", {
ref,
children: foo
});
_s();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", {
ref,
children: foo
});
}, "useState{[foo, setFoo](0)}\\nuseEffect{}")), "useState{[foo, setFoo](0)}\\nuseEffect{}")), "useState{[foo, setFoo](0)}\\nuseEffect{}");
_c3 = A;
export const B = _s2(React.memo(_c5 = _s2(React.forwardRef(_c4 = _s2(function(props, ref) {
_s2();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", {
ref,
children: foo
});
_s2();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", {
ref,
children: foo
});
}, "useState{[foo, setFoo](0)}\\nuseEffect{}")), "useState{[foo, setFoo](0)}\\nuseEffect{}")), "useState{[foo, setFoo](0)}\\nuseEffect{}");
_c6 = B;
function hoc() {
var _s3 = $RefreshSig$();
return _s3(function Inner() {
_s3();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", {
ref,
children: foo
});
}, "useState{[foo, setFoo](0)}\\nuseEffect{}");
var _s3 = $RefreshSig$();
return _s3(function Inner() {
_s3();
const [foo, setFoo] = useState(0);
React.useEffect(() => {});
return _jsx("h1", {
ref,
children: foo
});
}, "useState{[foo, setFoo](0)}\\nuseEffect{}");
}
export let C = hoc();
var _c, _c2, _c3, _c4, _c5, _c6;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ var _s2 = $RefreshSig$();
import FancyHook from "fancy";
import { jsxs as _jsxs } from "react/jsx-runtime";
export default function App() {
_s2();
var _s = $RefreshSig$();
function useFancyState() {
_s();
const [foo, setFoo] = React.useState(0);
useFancyEffect();
return foo;
}
_s(useFancyState, "useState{[foo, setFoo](0)}\\nuseFancyEffect{}", true);
const bar = useFancyState();
const baz = FancyHook.useThing();
React.useState();
useThePlatform();
use();
return _jsxs("h1", { children: [bar, baz] });
_s2();
var _s = $RefreshSig$();
function useFancyState() {
_s();
const [foo, setFoo] = React.useState(0);
useFancyEffect();
return foo;
}
_s(useFancyState, "useState{[foo, setFoo](0)}\\nuseFancyEffect{}", true);
const bar = useFancyState();
const baz = FancyHook.useThing();
React.useState();
useThePlatform();
use();
return _jsxs("h1", { children: [bar, baz] });
}
_s2(App, "useFancyState{bar}\\nuseThing{baz}\\nuseState{}\\nuseThePlatform{}\\nuse{}", true, function() {
return [FancyHook.useThing];
return [FancyHook.useThing];
});
_c = App;
var _c;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { jsx as _jsx } from "react/jsx-runtime";
let A = foo ? () => {
return _jsx("h1", { children: "Hi" });
return _jsx("h1", { children: "Hi" });
} : null;
const B = function Foo() {
return _jsx("h1", { children: "Hi" });
return _jsx("h1", { children: "Hi" });
}();
let C = () => () => {
return _jsx("h1", { children: "Hi" });
return _jsx("h1", { children: "Hi" });
};
let D = bar && (() => {
return _jsx("h1", { children: "Hi" });
return _jsx("h1", { children: "Hi" });
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const throttledAlert = throttle(function() {
alert("Hi");
alert("Hi");
});
const TooComplex = function() {
return hello;
return hello;
}(() => {});
if (cond) {
const Foo = thing(() => {});
const Foo = thing(() => {});
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { jsx as _jsx } from "react/jsx-runtime";
let connect = () => {
function Comp() {
const handleClick = () => {};
return _jsx("h1", {
onClick: handleClick,
children: "Hi"
});
}
return Comp;
function Comp() {
const handleClick = () => {};
return _jsx("h1", {
onClick: handleClick,
children: "Hi"
});
}
return Comp;
};
function withRouter() {
return function Child() {
const handleClick = () => {};
return _jsx("h1", {
onClick: handleClick,
children: "Hi"
});
};
return function Child() {
const handleClick = () => {};
return _jsx("h1", {
onClick: handleClick,
children: "Hi"
});
};
}
;
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
var _hooks = require("./hooks");
var _s = $RefreshSig$();
function App() {
_s();
const bar = (0, _hooks.useFancyState)();
return _jsx("h1", { children: bar });
_s();
const bar = (0, _hooks.useFancyState)();
return _jsx("h1", { children: bar });
}
_s(App, "useFancyState{bar}", false, function() {
return [_hooks.useFancyState];
return [_hooks.useFancyState];
});
_c = App;
var _c;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { jsx as _jsx } from "react/jsx-runtime";
var _s = $RefreshSig$(), _s2 = $RefreshSig$(), _s3 = $RefreshSig$();
function useFancyState() {
_s();
const [foo, setFoo] = React.useState(0);
useFancyEffect();
return foo;
_s();
const [foo, setFoo] = React.useState(0);
useFancyEffect();
return foo;
}
_s(useFancyState, "useState{[foo, setFoo](0)}\\nuseFancyEffect{}", false, function() {
return [useFancyEffect];
return [useFancyEffect];
});
const useFancyEffect = () => {
_s2();
React.useEffect(() => {});
_s2();
React.useEffect(() => {});
};
_s2(useFancyEffect, "useEffect{}");
export default function App() {
_s3();
const bar = useFancyState();
return _jsx("h1", { children: bar });
_s3();
const bar = useFancyState();
return _jsx("h1", { children: bar });
}
_s3(App, "useFancyState{bar}", false, function() {
return [useFancyState];
return [useFancyState];
});
_c = App;
var _c;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var _s = $RefreshSig$();
export function Bar() {
_s();
A.B.C.useHook();
_s();
A.B.C.useHook();
}
_s(Bar, "useHook{}");
_c = Bar;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jsx as _jsx } from "react/jsx-runtime";
function Foo() {
return _jsx("h1", { children: "Hi" });
return _jsx("h1", { children: "Hi" });
}
_c = Foo;
export default _c2 = hoc(Foo);
Expand Down
Loading
Loading