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

896 lines
18 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`dynamic-import.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
import(
'myreallylongdynamicallyloadedmodulenamemyreallylongdynamicallyloadedmodulename'
);
=====================================output=====================================
import(
"myreallylongdynamicallyloadedmodulenamemyreallylongdynamicallyloadedmodulename"
);
================================================================================
`;
exports[`dynamic-import.js 2`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
import(
'myreallylongdynamicallyloadedmodulenamemyreallylongdynamicallyloadedmodulename'
);
=====================================output=====================================
import(
"myreallylongdynamicallyloadedmodulenamemyreallylongdynamicallyloadedmodulename"
);
================================================================================
`;
exports[`dynamic-import.js 3`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "es5"
| printWidth
=====================================input======================================
import(
'myreallylongdynamicallyloadedmodulenamemyreallylongdynamicallyloadedmodulename'
);
=====================================output=====================================
import(
"myreallylongdynamicallyloadedmodulenamemyreallylongdynamicallyloadedmodulename"
);
================================================================================
`;
exports[`es5.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation( app,
email_id,
email_address,
subject,
html,
reply_to);
return "nothing";
}
=====================================output=====================================
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation(
app,
email_id,
email_address,
subject,
html,
reply_to
);
return "nothing";
}
================================================================================
`;
exports[`es5.js 2`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation( app,
email_id,
email_address,
subject,
html,
reply_to);
return "nothing";
}
=====================================output=====================================
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to,
) {
send_single_email_implementation(
app,
email_id,
email_address,
subject,
html,
reply_to,
);
return "nothing";
}
================================================================================
`;
exports[`es5.js 3`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "es5"
| printWidth
=====================================input======================================
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation( app,
email_id,
email_address,
subject,
html,
reply_to);
return "nothing";
}
=====================================output=====================================
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation(
app,
email_id,
email_address,
subject,
html,
reply_to
);
return "nothing";
}
================================================================================
`;
exports[`function-calls.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const a = (param1, param2, param3) => {}
a('value', 'value2', 'value3');
a(
'a-long-value',
'a-really-really-long-value',
'a-really-really-really-long-value',
);
a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3'));
a.b().c(
{
d,
},
() => {}
);
=====================================output=====================================
const a = (param1, param2, param3) => {};
a("value", "value2", "value3");
a(
"a-long-value",
"a-really-really-long-value",
"a-really-really-really-long-value"
);
a(
"value",
"value2",
a("long-nested-value", "long-nested-value2", "long-nested-value3")
);
a.b().c(
{
d
},
() => {}
);
================================================================================
`;
exports[`function-calls.js 2`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
const a = (param1, param2, param3) => {}
a('value', 'value2', 'value3');
a(
'a-long-value',
'a-really-really-long-value',
'a-really-really-really-long-value',
);
a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3'));
a.b().c(
{
d,
},
() => {}
);
=====================================output=====================================
const a = (param1, param2, param3) => {};
a("value", "value2", "value3");
a(
"a-long-value",
"a-really-really-long-value",
"a-really-really-really-long-value",
);
a(
"value",
"value2",
a("long-nested-value", "long-nested-value2", "long-nested-value3"),
);
a.b().c(
{
d,
},
() => {},
);
================================================================================
`;
exports[`function-calls.js 3`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "es5"
| printWidth
=====================================input======================================
const a = (param1, param2, param3) => {}
a('value', 'value2', 'value3');
a(
'a-long-value',
'a-really-really-long-value',
'a-really-really-really-long-value',
);
a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3'));
a.b().c(
{
d,
},
() => {}
);
=====================================output=====================================
const a = (param1, param2, param3) => {};
a("value", "value2", "value3");
a(
"a-long-value",
"a-really-really-long-value",
"a-really-really-really-long-value"
);
a(
"value",
"value2",
a("long-nested-value", "long-nested-value2", "long-nested-value3")
);
a.b().c(
{
d,
},
() => {}
);
================================================================================
`;
exports[`jsx.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
<div
onClick={() =>
doSomething({
foo: bar
})
}
/>;
=====================================output=====================================
<div
onClick={() =>
doSomething({
foo: bar
})
}
/>;
================================================================================
`;
exports[`jsx.js 2`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
<div
onClick={() =>
doSomething({
foo: bar
})
}
/>;
=====================================output=====================================
<div
onClick={() =>
doSomething({
foo: bar,
})
}
/>;
================================================================================
`;
exports[`jsx.js 3`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "es5"
| printWidth
=====================================input======================================
<div
onClick={() =>
doSomething({
foo: bar
})
}
/>;
=====================================output=====================================
<div
onClick={() =>
doSomething({
foo: bar,
})
}
/>;
================================================================================
`;
exports[`object.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const a = {
b: true,
c: {
c1: 'hello'
},
d: false
};
const aLong = {
bHasALongName: 'a-long-value',
cHasALongName: {
c1: 'a-really-long-value',
c2: 'a-really-really-long-value',
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};
=====================================output=====================================
const a = {
b: true,
c: {
c1: "hello"
},
d: false
};
const aLong = {
bHasALongName: "a-long-value",
cHasALongName: {
c1: "a-really-long-value",
c2: "a-really-really-long-value"
},
dHasALongName: "a-long-value-too"
};
const aLong = {
dHasALongName: "a-long-value-too",
eHasABooleanExpression: a === a
};
================================================================================
`;
exports[`object.js 2`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
const a = {
b: true,
c: {
c1: 'hello'
},
d: false
};
const aLong = {
bHasALongName: 'a-long-value',
cHasALongName: {
c1: 'a-really-long-value',
c2: 'a-really-really-long-value',
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};
=====================================output=====================================
const a = {
b: true,
c: {
c1: "hello",
},
d: false,
};
const aLong = {
bHasALongName: "a-long-value",
cHasALongName: {
c1: "a-really-long-value",
c2: "a-really-really-long-value",
},
dHasALongName: "a-long-value-too",
};
const aLong = {
dHasALongName: "a-long-value-too",
eHasABooleanExpression: a === a,
};
================================================================================
`;
exports[`object.js 3`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "es5"
| printWidth
=====================================input======================================
const a = {
b: true,
c: {
c1: 'hello'
},
d: false
};
const aLong = {
bHasALongName: 'a-long-value',
cHasALongName: {
c1: 'a-really-long-value',
c2: 'a-really-really-long-value',
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};
=====================================output=====================================
const a = {
b: true,
c: {
c1: "hello",
},
d: false,
};
const aLong = {
bHasALongName: "a-long-value",
cHasALongName: {
c1: "a-really-long-value",
c2: "a-really-really-long-value",
},
dHasALongName: "a-long-value-too",
};
const aLong = {
dHasALongName: "a-long-value-too",
eHasABooleanExpression: a === a,
};
================================================================================
`;
exports[`trailing_whitespace.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
let example = [
'FOO',
'BAR',
// Comment
];
foo({},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a
}
this.getAttribute(function(s)
/*string*/ {
console.log()
});
this.getAttribute(function(s) /*string*/ {
console.log()
});
=====================================output=====================================
let example = [
"FOO",
"BAR"
// Comment
];
foo(
{}
// Comment
);
o = {
state
// Comment
};
o = {
state
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a;
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a;
}
this.getAttribute(function(s) /*string*/ {
console.log();
});
this.getAttribute(function(s) /*string*/ {
console.log();
});
================================================================================
`;
exports[`trailing_whitespace.js 2`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
let example = [
'FOO',
'BAR',
// Comment
];
foo({},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a
}
this.getAttribute(function(s)
/*string*/ {
console.log()
});
this.getAttribute(function(s) /*string*/ {
console.log()
});
=====================================output=====================================
let example = [
"FOO",
"BAR",
// Comment
];
foo(
{},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a;
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a;
}
this.getAttribute(function(s) /*string*/ {
console.log();
});
this.getAttribute(function(s) /*string*/ {
console.log();
});
================================================================================
`;
exports[`trailing_whitespace.js 3`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
trailingComma: "es5"
| printWidth
=====================================input======================================
let example = [
'FOO',
'BAR',
// Comment
];
foo({},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a
}
this.getAttribute(function(s)
/*string*/ {
console.log()
});
this.getAttribute(function(s) /*string*/ {
console.log()
});
=====================================output=====================================
let example = [
"FOO",
"BAR",
// Comment
];
foo(
{}
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a;
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a;
}
this.getAttribute(function(s) /*string*/ {
console.log();
});
this.getAttribute(function(s) /*string*/ {
console.log();
});
================================================================================
`;