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

350 lines
6.2 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`array.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
| printWidth
=====================================input======================================
function excludeFirstFiveResults([first, second, third, fourth, fifth, ...rest]) {
return rest;
}
function excludeFirstFiveResults([first, second, third, fourth, fifth, ...rest] = DEFAULT_FIVE_RESULTS) {
return rest;
}
function excludeFirstFiveResults([firstResult, secondResult, thirdResult, fourthResult, fifthResult, ...rest] = [1, 2, 3, 4, 5]) {
return rest;
}
function excludeFirstFiveResults([first, second, third, fourth, fifth, ...rest]: Result[]) {
return rest;
}
const excludeFirstFiveResults = ([first, second, third, fourth, fifth, ...rest]) => {
return rest;
}
class A {
excludeFirstFiveResults([first, second, third, fourth, fifth, ...restOfResults]) {
return restOfResults;
}
}
promise.then(([firstResult, secondResult, thirdResult, fourthResult, fifthResult, ...rest]) => {
return rest;
});
=====================================output=====================================
function excludeFirstFiveResults([
first,
second,
third,
fourth,
fifth,
...rest
]) {
return rest;
}
function excludeFirstFiveResults([
first,
second,
third,
fourth,
fifth,
...rest
] = DEFAULT_FIVE_RESULTS) {
return rest;
}
function excludeFirstFiveResults(
[
firstResult,
secondResult,
thirdResult,
fourthResult,
fifthResult,
...rest
] = [1, 2, 3, 4, 5]
) {
return rest;
}
function excludeFirstFiveResults([
first,
second,
third,
fourth,
fifth,
...rest
]: Result[]) {
return rest;
}
const excludeFirstFiveResults = ([
first,
second,
third,
fourth,
fifth,
...rest
]) => {
return rest;
};
class A {
excludeFirstFiveResults([
first,
second,
third,
fourth,
fifth,
...restOfResults
]) {
return restOfResults;
}
}
promise.then(
([
firstResult,
secondResult,
thirdResult,
fourthResult,
fifthResult,
...rest
]) => {
return rest;
}
);
================================================================================
`;
exports[`object.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
| printWidth
=====================================input======================================
function StatelessFunctionalComponent({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items,
}) {
return <div />
}
function StatelessFunctionalComponent({
isActive = true,
onFiltersUpdated = () => null,
onSelect = () => null,
onSubmitAndDeselect = () => null,
onCancel = () => null,
searchFilters = null,
title = '',
items = [],
} = {}) {
return <div />
}
function StatelessFunctionalComponent(
{
isActive,
onFiltersUpdated = () => null,
onSelect = () => null,
onSubmitAndDeselect = () => null,
onCancel = () => null,
searchFilters = null,
title = '',
items = [],
} = {
isActive: true
}
) {
return <div />
}
function StatelessFunctionalComponent({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items,
}: MyType | null | void) {
return <div />
}
const StatelessFunctionalComponent = ({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items,
}: {
isActive: number,
onFiltersUpdated: number,
onSelect: number,
onSubmitAndDeselect: number,
onCancel: number,
searchFilters: number,
title: number,
items: number,
}) => {
return <div />
};
class C {
StatelessFunctionalComponent({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items,
}) {
return <div />
}
}
type T = ({
isActive: number,
onFiltersUpdated: number,
onSelect: number,
onSubmitAndDeselect: number,
onCancel: number,
searchFilters: number,
title: number,
items: number,
}) => void;
const X = (props: {
a: boolean,
}) =>
<A />;
=====================================output=====================================
function StatelessFunctionalComponent({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items
}) {
return <div />;
}
function StatelessFunctionalComponent({
isActive = true,
onFiltersUpdated = () => null,
onSelect = () => null,
onSubmitAndDeselect = () => null,
onCancel = () => null,
searchFilters = null,
title = "",
items = []
} = {}) {
return <div />;
}
function StatelessFunctionalComponent(
{
isActive,
onFiltersUpdated = () => null,
onSelect = () => null,
onSubmitAndDeselect = () => null,
onCancel = () => null,
searchFilters = null,
title = "",
items = []
} = {
isActive: true
}
) {
return <div />;
}
function StatelessFunctionalComponent({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items
}: MyType | null | void) {
return <div />;
}
const StatelessFunctionalComponent = ({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items
}: {
isActive: number,
onFiltersUpdated: number,
onSelect: number,
onSubmitAndDeselect: number,
onCancel: number,
searchFilters: number,
title: number,
items: number
}) => {
return <div />;
};
class C {
StatelessFunctionalComponent({
isActive,
onFiltersUpdated,
onSelect,
onSubmitAndDeselect,
onCancel,
searchFilters,
title,
items
}) {
return <div />;
}
}
type T = ({
isActive: number,
onFiltersUpdated: number,
onSelect: number,
onSubmitAndDeselect: number,
onCancel: number,
searchFilters: number,
title: number,
items: number
}) => void;
const X = (props: { a: boolean }) => <A />;
================================================================================
`;