Move non-js syntax test out of tests/js/ dir (#9023)
This commit is contained in:
1 parent
ca68cbe731
commit
08e8b40ac6
111 files changed
+3030
-2140
No files matched your search
@@ -0,0 +1,135 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`array.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function excludeFirstFiveResults4([first, second, third, fourth, fifth, ...rest]: Result[]) {
|
||||
return rest;
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
function excludeFirstFiveResults4([
|
||||
first,
|
||||
second,
|
||||
third,
|
||||
fourth,
|
||||
fifth,
|
||||
...rest
|
||||
]: Result[]) {
|
||||
return rest;
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`object.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function StatelessFunctionalComponent4({
|
||||
isActive,
|
||||
onFiltersUpdated,
|
||||
onSelect,
|
||||
onSubmitAndDeselect,
|
||||
onCancel,
|
||||
searchFilters,
|
||||
title,
|
||||
items,
|
||||
}: MyType | null | void) {
|
||||
return <div />
|
||||
}
|
||||
|
||||
const StatelessFunctionalComponent5 = ({
|
||||
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 />
|
||||
};
|
||||
|
||||
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 StatelessFunctionalComponent4({
|
||||
isActive,
|
||||
onFiltersUpdated,
|
||||
onSelect,
|
||||
onSubmitAndDeselect,
|
||||
onCancel,
|
||||
searchFilters,
|
||||
title,
|
||||
items,
|
||||
}: MyType | null | void) {
|
||||
return <div />;
|
||||
}
|
||||
|
||||
const StatelessFunctionalComponent5 = ({
|
||||
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 />;
|
||||
};
|
||||
|
||||
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 />;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,3 @@
|
||||
function excludeFirstFiveResults4([first, second, third, fourth, fifth, ...rest]: Result[]) {
|
||||
return rest;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
@@ -0,0 +1,50 @@
|
||||
function StatelessFunctionalComponent4({
|
||||
isActive,
|
||||
onFiltersUpdated,
|
||||
onSelect,
|
||||
onSubmitAndDeselect,
|
||||
onCancel,
|
||||
searchFilters,
|
||||
title,
|
||||
items,
|
||||
}: MyType | null | void) {
|
||||
return <div />
|
||||
}
|
||||
|
||||
const StatelessFunctionalComponent5 = ({
|
||||
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 />
|
||||
};
|
||||
|
||||
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 />;
|
||||
@@ -0,0 +1,36 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`ignore.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function a() {
|
||||
// Incorrectly indented on purpose
|
||||
function f</* prettier-ignore */ T : B>(
|
||||
a : Array < number > // prettier-ignore
|
||||
) {
|
||||
|
||||
call(
|
||||
f( 1 )
|
||||
// prettier-ignore
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
function a() {
|
||||
// Incorrectly indented on purpose
|
||||
function f</* prettier-ignore */ T : B>(
|
||||
a : Array < number > // prettier-ignore
|
||||
) {
|
||||
call(
|
||||
f( 1 )
|
||||
// prettier-ignore
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,12 @@
|
||||
function a() {
|
||||
// Incorrectly indented on purpose
|
||||
function f</* prettier-ignore */ T : B>(
|
||||
a : Array < number > // prettier-ignore
|
||||
) {
|
||||
|
||||
call(
|
||||
f( 1 )
|
||||
// prettier-ignore
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
@@ -0,0 +1,282 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`comments.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
let error = new Error(response.statusText);
|
||||
// comment
|
||||
(error: any).response = response
|
||||
|
||||
x;
|
||||
|
||||
/* comment */ (error: any).response = response
|
||||
|
||||
x;
|
||||
|
||||
(error: any).response = response; /* comment */
|
||||
|
||||
=====================================output=====================================
|
||||
let error = new Error(response.statusText)
|
||||
// comment
|
||||
;(error: any).response = response
|
||||
|
||||
x
|
||||
|
||||
/* comment */ ;(error: any).response = response
|
||||
|
||||
x
|
||||
|
||||
;(error: any).response = response /* comment */
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`comments.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
let error = new Error(response.statusText);
|
||||
// comment
|
||||
(error: any).response = response
|
||||
|
||||
x;
|
||||
|
||||
/* comment */ (error: any).response = response
|
||||
|
||||
x;
|
||||
|
||||
(error: any).response = response; /* comment */
|
||||
|
||||
=====================================output=====================================
|
||||
let error = new Error(response.statusText);
|
||||
// comment
|
||||
(error: any).response = response;
|
||||
|
||||
x;
|
||||
|
||||
/* comment */ (error: any).response = response;
|
||||
|
||||
x;
|
||||
|
||||
(error: any).response = response; /* comment */
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`flow-interfaces.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
declare class A {
|
||||
one: boolean;
|
||||
two: { three: string }
|
||||
| number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare class B {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
declare interface C {
|
||||
one: boolean;
|
||||
two: { three: string }
|
||||
| number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare interface D {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
interface E {
|
||||
one: boolean;
|
||||
two: { three: string }
|
||||
| number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// interface F {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
=====================================output=====================================
|
||||
declare class A {
|
||||
one: boolean;
|
||||
two: { three: string } | number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare class B {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
declare interface C {
|
||||
one: boolean;
|
||||
two: { three: string } | number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare interface D {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
interface E {
|
||||
one: boolean;
|
||||
two: { three: string } | number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// interface F {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`flow-interfaces.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
declare class A {
|
||||
one: boolean;
|
||||
two: { three: string }
|
||||
| number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare class B {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
declare interface C {
|
||||
one: boolean;
|
||||
two: { three: string }
|
||||
| number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare interface D {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
interface E {
|
||||
one: boolean;
|
||||
two: { three: string }
|
||||
| number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// interface F {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
=====================================output=====================================
|
||||
declare class A {
|
||||
one: boolean;
|
||||
two: { three: string } | number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare class B {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
declare interface C {
|
||||
one: boolean;
|
||||
two: { three: string } | number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// declare interface D {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
interface E {
|
||||
one: boolean;
|
||||
two: { three: string } | number;
|
||||
}
|
||||
|
||||
// NOTE: Flow and Babel both fail to apply ASI here
|
||||
// interface F {
|
||||
// one: boolean
|
||||
// two: { three: string }
|
||||
// | number
|
||||
// }
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`no-semi.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
// flow
|
||||
|
||||
(x: void);
|
||||
(y: void)
|
||||
|
||||
=====================================output=====================================
|
||||
// flow
|
||||
|
||||
;(x: void)
|
||||
;(y: void)
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`no-semi.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
// flow
|
||||
|
||||
(x: void);
|
||||
(y: void)
|
||||
|
||||
=====================================output=====================================
|
||||
// flow
|
||||
|
||||
(x: void);
|
||||
(y: void);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,11 @@
|
||||
let error = new Error(response.statusText);
|
||||
// comment
|
||||
(error: any).response = response
|
||||
|
||||
x;
|
||||
|
||||
/* comment */ (error: any).response = response
|
||||
|
||||
x;
|
||||
|
||||
(error: any).response = response; /* comment */
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
run_spec(__dirname, ["flow", "babel"], { semi: false });
|
||||
@@ -0,0 +1,4 @@
|
||||
// flow
|
||||
|
||||
(x: void);
|
||||
(y: void)
|
||||
@@ -0,0 +1,48 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`comment.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
o = {
|
||||
name:
|
||||
// Comment A
|
||||
// Comment B
|
||||
(({id: type}: any): CreativeConcept),
|
||||
};
|
||||
|
||||
o = {
|
||||
name: // Comment A
|
||||
// Comment B
|
||||
(({ id: type }: any): CreativeConcept)
|
||||
};
|
||||
|
||||
o = {
|
||||
name: // Comment B // Comment A
|
||||
(({ id: type }: any): CreativeConcept)
|
||||
};
|
||||
|
||||
=====================================output=====================================
|
||||
o = {
|
||||
name:
|
||||
// Comment A
|
||||
// Comment B
|
||||
(({ id: type }: any): CreativeConcept),
|
||||
};
|
||||
|
||||
o = {
|
||||
// Comment A
|
||||
name:
|
||||
// Comment B
|
||||
(({ id: type }: any): CreativeConcept),
|
||||
};
|
||||
|
||||
o = {
|
||||
// Comment B // Comment A
|
||||
name: (({ id: type }: any): CreativeConcept),
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
@@ -0,0 +1,65 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`inline.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
=====================================output=====================================
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean,
|
||||
} => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean,
|
||||
} =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
(someLong: boolean, t: boolean) => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(someLong: boolean, t: boolean) =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,29 @@
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} => `
|
||||
a
|
||||
`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} =>
|
||||
`
|
||||
a
|
||||
`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) => `
|
||||
a
|
||||
`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) =>
|
||||
`
|
||||
a
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
@@ -33,7 +33,6 @@ x => ({}()())
|
||||
x => ({}()\`\`)
|
||||
x => ({}().b);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
x => (y = z);
|
||||
x => (y += z);
|
||||
f(a => ({})) + 1;
|
||||
@@ -71,7 +70,6 @@ a = () => ({}, a);
|
||||
(x) => ({}()\`\`);
|
||||
(x) => ({}().b);
|
||||
a = (b) => c;
|
||||
a = (b?) => c;
|
||||
(x) => (y = z);
|
||||
(x) => (y += z);
|
||||
f((a) => ({})) + 1;
|
||||
@@ -117,7 +115,6 @@ x => ({}()())
|
||||
x => ({}()\`\`)
|
||||
x => ({}().b);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
x => (y = z);
|
||||
x => (y += z);
|
||||
f(a => ({})) + 1;
|
||||
@@ -155,7 +152,6 @@ x => ({}()());
|
||||
x => ({}()\`\`);
|
||||
x => ({}().b);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
x => (y = z);
|
||||
x => (y += z);
|
||||
f(a => ({})) + 1;
|
||||
@@ -2217,83 +2213,3 @@ foo(a => b, d);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`short_body.js - {"arrowParens":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean,
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
=====================================output=====================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`short_body.js - {"arrowParens":"avoid"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean,
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
=====================================output=====================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`type_params.js - {"arrowParens":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<T>(a) => { }
|
||||
|
||||
=====================================output=====================================
|
||||
<T>(a) => {};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`type_params.js - {"arrowParens":"avoid"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<T>(a) => { }
|
||||
|
||||
=====================================output=====================================
|
||||
<T>(a) => {};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -24,7 +24,6 @@ x => ({}()())
|
||||
x => ({}()``)
|
||||
x => ({}().b);
|
||||
a = b => c;
|
||||
a = (b?) => c;
|
||||
x => (y = z);
|
||||
x => (y += z);
|
||||
f(a => ({})) + 1;
|
||||
|
||||
@@ -1,254 +1,26 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`class-implements.js format 1`] = `
|
||||
exports[`class-property.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class a1 extends b // comment
|
||||
implements z
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a2 extends b implements z { // comment
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a3 extends b
|
||||
implements
|
||||
// comment
|
||||
z,
|
||||
y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a4 extends b
|
||||
implements z, // comment
|
||||
y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a5 extends b implements
|
||||
z, // comment-z
|
||||
y // comment-y
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a6 extends b implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a7 extends b implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
// comment-y3
|
||||
{
|
||||
//comment-body
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a8 extends b // comment-b
|
||||
implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a9 extends
|
||||
// comment-b1
|
||||
b // comment-b2
|
||||
// comment-b3
|
||||
implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
{
|
||||
constructor() {}
|
||||
class X {
|
||||
TEMPLATE =
|
||||
// tab index is needed so we can focus, which is needed for keyboard events
|
||||
'<div class="ag-large-text" tabindex="0">' +
|
||||
'<div class="ag-large-textarea"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class a1
|
||||
extends b // comment
|
||||
implements z {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a2 extends b implements z {
|
||||
// comment
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a3
|
||||
extends b
|
||||
// comment
|
||||
implements z, y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a4
|
||||
extends b
|
||||
implements
|
||||
z, // comment
|
||||
y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a5
|
||||
extends b
|
||||
implements
|
||||
z, // comment-z
|
||||
y {
|
||||
// comment-y
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a6
|
||||
extends b
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a7
|
||||
extends b
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
// comment-y3
|
||||
//comment-body
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a8
|
||||
extends b // comment-b
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a9
|
||||
// comment-b1
|
||||
extends b // comment-b2
|
||||
// comment-b3
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`declare.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
declare class a // 1
|
||||
// extends b // 2
|
||||
implements z,x // 3
|
||||
{
|
||||
doo:boolean
|
||||
}
|
||||
|
||||
declare class A1<T> // 1
|
||||
// 2
|
||||
extends B<T> // 3
|
||||
{}
|
||||
|
||||
=====================================output=====================================
|
||||
declare class a // 1
|
||||
// extends b // 2
|
||||
implements z, x {
|
||||
// 3
|
||||
doo: boolean;
|
||||
}
|
||||
|
||||
declare class A1<T> // 1
|
||||
// 2
|
||||
extends B<T> {
|
||||
// 3
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`generic.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class G1<T> implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G2 // g2
|
||||
<T> implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G3 // g3
|
||||
<T> extends U implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G4<T // g4
|
||||
> extends U implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class G1<T> implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G2<T> // g2
|
||||
implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G3<T> // g3
|
||||
extends U
|
||||
implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G4<
|
||||
T // g4
|
||||
>
|
||||
extends U
|
||||
implements IPoly<T> {
|
||||
x: T;
|
||||
class X {
|
||||
TEMPLATE =
|
||||
// tab index is needed so we can focus, which is needed for keyboard events
|
||||
'<div class="ag-large-text" tabindex="0">' +
|
||||
'<div class="ag-large-textarea"></div>' +
|
||||
"</div>";
|
||||
}
|
||||
|
||||
================================================================================
|
||||
@@ -267,22 +39,6 @@ class x {
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
TEMPLATE =
|
||||
// tab index is needed so we can focus, which is needed for keyboard events
|
||||
'<div class="ag-large-text" tabindex="0">' +
|
||||
'<div class="ag-large-textarea"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
export class SnapshotLogger {
|
||||
constructor(
|
||||
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||
snapshotInterval: number = 30 * 1000, // snapshot no more than every 30s
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class x {
|
||||
focus() { // comment 1
|
||||
@@ -290,21 +46,6 @@ class x {
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
TEMPLATE =
|
||||
// tab index is needed so we can focus, which is needed for keyboard events
|
||||
'<div class="ag-large-text" tabindex="0">' +
|
||||
'<div class="ag-large-textarea"></div>' +
|
||||
"</div>";
|
||||
}
|
||||
|
||||
export class SnapshotLogger {
|
||||
constructor(
|
||||
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||
snapshotInterval: number = 30 * 1000 // snapshot no more than every 30s
|
||||
) {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class X {
|
||||
TEMPLATE =
|
||||
// tab index is needed so we can focus, which is needed for keyboard events
|
||||
'<div class="ag-large-text" tabindex="0">' +
|
||||
'<div class="ag-large-textarea"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
@@ -4,19 +4,3 @@ class x {
|
||||
// comment 2
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
TEMPLATE =
|
||||
// tab index is needed so we can focus, which is needed for keyboard events
|
||||
'<div class="ag-large-text" tabindex="0">' +
|
||||
'<div class="ag-large-textarea"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
export class SnapshotLogger {
|
||||
constructor(
|
||||
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||
snapshotInterval: number = 30 * 1000, // snapshot no more than every 30s
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -20,96 +20,6 @@ printWidth: 80
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`break.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class MyContractSelectionWidget extends React.Component<void, MyContractSelectionWidgetPropsType, void> implements SomethingLarge {
|
||||
method() {}
|
||||
}
|
||||
|
||||
class DisplayObject1
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {
|
||||
}
|
||||
|
||||
class DisplayObject2 extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {
|
||||
}
|
||||
|
||||
class DisplayObject3 extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget,
|
||||
somethingElse_SomeOtherThing,
|
||||
somethingElseAgain_RunningOutOfNames {
|
||||
}
|
||||
|
||||
class DisplayObject4 extends utils.EventEmitter implements interaction_InteractiveTarget {}
|
||||
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
|
||||
class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}
|
||||
|
||||
class Foo extends Immutable.Record({
|
||||
ipaddress: '',
|
||||
}) {
|
||||
ipaddress: string;
|
||||
}
|
||||
|
||||
export class VisTimelineComponent
|
||||
implements AfterViewInit, OnChanges, OnDestroy {
|
||||
}
|
||||
export class VisTimelineComponent2
|
||||
implements AfterViewInit, OnChanges, OnDestroy, AndSomethingReallyReallyLong {
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class MyContractSelectionWidget
|
||||
extends React.Component<void, MyContractSelectionWidgetPropsType, void>
|
||||
implements SomethingLarge {
|
||||
method() {}
|
||||
}
|
||||
|
||||
class DisplayObject1
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {}
|
||||
|
||||
class DisplayObject2
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {}
|
||||
|
||||
class DisplayObject3
|
||||
extends utils.EventEmitter
|
||||
implements
|
||||
interaction_InteractiveTarget,
|
||||
somethingElse_SomeOtherThing,
|
||||
somethingElseAgain_RunningOutOfNames {}
|
||||
|
||||
class DisplayObject4
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {}
|
||||
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
|
||||
class InMemoryAppender
|
||||
extends log4javascript.Appender
|
||||
implements ICachedLogMessageProvider {}
|
||||
|
||||
class Foo extends Immutable.Record({
|
||||
ipaddress: "",
|
||||
}) {
|
||||
ipaddress: string;
|
||||
}
|
||||
|
||||
export class VisTimelineComponent
|
||||
implements AfterViewInit, OnChanges, OnDestroy {}
|
||||
export class VisTimelineComponent2
|
||||
implements
|
||||
AfterViewInit,
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
AndSomethingReallyReallyLong {}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`call.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
|
||||
@@ -1158,8 +1158,6 @@ function d() {
|
||||
}
|
||||
new Thing(/* dangling */);
|
||||
Thing(/* dangling */);
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {/* dangling */}
|
||||
export /* dangling */{};
|
||||
|
||||
=====================================output=====================================
|
||||
@@ -1177,10 +1175,6 @@ function d() {
|
||||
}
|
||||
new Thing(/* dangling */)
|
||||
Thing(/* dangling */)
|
||||
Thing?.(/* dangling */)
|
||||
declare class Foo extends Qux<string> {
|
||||
/* dangling */
|
||||
}
|
||||
export /* dangling */{}
|
||||
|
||||
================================================================================
|
||||
@@ -1202,8 +1196,6 @@ function d() {
|
||||
}
|
||||
new Thing(/* dangling */);
|
||||
Thing(/* dangling */);
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {/* dangling */}
|
||||
export /* dangling */{};
|
||||
|
||||
=====================================output=====================================
|
||||
@@ -1221,10 +1213,6 @@ function d() {
|
||||
}
|
||||
new Thing(/* dangling */);
|
||||
Thing(/* dangling */);
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {
|
||||
/* dangling */
|
||||
}
|
||||
export /* dangling */{};
|
||||
|
||||
================================================================================
|
||||
@@ -2174,12 +2162,6 @@ semi: false
|
||||
// Does not need to break as it fits in 80 columns
|
||||
this.call(a, /* comment */ b);
|
||||
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType,
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
// Comments should either stay at the end of the line or always before, but
|
||||
// not one before and one after.
|
||||
throw new ProcessSystemError({
|
||||
@@ -2253,12 +2235,6 @@ foo({}
|
||||
// Does not need to break as it fits in 80 columns
|
||||
this.call(a, /* comment */ b)
|
||||
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
// Comments should either stay at the end of the line or always before, but
|
||||
// not one before and one after.
|
||||
throw new ProcessSystemError({
|
||||
@@ -2337,12 +2313,6 @@ printWidth: 80
|
||||
// Does not need to break as it fits in 80 columns
|
||||
this.call(a, /* comment */ b);
|
||||
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType,
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
// Comments should either stay at the end of the line or always before, but
|
||||
// not one before and one after.
|
||||
throw new ProcessSystemError({
|
||||
@@ -2416,12 +2386,6 @@ foo({}
|
||||
// Does not need to break as it fits in 80 columns
|
||||
this.call(a, /* comment */ b);
|
||||
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
// Comments should either stay at the end of the line or always before, but
|
||||
// not one before and one after.
|
||||
throw new ProcessSystemError({
|
||||
@@ -3108,59 +3072,6 @@ printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type f1 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ['unknown']
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
a(lol /*string*/) {}
|
||||
@@ -3204,58 +3115,6 @@ class Foo {
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
type f1 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number
|
||||
|
||||
f2 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {}
|
||||
|
||||
f3 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {}
|
||||
|
||||
f4 = function (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {},
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ["unknown"]
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
a(lol /*string*/) {}
|
||||
|
||||
@@ -3300,59 +3159,6 @@ parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type f1 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ['unknown']
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
a(lol /*string*/) {}
|
||||
@@ -3396,58 +3202,6 @@ class Foo {
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
type f1 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {},
|
||||
};
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ["unknown"]
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
a(lol /*string*/) {}
|
||||
|
||||
|
||||
@@ -8,6 +8,4 @@ function d() {
|
||||
}
|
||||
new Thing(/* dangling */);
|
||||
Thing(/* dangling */);
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {/* dangling */}
|
||||
export /* dangling */{};
|
||||
@@ -1,12 +1,6 @@
|
||||
// Does not need to break as it fits in 80 columns
|
||||
this.call(a, /* comment */ b);
|
||||
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType,
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
// Comments should either stay at the end of the line or always before, but
|
||||
// not one before and one after.
|
||||
throw new ProcessSystemError({
|
||||
|
||||
@@ -1,56 +1,3 @@
|
||||
type f1 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ['unknown']
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
a(lol /*string*/) {}
|
||||
|
||||
@@ -25,6 +25,36 @@ class x {
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`class-property.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class Foo {
|
||||
f(/* ... */) {}
|
||||
f() /* ... */ {}
|
||||
f = (/* ... */) => {};
|
||||
static f(/* ... */) {};
|
||||
static f = (/* ... */) => {};
|
||||
static f = function(/* ... */) {};
|
||||
static f = function f(/* ... */) {};
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class Foo {
|
||||
f(/* ... */) {}
|
||||
f() /* ... */ {}
|
||||
f = (/* ... */) => {};
|
||||
static f(/* ... */) {}
|
||||
static f = (/* ... */) => {};
|
||||
static f = function (/* ... */) {};
|
||||
static f = function f(/* ... */) {};
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`empty_paren_comment.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
@@ -42,16 +72,6 @@ const obj = {
|
||||
f: function f(/* ... */) {}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
f(/* ... */) {}
|
||||
f() /* ... */ {}
|
||||
f = (/* ... */) => {};
|
||||
static f(/* ... */) {};
|
||||
static f = (/* ... */) => {};
|
||||
static f = function(/* ... */) {};
|
||||
static f = function f(/* ... */) {};
|
||||
}
|
||||
|
||||
f(/* ... */);
|
||||
f(a, /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
@@ -72,16 +92,6 @@ const obj = {
|
||||
f: function f(/* ... */) {},
|
||||
};
|
||||
|
||||
class Foo {
|
||||
f(/* ... */) {}
|
||||
f() /* ... */ {}
|
||||
f = (/* ... */) => {};
|
||||
static f(/* ... */) {}
|
||||
static f = (/* ... */) => {};
|
||||
static f = function (/* ... */) {};
|
||||
static f = function f(/* ... */) {};
|
||||
}
|
||||
|
||||
f(/* ... */);
|
||||
f(a /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
f(/* ... */) {}
|
||||
f() /* ... */ {}
|
||||
f = (/* ... */) => {};
|
||||
static f(/* ... */) {};
|
||||
static f = (/* ... */) => {};
|
||||
static f = function(/* ... */) {};
|
||||
static f = function f(/* ... */) {};
|
||||
}
|
||||
@@ -9,16 +9,6 @@ const obj = {
|
||||
f: function f(/* ... */) {}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
f(/* ... */) {}
|
||||
f() /* ... */ {}
|
||||
f = (/* ... */) => {};
|
||||
static f(/* ... */) {};
|
||||
static f = (/* ... */) => {};
|
||||
static f = function(/* ... */) {};
|
||||
static f = function f(/* ... */) {};
|
||||
}
|
||||
|
||||
f(/* ... */);
|
||||
f(a, /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
|
||||
@@ -56,180 +56,3 @@ function f() {<LF>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`multiline.js - {"endOfLine":"cr"} format 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "cr"
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
'Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string'<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
=====================================output=====================================
|
||||
type IAmIncredibleLongParameterType = {};<CR>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<CR>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CR>
|
||||
(_0: IAmIncredibleLongParameterType) => {<CR>
|
||||
setTimeout(() => {<CR>
|
||||
/*<CR>
|
||||
Multiline comment<CR>
|
||||
Multiline comment<CR>
|
||||
Multiline comment<CR>
|
||||
*/<CR>
|
||||
console.log(<CR>
|
||||
"Multiline string\\<CR>
|
||||
Multiline string\\<CR>
|
||||
Multiline string"<CR>
|
||||
);<CR>
|
||||
console.log(<CR>
|
||||
\`Multiline \\n string\\<CR>
|
||||
Multiline string\\<CR>
|
||||
Multiline string\`<CR>
|
||||
);<CR>
|
||||
});<CR>
|
||||
}<CR>
|
||||
);<CR>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`multiline.js - {"endOfLine":"crlf"} format 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "crlf"
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
'Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string'<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
=====================================output=====================================
|
||||
type IAmIncredibleLongParameterType = {};<CRLF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<CRLF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CRLF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<CRLF>
|
||||
setTimeout(() => {<CRLF>
|
||||
/*<CRLF>
|
||||
Multiline comment<CRLF>
|
||||
Multiline comment<CRLF>
|
||||
Multiline comment<CRLF>
|
||||
*/<CRLF>
|
||||
console.log(<CRLF>
|
||||
"Multiline string\\<CRLF>
|
||||
Multiline string\\<CRLF>
|
||||
Multiline string"<CRLF>
|
||||
);<CRLF>
|
||||
console.log(<CRLF>
|
||||
\`Multiline \\n string\\<CRLF>
|
||||
Multiline string\\<CRLF>
|
||||
Multiline string\`<CRLF>
|
||||
);<CRLF>
|
||||
});<CRLF>
|
||||
}<CRLF>
|
||||
);<CRLF>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`multiline.js - {"endOfLine":"lf"} format 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "lf"
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
'Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string'<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
=====================================output=====================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
"Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string"<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -18,10 +18,6 @@ function excludeFirstFiveResults3([firstResult, secondResult, thirdResult, fourt
|
||||
return rest;
|
||||
}
|
||||
|
||||
function excludeFirstFiveResults4([first, second, third, fourth, fifth, ...rest]: Result[]) {
|
||||
return rest;
|
||||
}
|
||||
|
||||
const excludeFirstFiveResults5 = ([first, second, third, fourth, fifth, ...rest]) => {
|
||||
return rest;
|
||||
}
|
||||
@@ -72,17 +68,6 @@ function excludeFirstFiveResults3(
|
||||
return rest;
|
||||
}
|
||||
|
||||
function excludeFirstFiveResults4([
|
||||
first,
|
||||
second,
|
||||
third,
|
||||
fourth,
|
||||
fifth,
|
||||
...rest
|
||||
]: Result[]) {
|
||||
return rest;
|
||||
}
|
||||
|
||||
const excludeFirstFiveResults5 = ([
|
||||
first,
|
||||
second,
|
||||
@@ -172,40 +157,6 @@ function StatelessFunctionalComponent3(
|
||||
return <div />
|
||||
}
|
||||
|
||||
function StatelessFunctionalComponent4({
|
||||
isActive,
|
||||
onFiltersUpdated,
|
||||
onSelect,
|
||||
onSubmitAndDeselect,
|
||||
onCancel,
|
||||
searchFilters,
|
||||
title,
|
||||
items,
|
||||
}: MyType | null | void) {
|
||||
return <div />
|
||||
}
|
||||
|
||||
const StatelessFunctionalComponent5 = ({
|
||||
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({
|
||||
@@ -222,22 +173,6 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -282,41 +217,6 @@ function StatelessFunctionalComponent3(
|
||||
return <div />;
|
||||
}
|
||||
|
||||
function StatelessFunctionalComponent4({
|
||||
isActive,
|
||||
onFiltersUpdated,
|
||||
onSelect,
|
||||
onSubmitAndDeselect,
|
||||
onCancel,
|
||||
searchFilters,
|
||||
title,
|
||||
items,
|
||||
}: MyType | null | void) {
|
||||
return <div />;
|
||||
}
|
||||
|
||||
const StatelessFunctionalComponent5 = ({
|
||||
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,
|
||||
@@ -332,18 +232,5 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
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 />;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -10,10 +10,6 @@ function excludeFirstFiveResults3([firstResult, secondResult, thirdResult, fourt
|
||||
return rest;
|
||||
}
|
||||
|
||||
function excludeFirstFiveResults4([first, second, third, fourth, fifth, ...rest]: Result[]) {
|
||||
return rest;
|
||||
}
|
||||
|
||||
const excludeFirstFiveResults5 = ([first, second, third, fourth, fifth, ...rest]) => {
|
||||
return rest;
|
||||
}
|
||||
|
||||
@@ -41,40 +41,6 @@ function StatelessFunctionalComponent3(
|
||||
return <div />
|
||||
}
|
||||
|
||||
function StatelessFunctionalComponent4({
|
||||
isActive,
|
||||
onFiltersUpdated,
|
||||
onSelect,
|
||||
onSubmitAndDeselect,
|
||||
onCancel,
|
||||
searchFilters,
|
||||
title,
|
||||
items,
|
||||
}: MyType | null | void) {
|
||||
return <div />
|
||||
}
|
||||
|
||||
const StatelessFunctionalComponent5 = ({
|
||||
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({
|
||||
@@ -90,19 +56,3 @@ class C {
|
||||
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 />;
|
||||
@@ -33,41 +33,3 @@ new (function () {})();
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`single_expand.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function onDidInsertSuggestion({
|
||||
editor,
|
||||
triggerPosition,
|
||||
re
|
||||
}): Promise<void> {
|
||||
}
|
||||
|
||||
class X {
|
||||
async onDidInsertSuggestion({editor, triggerPosition, suggestion}): Promise<
|
||||
void
|
||||
> {
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
function onDidInsertSuggestion({
|
||||
editor,
|
||||
triggerPosition,
|
||||
re,
|
||||
}): Promise<void> {}
|
||||
|
||||
class X {
|
||||
async onDidInsertSuggestion({
|
||||
editor,
|
||||
triggerPosition,
|
||||
suggestion,
|
||||
}): Promise<void> {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -282,7 +282,7 @@ printWidth: 80
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
.catch((err) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
O.fromNullable(err.stack),
|
||||
@@ -315,7 +315,7 @@ printWidth: 80
|
||||
TE.chain(flow(publishServiceEvent(analytics), TE.mapLeft(nackFromError)))
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
.catch((err) => {
|
||||
logger.error(
|
||||
pipe(O.fromNullable(err.stack), O.getOrElse(constant(err.message)))
|
||||
);
|
||||
@@ -359,7 +359,7 @@ printWidth: 80
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
.catch((err) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
@@ -410,7 +410,7 @@ printWidth: 80
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
.catch((err) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
.catch((err) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
.catch((err) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
O.fromNullable(err.stack),
|
||||
|
||||
@@ -57,17 +57,6 @@ function a() {
|
||||
'Once this is done, commit anything to the repository to restart ' +
|
||||
'Travis and it should work :)'
|
||||
);
|
||||
|
||||
// Incorrectly indented on purpose
|
||||
function f</* prettier-ignore */ T : B>(
|
||||
a : Array < number > // prettier-ignore
|
||||
) {
|
||||
|
||||
call(
|
||||
f( 1 )
|
||||
// prettier-ignore
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const response = {
|
||||
@@ -128,16 +117,6 @@ function a() {
|
||||
'Once this is done, commit anything to the repository to restart ' +
|
||||
'Travis and it should work :)'
|
||||
);
|
||||
|
||||
// Incorrectly indented on purpose
|
||||
function f</* prettier-ignore */ T : B>(
|
||||
a : Array < number > // prettier-ignore
|
||||
) {
|
||||
call(
|
||||
f( 1 )
|
||||
// prettier-ignore
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const response = {
|
||||
|
||||
@@ -49,17 +49,6 @@ function a() {
|
||||
'Once this is done, commit anything to the repository to restart ' +
|
||||
'Travis and it should work :)'
|
||||
);
|
||||
|
||||
// Incorrectly indented on purpose
|
||||
function f</* prettier-ignore */ T : B>(
|
||||
a : Array < number > // prettier-ignore
|
||||
) {
|
||||
|
||||
call(
|
||||
f( 1 )
|
||||
// prettier-ignore
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const response = {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
run_spec(__dirname, ["babel", "flow", "typescript"]);
|
||||
@@ -46,44 +46,6 @@ export default function searchUsers(action$) {
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`break.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
export default class AddAssetHtmlPlugin {
|
||||
apply(compiler: WebpackCompilerType) {
|
||||
compiler.plugin('compilation', (compilation: WebpackCompilationType) => {
|
||||
compilation.plugin('html-webpack-plugin-before-html', (callback: Callback<any>) => {
|
||||
addAllAssetsToCompilation(this.assets, compilation, htmlPluginData, callback);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
export default class AddAssetHtmlPlugin {
|
||||
apply(compiler: WebpackCompilerType) {
|
||||
compiler.plugin("compilation", (compilation: WebpackCompilationType) => {
|
||||
compilation.plugin(
|
||||
"html-webpack-plugin-before-html",
|
||||
(callback: Callback<any>) => {
|
||||
addAllAssetsToCompilation(
|
||||
this.assets,
|
||||
compilation,
|
||||
htmlPluginData,
|
||||
callback
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`break-parent.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
@@ -154,16 +116,7 @@ parsers: ["babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
var listener = DOM.listen(
|
||||
introCard,
|
||||
'click',
|
||||
sigil,
|
||||
(event: JavelinEvent): void =>
|
||||
BanzaiLogger.log(
|
||||
config,
|
||||
{...logData, ...DataStore.get(event.getNode(sigil))},
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
a(
|
||||
SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong,
|
||||
@@ -222,17 +175,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||
});
|
||||
|
||||
=====================================output=====================================
|
||||
var listener = DOM.listen(
|
||||
introCard,
|
||||
"click",
|
||||
sigil,
|
||||
(event: JavelinEvent): void =>
|
||||
BanzaiLogger.log(config, {
|
||||
...logData,
|
||||
...DataStore.get(event.getNode(sigil)),
|
||||
})
|
||||
);
|
||||
|
||||
a(
|
||||
SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong,
|
||||
[
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
var listener = DOM.listen(
|
||||
introCard,
|
||||
'click',
|
||||
sigil,
|
||||
(event: JavelinEvent): void =>
|
||||
BanzaiLogger.log(
|
||||
config,
|
||||
{...logData, ...DataStore.get(event.getNode(sigil))},
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
a(
|
||||
SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong,
|
||||
|
||||
@@ -304,15 +304,6 @@ ret = __DEV__ ?
|
||||
vm.runInContext(source, ctx)
|
||||
: a
|
||||
|
||||
this.firebase.object(\`/shops/\${shopLocation.shop}\`)
|
||||
// keep distance info
|
||||
.first((shop: ShopQueryResult, index: number, source: Observable<ShopQueryResult>): any => {
|
||||
// add distance to result
|
||||
const s = shop;
|
||||
s.distance = shopLocation.distance;
|
||||
return s;
|
||||
});
|
||||
|
||||
angular.module('AngularAppModule')
|
||||
// Hello, I am comment.
|
||||
.constant('API_URL', 'http://localhost:8080/api');
|
||||
@@ -376,22 +367,6 @@ ret = __DEV__
|
||||
vm.runInContext(source, ctx)
|
||||
: a;
|
||||
|
||||
this.firebase
|
||||
.object(\`/shops/\${shopLocation.shop}\`)
|
||||
// keep distance info
|
||||
.first(
|
||||
(
|
||||
shop: ShopQueryResult,
|
||||
index: number,
|
||||
source: Observable<ShopQueryResult>
|
||||
): any => {
|
||||
// add distance to result
|
||||
const s = shop;
|
||||
s.distance = shopLocation.distance;
|
||||
return s;
|
||||
}
|
||||
);
|
||||
|
||||
angular
|
||||
.module("AngularAppModule")
|
||||
// Hello, I am comment.
|
||||
|
||||
@@ -48,15 +48,6 @@ ret = __DEV__ ?
|
||||
vm.runInContext(source, ctx)
|
||||
: a
|
||||
|
||||
this.firebase.object(`/shops/${shopLocation.shop}`)
|
||||
// keep distance info
|
||||
.first((shop: ShopQueryResult, index: number, source: Observable<ShopQueryResult>): any => {
|
||||
// add distance to result
|
||||
const s = shop;
|
||||
s.distance = shopLocation.distance;
|
||||
return s;
|
||||
});
|
||||
|
||||
angular.module('AngularAppModule')
|
||||
// Hello, I am comment.
|
||||
.constant('API_URL', 'http://localhost:8080/api');
|
||||
@@ -260,14 +260,6 @@ export const Group = styled.div\`
|
||||
}
|
||||
\`
|
||||
|
||||
const yesFrame = (
|
||||
...args: Interpolation<ThemedStyledProps<{}, Theme>>[]
|
||||
) => css\`
|
||||
\${ChatRoot}[data-frame="yes"] & {
|
||||
\${css({}, ...args)}
|
||||
}
|
||||
\`
|
||||
|
||||
=====================================output=====================================
|
||||
export const Group = styled.div\`
|
||||
margin: 0;
|
||||
@@ -285,14 +277,6 @@ export const Group = styled.div\`
|
||||
}
|
||||
\`;
|
||||
|
||||
const yesFrame = (
|
||||
...args: Interpolation<ThemedStyledProps<{}, Theme>>[]
|
||||
) => css\`
|
||||
\${ChatRoot}[data-frame="yes"] & {
|
||||
\${css({}, ...args)}
|
||||
}
|
||||
\`;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
|
||||
@@ -13,11 +13,3 @@ export const Group = styled.div`
|
||||
display: flex;
|
||||
}
|
||||
`
|
||||
|
||||
const yesFrame = (
|
||||
...args: Interpolation<ThemedStyledProps<{}, Theme>>[]
|
||||
) => css`
|
||||
${ChatRoot}[data-frame="yes"] & {
|
||||
${css({}, ...args)}
|
||||
}
|
||||
`
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,118 @@
|
||||
// TODO: upgrade parser
|
||||
// class A {
|
||||
// async; // The semicolon is *not* necessary
|
||||
// x(){}
|
||||
// }
|
||||
// class B {
|
||||
// static; // The semicolon *is* necessary
|
||||
// x(){}
|
||||
// }
|
||||
|
||||
class C1 {
|
||||
get; // The semicolon *is* necessary
|
||||
x(){}
|
||||
}
|
||||
class C2 {
|
||||
get = () => {}; // The semicolon is *not* necessary
|
||||
x(){}
|
||||
}
|
||||
class C3 {
|
||||
set; // The semicolon *is* necessary
|
||||
x(){}
|
||||
}
|
||||
class C4 {
|
||||
set = () => {}; // The semicolon is *not* necessary
|
||||
x(){}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class A {
|
||||
a = 0;
|
||||
[b](){}
|
||||
|
||||
c = 0;
|
||||
*d(){}
|
||||
|
||||
e = 0;
|
||||
[f] = 0
|
||||
|
||||
// none of the semicolons above this comment can be omitted.
|
||||
// none of the semicolons below this comment are necessary.
|
||||
|
||||
q() {};
|
||||
[h](){}
|
||||
|
||||
p() {};
|
||||
*i(){}
|
||||
|
||||
a = 1;
|
||||
get ['y']() {}
|
||||
|
||||
a = 1;
|
||||
static ['y']() {}
|
||||
|
||||
a = 1;
|
||||
set ['z'](z) {}
|
||||
|
||||
a = 1;
|
||||
async ['a']() {}
|
||||
|
||||
a = 1;
|
||||
async *g() {}
|
||||
|
||||
a = 0;
|
||||
b = 1;
|
||||
}
|
||||
|
||||
class A {
|
||||
a = 0;
|
||||
[b](){}
|
||||
|
||||
c = 0;
|
||||
*d(){}
|
||||
|
||||
e = 0;
|
||||
[f] = 0
|
||||
|
||||
// none of the semicolons above this comment can be omitted.
|
||||
// none of the semicolons below this comment are necessary.
|
||||
|
||||
q() {};
|
||||
[h](){}
|
||||
|
||||
p() {};
|
||||
*i(){}
|
||||
|
||||
a = 1;
|
||||
get ['y']() {}
|
||||
|
||||
a = 1;
|
||||
static ['y']() {}
|
||||
|
||||
a = 1;
|
||||
set ['z'](z) {}
|
||||
|
||||
a = 1;
|
||||
async ['a']() {}
|
||||
|
||||
a = 1;
|
||||
async *g() {}
|
||||
|
||||
a = 0;
|
||||
b = 1;
|
||||
}
|
||||
|
||||
// being first/last shouldn't break things
|
||||
class G1 {
|
||||
x = 1
|
||||
}
|
||||
class G2 {
|
||||
x() {}
|
||||
}
|
||||
class G3 {
|
||||
*x() {}
|
||||
}
|
||||
class G4 {
|
||||
[x] = 1
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
let error = new Error(response.statusText);
|
||||
// comment
|
||||
(error: any).response = response
|
||||
[].response = response
|
||||
|
||||
x;
|
||||
|
||||
/* comment */ (error: any).response = response
|
||||
/* comment */ [].response = response
|
||||
|
||||
x;
|
||||
|
||||
(error: any).response = response; /* comment */
|
||||
[].response = response; /* comment */
|
||||
@@ -19,89 +19,11 @@ x; (x, y) => x
|
||||
|
||||
class X {} [1, 2, 3].forEach(fn)
|
||||
|
||||
// TODO: upgrade parser
|
||||
// class A {
|
||||
// async; // The semicolon is *not* necessary
|
||||
// x(){}
|
||||
// }
|
||||
// class B {
|
||||
// static; // The semicolon *is* necessary
|
||||
// x(){}
|
||||
// }
|
||||
|
||||
class C1 {
|
||||
get; // The semicolon *is* necessary
|
||||
x(){}
|
||||
}
|
||||
class C2 {
|
||||
get = () => {}; // The semicolon is *not* necessary
|
||||
x(){}
|
||||
}
|
||||
class C3 {
|
||||
set; // The semicolon *is* necessary
|
||||
x(){}
|
||||
}
|
||||
class C4 {
|
||||
set = () => {}; // The semicolon is *not* necessary
|
||||
x(){}
|
||||
}
|
||||
|
||||
|
||||
// don't semicolon if it doesn't start statement
|
||||
|
||||
if (true) (() => {})()
|
||||
|
||||
class A {
|
||||
a = 0;
|
||||
[b](){}
|
||||
|
||||
c = 0;
|
||||
*d(){}
|
||||
|
||||
e = 0;
|
||||
[f] = 0
|
||||
|
||||
// none of the semicolons above this comment can be omitted.
|
||||
// none of the semicolons below this comment are necessary.
|
||||
|
||||
q() {};
|
||||
[h](){}
|
||||
|
||||
p() {};
|
||||
*i(){}
|
||||
|
||||
a = 1;
|
||||
get ['y']() {}
|
||||
|
||||
a = 1;
|
||||
static ['y']() {}
|
||||
|
||||
a = 1;
|
||||
set ['z'](z) {}
|
||||
|
||||
a = 1;
|
||||
async ['a']() {}
|
||||
|
||||
a = 1;
|
||||
async *g() {}
|
||||
|
||||
a = 0;
|
||||
b = 1;
|
||||
}
|
||||
|
||||
// being first/last shouldn't break things
|
||||
class G1 {
|
||||
x = 1
|
||||
}
|
||||
class G2 {
|
||||
x() {}
|
||||
}
|
||||
class G3 {
|
||||
*x() {}
|
||||
}
|
||||
class G4 {
|
||||
[x] = 1
|
||||
}
|
||||
|
||||
// check indentation
|
||||
|
||||
@@ -109,11 +31,6 @@ if (true) {
|
||||
x; (() => {})()
|
||||
}
|
||||
|
||||
// flow
|
||||
|
||||
(x: void);
|
||||
(y: void)
|
||||
|
||||
// check statement clauses
|
||||
|
||||
do break; while (false)
|
||||
|
||||
@@ -25,50 +25,3 @@ let b = {
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`comment.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
o = {
|
||||
name:
|
||||
// Comment A
|
||||
// Comment B
|
||||
(({id: type}: any): CreativeConcept),
|
||||
};
|
||||
|
||||
o = {
|
||||
name: // Comment A
|
||||
// Comment B
|
||||
(({ id: type }: any): CreativeConcept)
|
||||
};
|
||||
|
||||
o = {
|
||||
name: // Comment B // Comment A
|
||||
(({ id: type }: any): CreativeConcept)
|
||||
};
|
||||
|
||||
=====================================output=====================================
|
||||
o = {
|
||||
name:
|
||||
// Comment A
|
||||
// Comment B
|
||||
(({ id: type }: any): CreativeConcept),
|
||||
};
|
||||
|
||||
o = {
|
||||
// Comment A
|
||||
name:
|
||||
// Comment B
|
||||
(({ id: type }: any): CreativeConcept),
|
||||
};
|
||||
|
||||
o = {
|
||||
// Comment B // Comment A
|
||||
name: (({ id: type }: any): CreativeConcept),
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -189,6 +189,103 @@ class D {
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`numeric-separator.js - {"quoteProps":"as-needed"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
quoteProps: "as-needed"
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
a = {
|
||||
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
a = {
|
||||
0xb_b: "0xb_b", // 187
|
||||
0xb_b_bn: "0xb_b_bn", // 3003
|
||||
0b100000000000_000000000000000011n: "0b100000000000_000000000000000011n", // 536870915
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`numeric-separator.js - {"quoteProps":"consistent","singleQuote":true} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
quoteProps: "consistent"
|
||||
singleQuote: true
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
a = {
|
||||
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
a = {
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n', // 536870915
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`numeric-separator.js - {"quoteProps":"consistent"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
quoteProps: "consistent"
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
a = {
|
||||
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
a = {
|
||||
0xb_b: "0xb_b", // 187
|
||||
0xb_b_bn: "0xb_b_bn", // 3003
|
||||
0b100000000000_000000000000000011n: "0b100000000000_000000000000000011n", // 536870915
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`numeric-separator.js - {"quoteProps":"preserve"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
quoteProps: "preserve"
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
a = {
|
||||
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
a = {
|
||||
0xb_b: "0xb_b", // 187
|
||||
0xb_b_bn: "0xb_b_bn", // 3003
|
||||
0b100000000000_000000000000000011n: "0b100000000000_000000000000000011n", // 536870915
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`objects.js - {"quoteProps":"as-needed"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel"]
|
||||
@@ -285,10 +382,7 @@ Object.entries({
|
||||
0o10: '0o10', // 8
|
||||
0xf: '0xf', // 15
|
||||
2n: '2n', // 2
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0xan: '0xan', // 10
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
})
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -387,10 +481,7 @@ Object.entries({
|
||||
0o10: "0o10", // 8
|
||||
0xf: "0xf", // 15
|
||||
2n: "2n", // 2
|
||||
0xb_b: "0xb_b", // 187
|
||||
0xb_b_bn: "0xb_b_bn", // 3003
|
||||
0xan: "0xan", // 10
|
||||
0b100000000000_000000000000000011n: "0b100000000000_000000000000000011n", // 536870915
|
||||
});
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -499,10 +590,7 @@ Object.entries({
|
||||
0o10: '0o10', // 8
|
||||
0xf: '0xf', // 15
|
||||
2n: '2n', // 2
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0xan: '0xan', // 10
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
})
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -601,10 +689,7 @@ Object.entries({
|
||||
0o10: '0o10', // 8
|
||||
0xf: '0xf', // 15
|
||||
2n: '2n', // 2
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0xan: '0xan', // 10
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n', // 536870915
|
||||
});
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -712,10 +797,7 @@ Object.entries({
|
||||
0o10: '0o10', // 8
|
||||
0xf: '0xf', // 15
|
||||
2n: '2n', // 2
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0xan: '0xan', // 10
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
})
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -814,10 +896,7 @@ Object.entries({
|
||||
0o10: "0o10", // 8
|
||||
0xf: "0xf", // 15
|
||||
2n: "2n", // 2
|
||||
0xb_b: "0xb_b", // 187
|
||||
0xb_b_bn: "0xb_b_bn", // 3003
|
||||
0xan: "0xan", // 10
|
||||
0b100000000000_000000000000000011n: "0b100000000000_000000000000000011n", // 536870915
|
||||
});
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -925,10 +1004,7 @@ Object.entries({
|
||||
0o10: '0o10', // 8
|
||||
0xf: '0xf', // 15
|
||||
2n: '2n', // 2
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0xan: '0xan', // 10
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
})
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
@@ -1027,10 +1103,7 @@ Object.entries({
|
||||
0o10: "0o10", // 8
|
||||
0xf: "0xf", // 15
|
||||
2n: "2n", // 2
|
||||
0xb_b: "0xb_b", // 187
|
||||
0xb_b_bn: "0xb_b_bn", // 3003
|
||||
0xan: "0xan", // 10
|
||||
0b100000000000_000000000000000011n: "0b100000000000_000000000000000011n", // 536870915
|
||||
});
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
a = {
|
||||
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
}
|
||||
@@ -87,10 +87,7 @@ Object.entries({
|
||||
0o10: '0o10', // 8
|
||||
0xf: '0xf', // 15
|
||||
2n: '2n', // 2
|
||||
0xb_b: '0xb_b', // 187
|
||||
0xb_b_bn: '0xb_b_bn', // 3003
|
||||
0xan: '0xan', // 10
|
||||
0b100000000000_000000000000000011n: '0b100000000000_000000000000000011n' // 536870915
|
||||
})
|
||||
|
||||
// Negative numbers cannot be unquoted.
|
||||
|
||||
@@ -14,7 +14,7 @@ class A {
|
||||
x = x + 1;
|
||||
if (true) x = "";
|
||||
}
|
||||
var z:number = x;
|
||||
var z = x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class A {
|
||||
x = x + 1;
|
||||
if (true) x = "";
|
||||
}
|
||||
var z: number = x;
|
||||
var z = x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class A {
|
||||
x = x + 1;
|
||||
if (true) x = "";
|
||||
}
|
||||
var z:number = x;
|
||||
var z = x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class A {
|
||||
x = x + 1;
|
||||
if (true) x = "";
|
||||
}
|
||||
var z: number = x;
|
||||
var z = x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@ class A {
|
||||
x = x + 1;
|
||||
if (true) x = "";
|
||||
}
|
||||
var z:number = x;
|
||||
var z = x;
|
||||
}
|
||||
}
|
||||
@@ -275,35 +275,6 @@ this._pipe.write(\`
|
||||
a
|
||||
\`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
// https://github.com/prettier/prettier/issues/5529
|
||||
editTitle += \`\${iconHTML({ class: "reply-to-glyph" })}\`;
|
||||
@@ -334,30 +305,6 @@ this._pipe.write(\`
|
||||
a
|
||||
\`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean,
|
||||
} => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean,
|
||||
} =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
(someLong: boolean, t: boolean) => \`
|
||||
a
|
||||
\`;
|
||||
|
||||
(someLong: boolean, t: boolean) =>
|
||||
\`
|
||||
a
|
||||
\`;
|
||||
|
||||
// https://github.com/prettier/prettier/issues/5529
|
||||
editTitle += \`\${iconHTML({ class: "reply-to-glyph" })}\`;
|
||||
|
||||
|
||||
@@ -27,35 +27,6 @@ this._pipe.write(`
|
||||
a
|
||||
`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} => `
|
||||
a
|
||||
`;
|
||||
|
||||
(): {
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
} =>
|
||||
`
|
||||
a
|
||||
`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) => `
|
||||
a
|
||||
`;
|
||||
|
||||
(
|
||||
someLong: boolean,
|
||||
t: boolean
|
||||
) =>
|
||||
`
|
||||
a
|
||||
`;
|
||||
|
||||
// https://github.com/prettier/prettier/issues/5529
|
||||
editTitle += `${iconHTML({ class: "reply-to-glyph" })}`;
|
||||
@@ -831,10 +831,6 @@ test(\`does something really long and complicated so I have to write a very long
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
test("does something really long and complicated so I have to write a very long name for the test", <T>(done) => {
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
describe("does something really long and complicated so I have to write a very long name for the describe block", () => {
|
||||
it("an example test", (done) => {
|
||||
console.log("hello!");
|
||||
@@ -963,10 +959,6 @@ test(\`does something really long and complicated so I have to write a very long
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
test("does something really long and complicated so I have to write a very long name for the test", <T>(done) => {
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
describe("does something really long and complicated so I have to write a very long name for the describe block", () => {
|
||||
it("an example test", done => {
|
||||
console.log("hello!");
|
||||
@@ -1114,10 +1106,6 @@ test(\`does something really long and complicated so I have to write a very long
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
test("does something really long and complicated so I have to write a very long name for the test", <T>(done) => {
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
describe("does something really long and complicated so I have to write a very long name for the describe block", () => {
|
||||
it("an example test", (done) => {
|
||||
console.log("hello!");
|
||||
@@ -1246,10 +1234,6 @@ test(\`does something really long and complicated so I have to write a very long
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
test("does something really long and complicated so I have to write a very long name for the test", <T>(done) => {
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
describe("does something really long and complicated so I have to write a very long name for the describe block", () => {
|
||||
it("an example test", (done) => {
|
||||
console.log("hello!");
|
||||
|
||||
@@ -39,10 +39,6 @@ test(`does something really long and complicated so I have to write a very long
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
test("does something really long and complicated so I have to write a very long name for the test", <T>(done) => {
|
||||
console.log("hello!");
|
||||
});
|
||||
|
||||
describe("does something really long and complicated so I have to write a very long name for the describe block", () => {
|
||||
it("an example test", (done) => {
|
||||
console.log("hello!");
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`arrow_function_expression.ts - {"arrowParens":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
a = (b?) => c;
|
||||
|
||||
=====================================output=====================================
|
||||
a = (b?) => c;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`arrow_function_expression.ts - {"arrowParens":"avoid"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
a = (b?) => c;
|
||||
|
||||
=====================================output=====================================
|
||||
a = (b?) => c;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`short_body.ts - {"arrowParens":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean,
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
=====================================output=====================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`short_body.ts - {"arrowParens":"avoid"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean,
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
=====================================output=====================================
|
||||
const initializeSnapshotState = (
|
||||
testFile: Path,
|
||||
update: boolean,
|
||||
testPath: string,
|
||||
expand: boolean
|
||||
) => new SnapshotState(testFile, update, testPath, expand);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`type_params.ts - {"arrowParens":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<T>(a) => { }
|
||||
|
||||
=====================================output=====================================
|
||||
<T>(a) => {};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`type_params.ts - {"arrowParens":"avoid"} format 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<T>(a) => { }
|
||||
|
||||
=====================================output=====================================
|
||||
<T>(a) => {};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
a = (b?) => c;
|
||||
@@ -0,0 +1,2 @@
|
||||
run_spec(__dirname, ["typescript", "babel"], { arrowParens: "always" });
|
||||
run_spec(__dirname, ["typescript", "babel"], { arrowParens: "avoid" });
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,280 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`class-implements.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class a1 extends b // comment
|
||||
implements z
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a2 extends b implements z { // comment
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a3 extends b
|
||||
implements
|
||||
// comment
|
||||
z,
|
||||
y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a4 extends b
|
||||
implements z, // comment
|
||||
y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a5 extends b implements
|
||||
z, // comment-z
|
||||
y // comment-y
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a6 extends b implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a7 extends b implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
// comment-y3
|
||||
{
|
||||
//comment-body
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a8 extends b // comment-b
|
||||
implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a9 extends
|
||||
// comment-b1
|
||||
b // comment-b2
|
||||
// comment-b3
|
||||
implements
|
||||
// comment-z1
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y // comment-y2
|
||||
{
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class a1
|
||||
extends b // comment
|
||||
implements z {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a2 extends b implements z {
|
||||
// comment
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a3
|
||||
extends b
|
||||
// comment
|
||||
implements z, y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a4
|
||||
extends b
|
||||
implements
|
||||
z, // comment
|
||||
y {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a5
|
||||
extends b
|
||||
implements
|
||||
z, // comment-z
|
||||
y {
|
||||
// comment-y
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a6
|
||||
extends b
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a7
|
||||
extends b
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
// comment-y3
|
||||
//comment-body
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a8
|
||||
extends b // comment-b
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class a9
|
||||
// comment-b1
|
||||
extends b // comment-b2
|
||||
// comment-b3
|
||||
// comment-z1
|
||||
implements
|
||||
z, // comment-z2
|
||||
// comment-y1
|
||||
y {
|
||||
// comment-y2
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`declare.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
declare class a // 1
|
||||
// extends b // 2
|
||||
implements z,x // 3
|
||||
{
|
||||
doo:boolean
|
||||
}
|
||||
|
||||
declare class A1<T> // 1
|
||||
// 2
|
||||
extends B<T> // 3
|
||||
{}
|
||||
|
||||
=====================================output=====================================
|
||||
declare class a // 1
|
||||
// extends b // 2
|
||||
implements z, x {
|
||||
// 3
|
||||
doo: boolean;
|
||||
}
|
||||
|
||||
declare class A1<T> // 1
|
||||
// 2
|
||||
extends B<T> {
|
||||
// 3
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`generic.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class G1<T> implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G2 // g2
|
||||
<T> implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G3 // g3
|
||||
<T> extends U implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G4<T // g4
|
||||
> extends U implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class G1<T> implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G2<T> // g2
|
||||
implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G3<T> // g3
|
||||
extends U
|
||||
implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
class G4<
|
||||
T // g4
|
||||
>
|
||||
extends U
|
||||
implements IPoly<T> {
|
||||
x: T;
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`misc.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
export class SnapshotLogger {
|
||||
constructor(
|
||||
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||
snapshotInterval: number = 30 * 1000, // snapshot no more than every 30s
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
export class SnapshotLogger {
|
||||
constructor(
|
||||
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||
snapshotInterval: number = 30 * 1000 // snapshot no more than every 30s
|
||||
) {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"]);
|
||||
@@ -0,0 +1,7 @@
|
||||
export class SnapshotLogger {
|
||||
constructor(
|
||||
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||
snapshotInterval: number = 30 * 1000, // snapshot no more than every 30s
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`break.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
class MyContractSelectionWidget extends React.Component<void, MyContractSelectionWidgetPropsType, void> implements SomethingLarge {
|
||||
method() {}
|
||||
}
|
||||
|
||||
class DisplayObject1
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {
|
||||
}
|
||||
|
||||
class DisplayObject2 extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {
|
||||
}
|
||||
|
||||
class DisplayObject3 extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget,
|
||||
somethingElse_SomeOtherThing,
|
||||
somethingElseAgain_RunningOutOfNames {
|
||||
}
|
||||
|
||||
class DisplayObject4 extends utils.EventEmitter implements interaction_InteractiveTarget {}
|
||||
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
|
||||
class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}
|
||||
|
||||
class Foo extends Immutable.Record({
|
||||
ipaddress: '',
|
||||
}) {
|
||||
ipaddress: string;
|
||||
}
|
||||
|
||||
export class VisTimelineComponent
|
||||
implements AfterViewInit, OnChanges, OnDestroy {
|
||||
}
|
||||
export class VisTimelineComponent2
|
||||
implements AfterViewInit, OnChanges, OnDestroy, AndSomethingReallyReallyLong {
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
class MyContractSelectionWidget
|
||||
extends React.Component<void, MyContractSelectionWidgetPropsType, void>
|
||||
implements SomethingLarge {
|
||||
method() {}
|
||||
}
|
||||
|
||||
class DisplayObject1
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {}
|
||||
|
||||
class DisplayObject2
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {}
|
||||
|
||||
class DisplayObject3
|
||||
extends utils.EventEmitter
|
||||
implements
|
||||
interaction_InteractiveTarget,
|
||||
somethingElse_SomeOtherThing,
|
||||
somethingElseAgain_RunningOutOfNames {}
|
||||
|
||||
class DisplayObject4
|
||||
extends utils.EventEmitter
|
||||
implements interaction_InteractiveTarget {}
|
||||
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
|
||||
class InMemoryAppender
|
||||
extends log4javascript.Appender
|
||||
implements ICachedLogMessageProvider {}
|
||||
|
||||
class Foo extends Immutable.Record({
|
||||
ipaddress: "",
|
||||
}) {
|
||||
ipaddress: string;
|
||||
}
|
||||
|
||||
export class VisTimelineComponent
|
||||
implements AfterViewInit, OnChanges, OnDestroy {}
|
||||
export class VisTimelineComponent2
|
||||
implements
|
||||
AfterViewInit,
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
AndSomethingReallyReallyLong {}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"]);
|
||||
@@ -0,0 +1,320 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`dangling.ts - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {/* dangling */}
|
||||
|
||||
=====================================output=====================================
|
||||
Thing?.(/* dangling */)
|
||||
declare class Foo extends Qux<string> {
|
||||
/* dangling */
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`dangling.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {/* dangling */}
|
||||
|
||||
=====================================output=====================================
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {
|
||||
/* dangling */
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issues.ts - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType,
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
|
||||
=====================================output=====================================
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issues.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType,
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
|
||||
=====================================output=====================================
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`last-arg.ts - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type f1 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ['unknown']
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
type f1 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number
|
||||
|
||||
f2 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {}
|
||||
|
||||
f3 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {}
|
||||
|
||||
f4 = function (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {},
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ["unknown"]
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`last-arg.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type f1 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ['unknown']
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
type f1 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function (
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: { a: number }
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {},
|
||||
};
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ["unknown"]
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
Thing?.(/* dangling */);
|
||||
declare class Foo extends Qux<string> {/* dangling */}
|
||||
@@ -0,0 +1,6 @@
|
||||
function f(
|
||||
someReallyLongArgument: WithSomeLongType,
|
||||
someReallyLongArgument2: WithSomeLongType,
|
||||
// Trailing comment should stay after
|
||||
) {}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"]);
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"], { semi: false });
|
||||
@@ -0,0 +1,53 @@
|
||||
type f1 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => number;
|
||||
|
||||
f2 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
): number => {};
|
||||
|
||||
f3 = (
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) => {};
|
||||
|
||||
f4 = function(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {};
|
||||
|
||||
class X {
|
||||
f(
|
||||
currentRequest: {a: number},
|
||||
// TODO this is a very very very very long comment that makes it go > 80 columns
|
||||
) {}
|
||||
}
|
||||
|
||||
function f5(
|
||||
a: number
|
||||
// some comment here
|
||||
): number {
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
var x = {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
class X2 {
|
||||
getSectionMode(
|
||||
pageMetaData: PageMetaData,
|
||||
sectionMetaData: SectionMetaData = ['unknown']
|
||||
/* $FlowFixMe This error was exposed while converting keyMirror
|
||||
* to keyMirrorRecursive */
|
||||
): $Enum<SectionMode> {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`multiline.ts - {"endOfLine":"cr"} format 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "cr"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
'Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string'<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
=====================================output=====================================
|
||||
type IAmIncredibleLongParameterType = {};<CR>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<CR>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CR>
|
||||
(_0: IAmIncredibleLongParameterType) => {<CR>
|
||||
setTimeout(() => {<CR>
|
||||
/*<CR>
|
||||
Multiline comment<CR>
|
||||
Multiline comment<CR>
|
||||
Multiline comment<CR>
|
||||
*/<CR>
|
||||
console.log(<CR>
|
||||
"Multiline string\\<CR>
|
||||
Multiline string\\<CR>
|
||||
Multiline string"<CR>
|
||||
);<CR>
|
||||
console.log(<CR>
|
||||
\`Multiline \\n string\\<CR>
|
||||
Multiline string\\<CR>
|
||||
Multiline string\`<CR>
|
||||
);<CR>
|
||||
});<CR>
|
||||
}<CR>
|
||||
);<CR>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`multiline.ts - {"endOfLine":"crlf"} format 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "crlf"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
'Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string'<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
=====================================output=====================================
|
||||
type IAmIncredibleLongParameterType = {};<CRLF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<CRLF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CRLF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<CRLF>
|
||||
setTimeout(() => {<CRLF>
|
||||
/*<CRLF>
|
||||
Multiline comment<CRLF>
|
||||
Multiline comment<CRLF>
|
||||
Multiline comment<CRLF>
|
||||
*/<CRLF>
|
||||
console.log(<CRLF>
|
||||
"Multiline string\\<CRLF>
|
||||
Multiline string\\<CRLF>
|
||||
Multiline string"<CRLF>
|
||||
);<CRLF>
|
||||
console.log(<CRLF>
|
||||
\`Multiline \\n string\\<CRLF>
|
||||
Multiline string\\<CRLF>
|
||||
Multiline string\`<CRLF>
|
||||
);<CRLF>
|
||||
});<CRLF>
|
||||
}<CRLF>
|
||||
);<CRLF>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`multiline.ts - {"endOfLine":"lf"} format 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "lf"
|
||||
parsers: ["typescript", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
'Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string'<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
=====================================output=====================================
|
||||
type IAmIncredibleLongParameterType = {};<LF>
|
||||
const IAmAnotherFunctionName = (_0: IAmIncredibleLongParameterType) => {};<LF>
|
||||
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<LF>
|
||||
(_0: IAmIncredibleLongParameterType) => {<LF>
|
||||
setTimeout(() => {<LF>
|
||||
/*<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
Multiline comment<LF>
|
||||
*/<LF>
|
||||
console.log(<LF>
|
||||
"Multiline string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string"<LF>
|
||||
);<LF>
|
||||
console.log(<LF>
|
||||
\`Multiline \\n string\\<LF>
|
||||
Multiline string\\<LF>
|
||||
Multiline string\`<LF>
|
||||
);<LF>
|
||||
});<LF>
|
||||
}<LF>
|
||||
);<LF>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,3 @@
|
||||
run_spec(__dirname, ["typescript", "babel"], { endOfLine: "lf" });
|
||||
run_spec(__dirname, ["typescript", "babel"], { endOfLine: "cr" });
|
||||
run_spec(__dirname, ["typescript", "babel"], { endOfLine: "crlf" });
|
||||
File renamed without changes.
@@ -0,0 +1,39 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`single_expand.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
function onDidInsertSuggestion({
|
||||
editor,
|
||||
triggerPosition,
|
||||
re
|
||||
}): Promise<void> {
|
||||
}
|
||||
|
||||
class X {
|
||||
async onDidInsertSuggestion({editor, triggerPosition, suggestion}): Promise<
|
||||
void
|
||||
> {
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
function onDidInsertSuggestion({
|
||||
editor,
|
||||
triggerPosition,
|
||||
re,
|
||||
}): Promise<void> {}
|
||||
|
||||
class X {
|
||||
async onDidInsertSuggestion({
|
||||
editor,
|
||||
triggerPosition,
|
||||
suggestion,
|
||||
}): Promise<void> {}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"]);
|
||||
File renamed without changes.
@@ -0,0 +1,158 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`pipe-function-calls.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
(() => {
|
||||
|
||||
pipe(
|
||||
serviceEventFromMessage(msg),
|
||||
TE.chain(
|
||||
flow(
|
||||
publishServiceEvent(analytics),
|
||||
TE.mapLeft(nackFromError)
|
||||
)
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
O.fromNullable(err.stack),
|
||||
O.getOrElse(constant(err.message))
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
})();
|
||||
|
||||
=====================================output=====================================
|
||||
(() => {
|
||||
pipe(
|
||||
serviceEventFromMessage(msg),
|
||||
TE.chain(flow(publishServiceEvent(analytics), TE.mapLeft(nackFromError)))
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
logger.error(
|
||||
pipe(O.fromNullable(err.stack), O.getOrElse(constant(err.message)))
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
})();
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`pipe-function-calls-with-comments.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
// input with some comments added to avoid reformatting
|
||||
|
||||
(() => {
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
timelines,
|
||||
everyCommitTimestamps,
|
||||
A.sort(ordDate),
|
||||
A.head
|
||||
);
|
||||
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
serviceEventFromMessage(msg),
|
||||
TE.chain(
|
||||
flow(
|
||||
// add a descriptive comment here
|
||||
publishServiceEvent(analytics),
|
||||
TE.mapLeft(nackFromError)
|
||||
)
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
O.fromNullable(err.stack),
|
||||
O.getOrElse(constant(err.message))
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
Changelog.timestampOfFirstCommit([[commit]]),
|
||||
O.toUndefined
|
||||
);
|
||||
|
||||
chain(
|
||||
flow(
|
||||
// add a descriptive comment here
|
||||
getUploadUrl,
|
||||
E.mapLeft(Errors.unknownError),
|
||||
TE.fromEither
|
||||
)
|
||||
);
|
||||
})();
|
||||
|
||||
=====================================output=====================================
|
||||
// input with some comments added to avoid reformatting
|
||||
|
||||
(() => {
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
timelines,
|
||||
everyCommitTimestamps,
|
||||
A.sort(ordDate),
|
||||
A.head
|
||||
);
|
||||
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
serviceEventFromMessage(msg),
|
||||
TE.chain(
|
||||
flow(
|
||||
// add a descriptive comment here
|
||||
publishServiceEvent(analytics),
|
||||
TE.mapLeft(nackFromError)
|
||||
)
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
O.fromNullable(err.stack),
|
||||
O.getOrElse(constant(err.message))
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
Changelog.timestampOfFirstCommit([[commit]]),
|
||||
O.toUndefined
|
||||
);
|
||||
|
||||
chain(
|
||||
flow(
|
||||
// add a descriptive comment here
|
||||
getUploadUrl,
|
||||
E.mapLeft(Errors.unknownError),
|
||||
TE.fromEither
|
||||
)
|
||||
);
|
||||
})();
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"]);
|
||||
@@ -0,0 +1,49 @@
|
||||
// input with some comments added to avoid reformatting
|
||||
|
||||
(() => {
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
timelines,
|
||||
everyCommitTimestamps,
|
||||
A.sort(ordDate),
|
||||
A.head
|
||||
);
|
||||
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
serviceEventFromMessage(msg),
|
||||
TE.chain(
|
||||
flow(
|
||||
// add a descriptive comment here
|
||||
publishServiceEvent(analytics),
|
||||
TE.mapLeft(nackFromError)
|
||||
)
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
O.fromNullable(err.stack),
|
||||
O.getOrElse(constant(err.message))
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
pipe(
|
||||
// add a descriptive comment here
|
||||
Changelog.timestampOfFirstCommit([[commit]]),
|
||||
O.toUndefined
|
||||
);
|
||||
|
||||
chain(
|
||||
flow(
|
||||
// add a descriptive comment here
|
||||
getUploadUrl,
|
||||
E.mapLeft(Errors.unknownError),
|
||||
TE.fromEither
|
||||
)
|
||||
);
|
||||
})();
|
||||
@@ -0,0 +1,22 @@
|
||||
(() => {
|
||||
|
||||
pipe(
|
||||
serviceEventFromMessage(msg),
|
||||
TE.chain(
|
||||
flow(
|
||||
publishServiceEvent(analytics),
|
||||
TE.mapLeft(nackFromError)
|
||||
)
|
||||
)
|
||||
)()
|
||||
.then(messageResponse(logger, msg))
|
||||
.catch((err: Error) => {
|
||||
logger.error(
|
||||
pipe(
|
||||
O.fromNullable(err.stack),
|
||||
O.getOrElse(constant(err.message))
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
})();
|
||||
+8
-8
@@ -1,8 +1,8 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`break.js format 1`] = `
|
||||
exports[`break.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -180,9 +180,9 @@ export interface ExtendsLongOneWithGenerics
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`comments.js format 1`] = `
|
||||
exports[`comments.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -258,9 +258,9 @@ interface A6 // comment1
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`comments-declare.js format 1`] = `
|
||||
exports[`comments-declare.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -278,9 +278,9 @@ declare interface a // 1
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`module.js format 1`] = `
|
||||
exports[`module.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1 @@
|
||||
run_spec(__dirname, ["typescript", "babel", "flow"]);
|
||||
File renamed without changes.
@@ -0,0 +1,71 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`break.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
export default class AddAssetHtmlPlugin {
|
||||
apply(compiler: WebpackCompilerType) {
|
||||
compiler.plugin('compilation', (compilation: WebpackCompilationType) => {
|
||||
compilation.plugin('html-webpack-plugin-before-html', (callback: Callback<any>) => {
|
||||
addAllAssetsToCompilation(this.assets, compilation, htmlPluginData, callback);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
export default class AddAssetHtmlPlugin {
|
||||
apply(compiler: WebpackCompilerType) {
|
||||
compiler.plugin("compilation", (compilation: WebpackCompilationType) => {
|
||||
compilation.plugin(
|
||||
"html-webpack-plugin-before-html",
|
||||
(callback: Callback<any>) => {
|
||||
addAllAssetsToCompilation(
|
||||
this.assets,
|
||||
compilation,
|
||||
htmlPluginData,
|
||||
callback
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`edge_case.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "babel", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
var listener = DOM.listen(
|
||||
introCard,
|
||||
'click',
|
||||
sigil,
|
||||
(event: JavelinEvent): void =>
|
||||
BanzaiLogger.log(
|
||||
config,
|
||||
{...logData, ...DataStore.get(event.getNode(sigil))},
|
||||
),
|
||||
);
|
||||
|
||||
=====================================output=====================================
|
||||
var listener = DOM.listen(
|
||||
introCard,
|
||||
"click",
|
||||
sigil,
|
||||
(event: JavelinEvent): void =>
|
||||
BanzaiLogger.log(config, {
|
||||
...logData,
|
||||
...DataStore.get(event.getNode(sigil)),
|
||||
})
|
||||
);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
@@ -0,0 +1,10 @@
|
||||
var listener = DOM.listen(
|
||||
introCard,
|
||||
'click',
|
||||
sigil,
|
||||
(event: JavelinEvent): void =>
|
||||
BanzaiLogger.log(
|
||||
config,
|
||||
{...logData, ...DataStore.get(event.getNode(sigil))},
|
||||
),
|
||||
);
|
||||
Loaded 100 of 111 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user