// Single string attribute
;
// Not single string because of the new line
a =
;
// Inline
a = ;
// IndentAttributes
a = ;
// Empty
a =
;
<>
>;
// Not empty
a =
;
// Template
a = {`A Long Tempalte String That uses ${5 + 4} that will eventually break across multiple lines ${40 / 3 * 45}`}
;
// Meaningful text after self closing element adds a hard line break
a = ;
// Meaningful text after a non-self closing element should add a soft line break
b = a = ;
// A word right before a self-closing element inserts a hard line break
a = ab
;
// A Word not right before a self-closing element inserts a soft line break.
a = ;
// whitespaces
c = a{' '}{' '}{' '}{' '}{' '}{' '}{' '}{' '}b{' '}{' '}{' '}{' '}{' '}{' '}
;
c2 = a{' '}{' '}{' '}{' '}{' '}{' '}{' '}{' '}
content{' '}{' '}{' '}{' '}{' '}{' '}
;
// this group should fit one line jsx whitespaces are hidden
b =
;
// this group should break first tag and show only first jsx whitespace
b1 =
;
// this group fit one line and hide jsx whitespace
b2 =
<>
123
{' '}
1
>;
// this group break group and show jsx whitespace
b3 =
<>
{`
123`}
{' '}
1
>;
const b4 = ;
b5 =
long text long text long text long text long text long text long text long text url long text long text
;
;
const Essay = () => The films of Wong Kar-Wai exemplify the synthesis of French New Wave cinema—specifically the unrelenting
experimental technique and fascination with American/western culture—with more conventional melodramatic, romantic narratives.
;
function Tabs() {
return
Input
Settings
Formatter Output
CST
AST
Rome IR
Prettier IR
Errors
{
setPlaygroundState((state) => ({
...state,
code: evn.target.value,
}));
}}
style={{
fontSize: 12,
height: "100vh",
fontFamily:
"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",
}}
/>
Rome
Prettier
{formatter_ir}
{prettierOutput.ir}
{errors}
;
}
function LoginForm() {
return
}
function MapoTofuRecipe() {
return
Mapo tofu recipe
2 packets soft or silken tofu
1 tablespoon minced garlic
1 tablespoon minced ginger
2 tablespoons doubanjiang
1 tablespoon douchi
1 tablespoon corn or potato starch
2 scallions or jiu cai
6 ounces of ground beef or pork
}
} />;
let component = La Haine dir. Mathieu Kassovitz
;
let component = (
Uncle Boonmee Who Can Recall His Past Lives dir. Apichatpong Weerasethakul
);
(Badlands
).property;
let bar =
{foo(() =>
the quick brown fox jumps over the lazy dog and then jumps over the lazy cat and then over the lazy fish.
)}
;
;
// spacing
let a = {' '}
let b = {" "}
// comments
let a = { /* comment */ " " /* comment */ } ;
let a = { " "
/* comment */ } ;
let a = { /* comment */ " " } ;
// in array
const breadcrumbItems = [
(
Home
),
].concat(extraBreadcrumbItems);
function Component() {
return (
);
}
let b = (
);
let a = (
*comment3*/Test
// comment before attribute
/*comment1*/prop/*comment2*/=/*comment3*/{/*comment4*/value /*comment5*/}/*comment6*/
// comment after attribute
>
);
function Component() {
return (
{fn(data)}{' '}
);
}
// jsx whitespace {' '} adds meaningful jsx text
function Component() {
return (
{fn(datadatadatadatadatadatadatadatadatadatadatadatadatadatadatadata)}{' '}
);
}
// not jsx whitespace doesn't add meaningful jsx text
function Component() {
return (
{fn(datadatadatadatadatadatadatadatadatadatadatadatadatadatadatadata)}{' '}
);
}