Files
test-repo/tests/comments/last-arg.js
T
Christopher Chedeau 93cad97b14 Preserve inline comment as last argument (#1390)
We already had the logic but only applied it for comments on their own line, we should also do it if they are inline.

Fixes #1380
2017-05-01 14:29:03 -07:00

95 lines
1.8 KiB
JavaScript

type f = (
currentRequest: {a: number},
// TODO this is a very very very very long comment that makes it go > 80 columns
) => number;
f = (
currentRequest: {a: number},
// TODO this is a very very very very long comment that makes it go > 80 columns
): number => {};
f = (
currentRequest: {a: number},
// TODO this is a very very very very long comment that makes it go > 80 columns
) => {};
f = 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 f(
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 X {
getSectionMode(
pageMetaData: PageMetaData,
sectionMetaData: SectionMetaData = ['unknown']
/* $FlowFixMe This error was exposed while converting keyMirror
* to keyMirrorRecursive */
): $Enum<SectionMode> {
}
}
class Foo {
a(lol /*string*/) {}
b(lol /*string*/
) {}
d(
lol /*string*/,
lol2 /*string*/,
lol3 /*string*/,
lol4 /*string*/
) {}
d(
lol /*string*/,
lol2 /*string*/,
lol3 /*string*/,
lol4 /*string*/
) /*string*/ {}
// prettier-ignore
c(lol /*string*/
) {}
// prettier-ignore
d(
lol /*string*/,
lol2 /*string*/,
lol3 /*string*/,
lol4 /*string*/
) {}
// prettier-ignore
e(
lol /*string*/,
lol2 /*string*/,
lol3 /*string*/,
lol4 /*string*/
) {} /* string*/
}