prettier/tests/typescript_tsx/__snapshots__/jsfmt.spec.js.snap

262 lines
6.8 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`generic-component.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const c1 = <MyComponent<number> data={12} />
const c2 = <MyComponent<number> />
const c3 = <MyComponent<number> attr="value" />
=====================================output=====================================
const c1 = <MyComponent<number> data={12} />;
const c2 = <MyComponent<number> />;
const c3 = <MyComponent<number> attr="value" />;
================================================================================
`;
exports[`keyword.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
<try />;
<object />
=====================================output=====================================
<try />;
<object />;
================================================================================
`;
exports[`member-expression.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
(<a />).method();
(<a />).property;
(<a />)["computed"];
(<a />)["computed"]();
(
<div>
<a>foo</a>
</div>
).method();
(
<div>
<a>foo</a>
</div>
).property;
(
<div>
<a>foo</a>
</div>
)["computed"];
(
<div>
<a>foo</a>
</div>
)["computed"]();
=====================================output=====================================
(<a />).method();
(<a />).property;
(<a />)["computed"];
(<a />)["computed"]();
(
<div>
<a>foo</a>
</div>
).method();
(
<div>
<a>foo</a>
</div>
).property;
(
<div>
<a>foo</a>
</div>
)["computed"];
(
<div>
<a>foo</a>
</div>
)["computed"]();
================================================================================
`;
exports[`not-react.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
/// <reference types="node" />
type ul = any;
const somethingElse = 1;
const thing = <ul>somethingElse;
const div = "<div></div>";
const h1 = \`<h1>Hi</h1>\`;
const footer = '<footer></footer>';
=====================================output=====================================
/// <reference types="node" />
type ul = any;
const somethingElse = 1;
const thing = <ul>somethingElse;
const div = "<div></div>";
const h1 = \`<h1>Hi</h1>\`;
const footer = "<footer></footer>";
================================================================================
`;
exports[`react.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const MyCoolList = ({ things }) =>
<ul>
{things.map(MyCoolThing)}
</ul>;
const MyCoolThing = ({ thingo }) => <li>{thingo}</li>;
=====================================output=====================================
const MyCoolList = ({ things }) => <ul>{things.map(MyCoolThing)}</ul>;
const MyCoolThing = ({ thingo }) => <li>{thingo}</li>;
================================================================================
`;
exports[`this.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
<this.state.Component />;
<this.Component />;
=====================================output=====================================
<this.state.Component />;
<this.Component />;
================================================================================
`;
exports[`type-parameters.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const functionName1 = <T,>(arg) => false;
const functionName2 = <T extends any>(arg) => false;
const functionName3 = <T, S>(arg) => false;
function functionName4<T>() {
return false;
}
functionName5<T>();
interface Interface1<T> {
one: "one";
}
interface Interface2 {
two: Two<T>;
}
type Type1<T> = "type1";
type Type2 = Two<T>;
=====================================output=====================================
const functionName1 = <T,>(arg) => false;
const functionName2 = <T extends any>(arg) => false;
const functionName3 = <T, S>(arg) => false;
function functionName4<T>() {
return false;
}
functionName5<T>();
interface Interface1<T> {
one: "one";
}
interface Interface2 {
two: Two<T>;
}
type Type1<T> = "type1";
type Type2 = Two<T>;
================================================================================
`;
exports[`url.tsx 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const link = <a href="example.com">http://example.com</a>;
const first = <div>http://example.com</div>;
const second = <>http://example.com</>;
const third = <div><br />http://example.com</div>;
const fourth = <div><span></span>http://example.com</div>;
const fifth = <div>{}http://example.com</div>;
=====================================output=====================================
const link = <a href="example.com">http://example.com</a>;
const first = <div>http://example.com</div>;
const second = <>http://example.com</>;
const third = (
<div>
<br />
http://example.com
</div>
);
const fourth = (
<div>
<span></span>http://example.com
</div>
);
const fifth = <div>{}http://example.com</div>;
================================================================================
`;