Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/tests/prettier/__snapshots__/jsfmt.spec.js.snap b/tests/prettier/__snapshots__/jsfmt.spec.js.snap
index 826b40c..5d5ca84 100644
--- a/tests/prettier/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/prettier/__snapshots__/jsfmt.spec.js.snap
@@ -49,19 +49,19 @@ const comp5 = <div>Keep it on one line.</div>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const comp1 = (
<div style={styles} key=\"something\">
- Keep the wrapping parens.
+ Keep the wrapping parens.
</div>
);
const comp2 = (
<div style={styles} key=\"something\">
- Create wrapping parens.
+ Create wrapping parens.
</div>
);
comp2A = (
<div style={styles} key=\"something\">
- Create wrapping parens.
+ Create wrapping parens.
</div>
);
@@ -134,73 +134,67 @@ nest_plz =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
after = (
<span>
- foo{\' \'}
- <span>bar</span>
+ foo <span>bar</span>
</span>
);
before = (
<span>
- <span>bar</span>
- {\' \'}foo
+ <span>bar</span> foo
</span>
);
before_break1 = (
<span>
- <span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar />
- {\' \'}foo
+ <span
+ barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar
+ /> foo
</span>
);
before_break2 = (
<span>
- <span
- barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar
- />
- {\' \'}foo
+ <span
+ barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar
+ /> foo
</span>
);
after_break = (
<span>
- foo{\' \'}
- <span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar />
+ foo <span
+ barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar
+ />
</span>
);
within = (
<span>
- foo{\' \'}
- <span> bar </span>
+ foo <span> bar </span>
</span>
);
break_components = (
<div>
- <Foo />
- <Bar>
- <p>foo<span>bar bar bar</span></p>
- <h1><span><em>yep</em></span></h1>
- </Bar>
- <h2>nope</h2>
+ <Foo />
+ <Bar>
+ <p>foo<span>bar bar bar</span></p><h1><span><em>yep</em></span></h1>
+ </Bar>
+ <h2>nope</h2>
</div>
);
var x = (
<div>
- hello{\' \'}
- <strong>hi</strong>
- {\' \'}
- <foo>sdkflsdfjk</foo>
+ hello <strong>hi</strong> <foo>sdkflsdfjk</foo>
</div>
);
nest_plz = (
<div>
- <div>
- <div />
- </div>
+ <div>
+ <div />
+ </div>
</div>
);
"
@@ -294,18 +288,14 @@ long_open_long_children = (
<div><div attr=\"long\" attr2=\"also long\" attr3=\"gonna break\" /></div>
</div>
</div>
- <div>
- <div>
- <div>
- <div
- attr=\"long\"
- attr2=\"also long\"
- attr3=\"gonna break\"
- attr4=\"hello please break me\"
- />
- </div>
- </div>
- </div>
+ <div><div><div>
+ <div
+ attr=\"long\"
+ attr2=\"also long\"
+ attr3=\"gonna break\"
+ attr4=\"hello please break me\"
+ />
+ </div></div></div>
<BaseForm
url=\"/auth/google\"
method=\"GET\"
@@ -344,26 +334,26 @@ short_closed = <BaseForm url=\"/auth/google\" method=\"GET\" />;
short_open = (
<BaseForm url=\"/auth/google\" method=\"GET\">
- hello
+ hello
</BaseForm>
);
make_self_closing = (
<div>
- <BaseForm
- url=\"/auth/google\"
- method=\"GET\"
- colour=\"blue\"
- size=\"large\"
- submitLabel=\"Sign in with Google\"
- />
- <BaseForm
- url=\"/auth/google\"
- method=\"GET\"
- colour=\"blue\"
- size=\"large\"
- submitLabel=\"Sign in with Google\"
- />
+ <BaseForm
+ url=\"/auth/google\"
+ method=\"GET\"
+ colour=\"blue\"
+ size=\"large\"
+ submitLabel=\"Sign in with Google\"
+ />
+ <BaseForm
+ url=\"/auth/google\"
+ method=\"GET\"
+ colour=\"blue\"
+ size=\"large\"
+ submitLabel=\"Sign in with Google\"
+ />
</div>
);
@@ -435,13 +425,13 @@ const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => this.someLongCallWithParams(a
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const render1 = ({ styles }) => (
<div style={styles} key=\"something\">
- Keep the wrapping parens. Put each key on its own line.
+ Keep the wrapping parens. Put each key on its own line.
</div>
);
const render2 = ({ styles }) => (
<div style={styles} key=\"something\">
- Create wrapping parens.
+ Create wrapping parens.
</div>
);
@@ -461,70 +451,40 @@ const render5 = ({ styles }) => <div>Keep it on one line.</div>;
const render6 = ({ styles }) => (
<div attr1=\"aaaaaaaaaaaaaaaaa\" attr2=\"bbbbbbbbbbb\" attr3=\"cccccccccccc\">
- <div
- attr1=\"aaaaaaaaaaaaaaaaa\"
- attr2=\"bbbbbbbbbbb\"
- attr3=\"cccccccccccc\"
- attr4
- >
- ddd d dd d d dddd dddd{\' \'}
- <strong>hello</strong>
- </div>
- <div
- attr1=\"aaaaaaaaaaaaaaaaa\"
- attr2=\"bbbbbbbbbbb\"
- attr3=\"cccccccccccc\"
- attr4
- >
- ddd d dd d d dddd dddd{\' \'}
- <strong>hello</strong>
- </div>
- <div
- attr1=\"aaaaaaaaaaaaaaaaa\"
- attr2=\"bbbbbbbbbbb\"
- attr3=\"cccccccccccc\"
- attr4
- >
- <div
- attr1=\"aaaaaaaaaaaaaaaaa\"
- attr2=\"bbbbbbbbbbb\"
- attr3=\"cccccccccccc\"
- attr4
- >
- ddd d dd d d dddd dddd{\' \'}
- <strong>hello</strong>
- </div>
- {\' \'}
- <strong>hello</strong>
- </div>
+ <div attr1=\"aaaaaaaaaaaaaaaaa\" attr2=\"bbbbbbbbbbb\" attr3=\"cccccccccccc\" attr4>
+ ddd d dd d d dddd dddd{\' \'}
+ <strong>hello</strong>
+ </div>
+ <div attr1=\"aaaaaaaaaaaaaaaaa\" attr2=\"bbbbbbbbbbb\" attr3=\"cccccccccccc\" attr4>
+ ddd d dd d d dddd dddd{\' \'}
+ <strong>hello</strong>
+ </div>
+ <div attr1=\"aaaaaaaaaaaaaaaaa\" attr2=\"bbbbbbbbbbb\" attr3=\"cccccccccccc\" attr4>
+ <div attr1=\"aaaaaaaaaaaaaaaaa\" attr2=\"bbbbbbbbbbb\" attr3=\"cccccccccccc\" attr4>
+ ddd d dd d d dddd dddd{\' \'}
+ <strong>hello</strong>
+ </div> <strong>hello</strong></div>
</div>
);
const render7 = () => (
<div>
- <span />
- <span>Dont break each elem onto its own line.</span>
- {\' \'}
- <span />
- <div />
- {\' \'}
- <div />
+ <span /><span>Dont break each elem onto its own line.</span> <span />
+ <div /> <div />
</div>
);
const render7A = () => (
<div>
- <div />
- <div />
- <div />
+ <div /><div /><div />
</div>
);
const render7B = () => (
<div>
- <span> <span /> Dont break plz</span>
- <span><span />Dont break plz</span>
- <span>Dont break plz<span /></span>
+ <span> <span /> Dont break plz</span>
+ <span><span />Dont break plz</span>
+ <span>Dont break plz<span /></span>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment