2017-02-22 00:59:19 +03:00
|
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
|
|
exports[`assignment-pattern.js 1`] = `
|
|
|
|
|
"const { a /* comment */ = 1 } = b;
|
|
|
|
|
|
|
|
|
|
const { c = 1 /* comment */ } = d;
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
const { a /* comment */ = 1 } = b;
|
|
|
|
|
|
|
|
|
|
const { c = 1 /* comment */ } = d;
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`assignment-pattern.js 2`] = `
|
|
|
|
|
"const { a /* comment */ = 1 } = b;
|
|
|
|
|
|
|
|
|
|
const { c = 1 /* comment */ } = d;
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
const { a /* comment */ = 1 } = b;
|
|
|
|
|
|
|
|
|
|
const { c = 1 /* comment */ } = d;
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`blank.js 1`] = `
|
2017-01-26 22:57:43 +03:00
|
|
|
|
"// This file only
|
|
|
|
|
// has comments. This comment
|
|
|
|
|
// should still exist
|
|
|
|
|
//
|
|
|
|
|
// when printed.
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-05 05:36:29 +03:00
|
|
|
|
// This file only
|
|
|
|
|
// has comments. This comment
|
|
|
|
|
// should still exist
|
|
|
|
|
//
|
|
|
|
|
// when printed.
|
2017-01-26 22:57:43 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`blank.js 2`] = `
|
2017-01-26 22:57:43 +03:00
|
|
|
|
"// This file only
|
|
|
|
|
// has comments. This comment
|
|
|
|
|
// should still exist
|
|
|
|
|
//
|
|
|
|
|
// when printed.
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// This file only
|
|
|
|
|
// has comments. This comment
|
|
|
|
|
// should still exist
|
|
|
|
|
//
|
|
|
|
|
// when printed.
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`dangling.js 1`] = `
|
2017-01-28 00:09:15 +03:00
|
|
|
|
"var x = {/* dangling */};
|
2017-01-31 17:52:05 +03:00
|
|
|
|
var x = {
|
|
|
|
|
// dangling
|
|
|
|
|
};
|
2017-01-28 00:09:15 +03:00
|
|
|
|
var x = [/* dangling */];
|
|
|
|
|
function x() {
|
|
|
|
|
/* dangling */
|
|
|
|
|
}
|
|
|
|
|
declare class Foo extends Qux<string> {/* dangling */}
|
2017-02-20 01:39:09 +03:00
|
|
|
|
export /* dangling */{};
|
2017-01-28 00:09:15 +03:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-14 04:08:58 +03:00
|
|
|
|
var x = {
|
|
|
|
|
/* dangling */
|
|
|
|
|
};
|
2017-01-31 17:52:05 +03:00
|
|
|
|
var x = {
|
|
|
|
|
// dangling
|
|
|
|
|
};
|
2017-02-14 04:08:58 +03:00
|
|
|
|
var x = [
|
|
|
|
|
/* dangling */
|
|
|
|
|
];
|
2017-01-28 00:09:15 +03:00
|
|
|
|
function x() {
|
|
|
|
|
/* dangling */
|
|
|
|
|
}
|
2017-02-14 04:08:58 +03:00
|
|
|
|
declare class Foo extends Qux<string> {
|
|
|
|
|
/* dangling */
|
|
|
|
|
}
|
2017-02-20 01:39:09 +03:00
|
|
|
|
export /* dangling */{};
|
2017-01-28 00:09:15 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`dangling.js 2`] = `
|
2017-01-28 00:09:15 +03:00
|
|
|
|
"var x = {/* dangling */};
|
2017-01-31 17:52:05 +03:00
|
|
|
|
var x = {
|
|
|
|
|
// dangling
|
|
|
|
|
};
|
2017-01-28 00:09:15 +03:00
|
|
|
|
var x = [/* dangling */];
|
|
|
|
|
function x() {
|
|
|
|
|
/* dangling */
|
|
|
|
|
}
|
|
|
|
|
declare class Foo extends Qux<string> {/* dangling */}
|
2017-02-20 01:39:09 +03:00
|
|
|
|
export /* dangling */{};
|
2017-01-28 00:09:15 +03:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-14 04:08:58 +03:00
|
|
|
|
var x = {
|
|
|
|
|
/* dangling */
|
|
|
|
|
};
|
2017-01-31 17:52:05 +03:00
|
|
|
|
var x = {
|
|
|
|
|
// dangling
|
|
|
|
|
};
|
2017-02-14 04:08:58 +03:00
|
|
|
|
var x = [
|
|
|
|
|
/* dangling */
|
|
|
|
|
];
|
2017-01-28 00:09:15 +03:00
|
|
|
|
function x() {
|
|
|
|
|
/* dangling */
|
|
|
|
|
}
|
2017-02-14 04:08:58 +03:00
|
|
|
|
declare class Foo extends Qux<string> {
|
|
|
|
|
/* dangling */
|
|
|
|
|
}
|
2017-02-20 01:39:09 +03:00
|
|
|
|
export /* dangling */{};
|
2017-01-28 00:09:15 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`dangling_array.js 1`] = `
|
2017-02-18 06:44:55 +03:00
|
|
|
|
"expect(() => {}).toTriggerReadyStateChanges([
|
|
|
|
|
// Nothing.
|
|
|
|
|
]);
|
2017-02-20 04:25:18 +03:00
|
|
|
|
|
|
|
|
|
[1 /* first comment */, 2 /* second comment */, 3];
|
2017-02-18 06:44:55 +03:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
expect(() => {}).toTriggerReadyStateChanges(
|
|
|
|
|
[
|
|
|
|
|
// Nothing.
|
|
|
|
|
]
|
|
|
|
|
);
|
2017-02-20 04:25:18 +03:00
|
|
|
|
|
|
|
|
|
[1 /* first comment */, 2 /* second comment */, 3];
|
2017-02-18 06:44:55 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`dangling_array.js 2`] = `
|
2017-02-18 06:44:55 +03:00
|
|
|
|
"expect(() => {}).toTriggerReadyStateChanges([
|
|
|
|
|
// Nothing.
|
|
|
|
|
]);
|
2017-02-20 04:25:18 +03:00
|
|
|
|
|
|
|
|
|
[1 /* first comment */, 2 /* second comment */, 3];
|
2017-02-18 06:44:55 +03:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
expect(() => {}).toTriggerReadyStateChanges(
|
|
|
|
|
[
|
|
|
|
|
// Nothing.
|
|
|
|
|
]
|
|
|
|
|
);
|
2017-02-20 04:25:18 +03:00
|
|
|
|
|
|
|
|
|
[1 /* first comment */, 2 /* second comment */, 3];
|
2017-02-18 06:44:55 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`dangling_for.js 1`] = `
|
2017-02-20 17:17:10 +03:00
|
|
|
|
"for // comment
|
|
|
|
|
(;;);
|
|
|
|
|
|
|
|
|
|
for /* comment */(;;);
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// comment
|
|
|
|
|
for (;;);
|
|
|
|
|
|
|
|
|
|
/* comment */
|
|
|
|
|
for (;;);
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`dangling_for.js 2`] = `
|
2017-02-20 17:17:10 +03:00
|
|
|
|
"for // comment
|
|
|
|
|
(;;);
|
|
|
|
|
|
|
|
|
|
for /* comment */(;;);
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// comment
|
|
|
|
|
for (;;);
|
|
|
|
|
|
|
|
|
|
/* comment */
|
|
|
|
|
for (;;);
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`first-line.js 1`] = `
|
2017-02-05 05:36:48 +03:00
|
|
|
|
"a // comment
|
|
|
|
|
b
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
a; // comment
|
|
|
|
|
b;
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`first-line.js 2`] = `
|
2017-02-05 05:36:48 +03:00
|
|
|
|
"a // comment
|
|
|
|
|
b
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
a; // comment
|
|
|
|
|
b;
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`if.js 1`] = `
|
2017-02-02 03:23:49 +03:00
|
|
|
|
"if (1)
|
|
|
|
|
// comment
|
|
|
|
|
{
|
|
|
|
|
false
|
|
|
|
|
}
|
|
|
|
|
// comment
|
|
|
|
|
else if (2)
|
|
|
|
|
true
|
|
|
|
|
// multi
|
|
|
|
|
// ple
|
|
|
|
|
// lines
|
|
|
|
|
else if (3)
|
|
|
|
|
// existing comment
|
|
|
|
|
true
|
|
|
|
|
// okay?
|
|
|
|
|
else if (4) {
|
|
|
|
|
// empty with existing comment
|
|
|
|
|
}
|
|
|
|
|
// comment
|
|
|
|
|
else {
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
if (1) {
|
|
|
|
|
// comment
|
|
|
|
|
false;
|
|
|
|
|
} else if (2)
|
|
|
|
|
// comment
|
|
|
|
|
true;
|
|
|
|
|
else if (3)
|
|
|
|
|
// multi
|
|
|
|
|
// ple
|
|
|
|
|
// lines
|
|
|
|
|
// existing comment
|
|
|
|
|
true;
|
|
|
|
|
else if (4) {
|
|
|
|
|
// okay?
|
|
|
|
|
// empty with existing comment
|
|
|
|
|
} else {
|
|
|
|
|
// comment
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`if.js 2`] = `
|
2017-02-02 03:23:49 +03:00
|
|
|
|
"if (1)
|
|
|
|
|
// comment
|
|
|
|
|
{
|
|
|
|
|
false
|
|
|
|
|
}
|
|
|
|
|
// comment
|
|
|
|
|
else if (2)
|
|
|
|
|
true
|
|
|
|
|
// multi
|
|
|
|
|
// ple
|
|
|
|
|
// lines
|
|
|
|
|
else if (3)
|
|
|
|
|
// existing comment
|
|
|
|
|
true
|
|
|
|
|
// okay?
|
|
|
|
|
else if (4) {
|
|
|
|
|
// empty with existing comment
|
|
|
|
|
}
|
|
|
|
|
// comment
|
|
|
|
|
else {
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
if (1) {
|
|
|
|
|
// comment
|
|
|
|
|
false;
|
|
|
|
|
} else if (2)
|
|
|
|
|
// comment
|
|
|
|
|
true;
|
|
|
|
|
else if (3)
|
|
|
|
|
// multi
|
|
|
|
|
// ple
|
|
|
|
|
// lines
|
|
|
|
|
// existing comment
|
|
|
|
|
true;
|
|
|
|
|
else if (4) {
|
|
|
|
|
// okay?
|
|
|
|
|
// empty with existing comment
|
|
|
|
|
} else {
|
|
|
|
|
// comment
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`issues.js 1`] = `
|
2017-01-19 22:28:40 +03:00
|
|
|
|
"// 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({
|
|
|
|
|
code: acc.error.code, // Alias of errno
|
|
|
|
|
originalError: acc.error, // Just in case.
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Adding a comment stops the pretty printing process and everything is
|
|
|
|
|
// squished in a single line afterward
|
|
|
|
|
export type BuckWebSocketMessage = {
|
|
|
|
|
// Not actually from Buck - this is to let the receiver know that the socket is connected.
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'SocketConnected',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'BuildProgressUpdated',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
progressValue: number,
|
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'BuildFinished',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
exitCode: number,
|
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'BuildStarted',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'ParseStarted',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'ParseFinished',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'RunStarted',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'RunComplete',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Missing one level of indentation because of the comment
|
|
|
|
|
const rootEpic = (actions, store) => (
|
|
|
|
|
combineEpics(...epics)(actions, store)
|
|
|
|
|
// Log errors and continue.
|
|
|
|
|
.catch((err, stream) => {
|
|
|
|
|
getLogger().error(err);
|
|
|
|
|
return stream;
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Two extra levels of indentation because of the comment
|
|
|
|
|
export type AsyncExecuteOptions = child_process$execFileOpts & {
|
|
|
|
|
// The contents to write to stdin.
|
|
|
|
|
stdin?: ?string,
|
|
|
|
|
dontLogInNuclide?: ?boolean,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// optional trailing comma gets moved all the way to the beginning
|
|
|
|
|
const regex = new RegExp(
|
2017-02-22 00:59:19 +03:00
|
|
|
|
'^\\\\\\\\s*' + // beginning of the line
|
|
|
|
|
'name\\\\\\\\s*=\\\\\\\\s*' + // name =
|
|
|
|
|
'[\\\\'\\"]' + // opening quotation mark
|
2017-01-19 22:28:40 +03:00
|
|
|
|
escapeStringRegExp(target.name) + // target name
|
2017-02-22 00:59:19 +03:00
|
|
|
|
'[\\\\'\\"]' + // closing quotation mark
|
|
|
|
|
',?$', // optional trailing comma
|
2017-01-19 22:28:40 +03:00
|
|
|
|
);
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// The comment is moved and doesn't trigger the eslint rule anymore
|
|
|
|
|
import path from 'path'; // eslint-disable-line nuclide-internal/prefer-nuclide-uri
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments disappear in-between MemberExpressions
|
|
|
|
|
Observable.of(process)
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// Don't complete until we say so!
|
2017-01-19 22:28:40 +03:00
|
|
|
|
.merge(Observable.never())
|
|
|
|
|
// Get the errors.
|
|
|
|
|
.takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors)
|
|
|
|
|
.takeUntil(exit);
|
|
|
|
|
|
|
|
|
|
// Comments disappear inside of JSX
|
|
|
|
|
<div>
|
|
|
|
|
{/* Some comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
// Comments in JSX tag are placed in a non optimal way
|
|
|
|
|
<div
|
|
|
|
|
// comment
|
|
|
|
|
/>;
|
|
|
|
|
|
|
|
|
|
// Comments disappear in empty blocks
|
|
|
|
|
if (1) {
|
|
|
|
|
// Comment
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Comments trigger invalid JavaScript in-between else if
|
|
|
|
|
if (1) {
|
|
|
|
|
}
|
|
|
|
|
// Comment
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The comment makes the line break in a weird way
|
2017-02-22 00:59:19 +03:00
|
|
|
|
const result = asyncExecute('non_existing_command', /* args */ []);
|
2017-01-31 17:52:53 +03:00
|
|
|
|
|
|
|
|
|
// The closing paren is printed on the same line as the comment
|
|
|
|
|
foo({}
|
|
|
|
|
// Hi
|
|
|
|
|
);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// Does not need to break as it fits in 80 columns
|
2017-01-26 22:57:43 +03:00
|
|
|
|
this.call(a, /* comment */ b);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
function f(
|
|
|
|
|
someReallyLongArgument: WithSomeLongType,
|
|
|
|
|
someReallyLongArgument2: WithSomeLongType
|
2017-01-26 22:57:43 +03:00
|
|
|
|
) // Trailing comment should stay after
|
|
|
|
|
{
|
|
|
|
|
}
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments should either stay at the end of the line or always before, but
|
|
|
|
|
// not one before and one after.
|
|
|
|
|
throw new ProcessSystemError({
|
2017-01-26 22:57:43 +03:00
|
|
|
|
code: acc.error.code, // Alias of errno
|
|
|
|
|
originalError: acc.error // Just in case.
|
2017-01-19 22:28:40 +03:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Adding a comment stops the pretty printing process and everything is
|
|
|
|
|
// squished in a single line afterward
|
2017-01-27 05:41:50 +03:00
|
|
|
|
export type BuckWebSocketMessage =
|
|
|
|
|
| {
|
2017-02-13 20:03:56 +03:00
|
|
|
|
// Not actually from Buck - this is to let the receiver know that the socket is connected.
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"SocketConnected\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"BuildProgressUpdated\\",
|
2017-02-13 20:03:56 +03:00
|
|
|
|
progressValue: number
|
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"BuildFinished\\",
|
2017-02-13 20:03:56 +03:00
|
|
|
|
exitCode: number
|
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"BuildStarted\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"ParseStarted\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"ParseFinished\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"RunStarted\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"RunComplete\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
};
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Missing one level of indentation because of the comment
|
2017-02-13 20:05:18 +03:00
|
|
|
|
const rootEpic = (actions, store) => combineEpics(...epics)(actions, store)
|
|
|
|
|
// Log errors and continue.
|
|
|
|
|
.catch((err, stream) => {
|
|
|
|
|
getLogger().error(err);
|
|
|
|
|
return stream;
|
|
|
|
|
});
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Two extra levels of indentation because of the comment
|
2017-02-20 18:18:39 +03:00
|
|
|
|
export type AsyncExecuteOptions = child_process$execFileOpts & {
|
|
|
|
|
// The contents to write to stdin.
|
|
|
|
|
stdin?: ?string,
|
|
|
|
|
dontLogInNuclide?: ?boolean
|
|
|
|
|
};
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// optional trailing comma gets moved all the way to the beginning
|
|
|
|
|
const regex = new RegExp(
|
2017-02-22 00:59:19 +03:00
|
|
|
|
\\"^\\\\\\\\s*\\" + // beginning of the line
|
|
|
|
|
\\"name\\\\\\\\s*=\\\\\\\\s*\\" + // name =
|
|
|
|
|
\\"['\\\\\\"]\\" + // opening quotation mark
|
2017-01-27 22:03:44 +03:00
|
|
|
|
escapeStringRegExp(target.name) + // target name
|
2017-02-22 00:59:19 +03:00
|
|
|
|
\\"['\\\\\\"]\\" + // closing quotation mark
|
|
|
|
|
\\",?$\\" // optional trailing comma
|
2017-01-19 22:28:40 +03:00
|
|
|
|
);
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// The comment is moved and doesn't trigger the eslint rule anymore
|
|
|
|
|
import path from \\"path\\"; // eslint-disable-line nuclide-internal/prefer-nuclide-uri
|
2017-01-31 19:27:44 +03:00
|
|
|
|
|
2017-01-19 22:28:40 +03:00
|
|
|
|
// Comments disappear in-between MemberExpressions
|
2017-01-31 23:32:42 +03:00
|
|
|
|
Observable.of(process)
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// Don't complete until we say so!
|
2017-02-02 03:26:55 +03:00
|
|
|
|
.merge(Observable.never())
|
|
|
|
|
// Get the errors.
|
|
|
|
|
.takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors)
|
2017-01-31 23:32:42 +03:00
|
|
|
|
.takeUntil(exit);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
/* Comments disappear inside of JSX*/
|
|
|
|
|
<div>
|
2017-01-28 00:09:15 +03:00
|
|
|
|
{/* Some comment */}
|
2017-01-19 22:28:40 +03:00
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
/* Comments in JSX tag are placed in a non optimal way*/
|
|
|
|
|
<div
|
2017-01-24 21:54:01 +03:00
|
|
|
|
/* comment*/
|
|
|
|
|
/>;
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments disappear in empty blocks
|
|
|
|
|
if (1) {
|
2017-01-19 22:46:37 +03:00
|
|
|
|
// Comment
|
2017-01-19 22:28:40 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Comments trigger invalid JavaScript in-between else if
|
|
|
|
|
if (1) {
|
2017-02-02 03:23:49 +03:00
|
|
|
|
} else {
|
2017-01-26 22:57:43 +03:00
|
|
|
|
// Comment
|
2017-02-02 03:23:49 +03:00
|
|
|
|
}
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// The comment makes the line break in a weird way
|
2017-02-22 00:59:19 +03:00
|
|
|
|
const result = asyncExecute(\\"non_existing_command\\", /* args */ []);
|
2017-01-31 17:52:53 +03:00
|
|
|
|
|
|
|
|
|
// The closing paren is printed on the same line as the comment
|
|
|
|
|
foo(
|
|
|
|
|
{}
|
|
|
|
|
// Hi
|
|
|
|
|
);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`issues.js 2`] = `
|
2017-01-19 22:28:40 +03:00
|
|
|
|
"// 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({
|
|
|
|
|
code: acc.error.code, // Alias of errno
|
|
|
|
|
originalError: acc.error, // Just in case.
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Adding a comment stops the pretty printing process and everything is
|
|
|
|
|
// squished in a single line afterward
|
|
|
|
|
export type BuckWebSocketMessage = {
|
|
|
|
|
// Not actually from Buck - this is to let the receiver know that the socket is connected.
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'SocketConnected',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'BuildProgressUpdated',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
progressValue: number,
|
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'BuildFinished',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
exitCode: number,
|
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'BuildStarted',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'ParseStarted',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'ParseFinished',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'RunStarted',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
} | {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: 'RunComplete',
|
2017-01-19 22:28:40 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Missing one level of indentation because of the comment
|
|
|
|
|
const rootEpic = (actions, store) => (
|
|
|
|
|
combineEpics(...epics)(actions, store)
|
|
|
|
|
// Log errors and continue.
|
|
|
|
|
.catch((err, stream) => {
|
|
|
|
|
getLogger().error(err);
|
|
|
|
|
return stream;
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Two extra levels of indentation because of the comment
|
|
|
|
|
export type AsyncExecuteOptions = child_process$execFileOpts & {
|
|
|
|
|
// The contents to write to stdin.
|
|
|
|
|
stdin?: ?string,
|
|
|
|
|
dontLogInNuclide?: ?boolean,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// optional trailing comma gets moved all the way to the beginning
|
|
|
|
|
const regex = new RegExp(
|
2017-02-22 00:59:19 +03:00
|
|
|
|
'^\\\\\\\\s*' + // beginning of the line
|
|
|
|
|
'name\\\\\\\\s*=\\\\\\\\s*' + // name =
|
|
|
|
|
'[\\\\'\\"]' + // opening quotation mark
|
2017-01-19 22:28:40 +03:00
|
|
|
|
escapeStringRegExp(target.name) + // target name
|
2017-02-22 00:59:19 +03:00
|
|
|
|
'[\\\\'\\"]' + // closing quotation mark
|
|
|
|
|
',?$', // optional trailing comma
|
2017-01-19 22:28:40 +03:00
|
|
|
|
);
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// The comment is moved and doesn't trigger the eslint rule anymore
|
|
|
|
|
import path from 'path'; // eslint-disable-line nuclide-internal/prefer-nuclide-uri
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments disappear in-between MemberExpressions
|
|
|
|
|
Observable.of(process)
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// Don't complete until we say so!
|
2017-01-19 22:28:40 +03:00
|
|
|
|
.merge(Observable.never())
|
|
|
|
|
// Get the errors.
|
|
|
|
|
.takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors)
|
|
|
|
|
.takeUntil(exit);
|
|
|
|
|
|
|
|
|
|
// Comments disappear inside of JSX
|
|
|
|
|
<div>
|
|
|
|
|
{/* Some comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
// Comments in JSX tag are placed in a non optimal way
|
|
|
|
|
<div
|
|
|
|
|
// comment
|
|
|
|
|
/>;
|
|
|
|
|
|
|
|
|
|
// Comments disappear in empty blocks
|
|
|
|
|
if (1) {
|
|
|
|
|
// Comment
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Comments trigger invalid JavaScript in-between else if
|
|
|
|
|
if (1) {
|
|
|
|
|
}
|
|
|
|
|
// Comment
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The comment makes the line break in a weird way
|
2017-02-22 00:59:19 +03:00
|
|
|
|
const result = asyncExecute('non_existing_command', /* args */ []);
|
2017-01-31 17:52:53 +03:00
|
|
|
|
|
|
|
|
|
// The closing paren is printed on the same line as the comment
|
|
|
|
|
foo({}
|
|
|
|
|
// Hi
|
|
|
|
|
);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// Does not need to break as it fits in 80 columns
|
2017-01-26 22:57:43 +03:00
|
|
|
|
this.call(a, /* comment */ b);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
function f(
|
|
|
|
|
someReallyLongArgument: WithSomeLongType,
|
|
|
|
|
someReallyLongArgument2: WithSomeLongType
|
2017-01-26 22:57:43 +03:00
|
|
|
|
) // Trailing comment should stay after
|
|
|
|
|
{
|
|
|
|
|
}
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments should either stay at the end of the line or always before, but
|
|
|
|
|
// not one before and one after.
|
|
|
|
|
throw new ProcessSystemError({
|
2017-01-26 22:57:43 +03:00
|
|
|
|
code: acc.error.code, // Alias of errno
|
|
|
|
|
originalError: acc.error // Just in case.
|
2017-01-19 22:28:40 +03:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Adding a comment stops the pretty printing process and everything is
|
|
|
|
|
// squished in a single line afterward
|
2017-01-27 05:41:50 +03:00
|
|
|
|
export type BuckWebSocketMessage =
|
|
|
|
|
| {
|
2017-02-13 20:03:56 +03:00
|
|
|
|
// Not actually from Buck - this is to let the receiver know that the socket is connected.
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"SocketConnected\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"BuildProgressUpdated\\",
|
2017-02-13 20:03:56 +03:00
|
|
|
|
progressValue: number
|
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"BuildFinished\\",
|
2017-02-13 20:03:56 +03:00
|
|
|
|
exitCode: number
|
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"BuildStarted\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"ParseStarted\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"ParseFinished\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"RunStarted\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
}
|
2017-01-30 20:08:55 +03:00
|
|
|
|
| {
|
2017-02-22 00:59:19 +03:00
|
|
|
|
type: \\"RunComplete\\"
|
2017-02-13 20:03:56 +03:00
|
|
|
|
};
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Missing one level of indentation because of the comment
|
2017-02-13 20:05:18 +03:00
|
|
|
|
const rootEpic = (actions, store) => combineEpics(...epics)(actions, store)
|
|
|
|
|
// Log errors and continue.
|
|
|
|
|
.catch((err, stream) => {
|
|
|
|
|
getLogger().error(err);
|
|
|
|
|
return stream;
|
|
|
|
|
});
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Two extra levels of indentation because of the comment
|
2017-02-20 18:18:39 +03:00
|
|
|
|
export type AsyncExecuteOptions = child_process$execFileOpts & {
|
|
|
|
|
// The contents to write to stdin.
|
|
|
|
|
stdin?: ?string,
|
|
|
|
|
dontLogInNuclide?: ?boolean
|
|
|
|
|
};
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// optional trailing comma gets moved all the way to the beginning
|
|
|
|
|
const regex = new RegExp(
|
2017-02-22 00:59:19 +03:00
|
|
|
|
\\"^\\\\\\\\s*\\" + // beginning of the line
|
|
|
|
|
\\"name\\\\\\\\s*=\\\\\\\\s*\\" + // name =
|
|
|
|
|
\\"['\\\\\\"]\\" + // opening quotation mark
|
2017-01-27 22:03:44 +03:00
|
|
|
|
escapeStringRegExp(target.name) + // target name
|
2017-02-22 00:59:19 +03:00
|
|
|
|
\\"['\\\\\\"]\\" + // closing quotation mark
|
|
|
|
|
\\",?$\\" // optional trailing comma
|
2017-01-19 22:28:40 +03:00
|
|
|
|
);
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// The comment is moved and doesn't trigger the eslint rule anymore
|
|
|
|
|
import path from \\"path\\"; // eslint-disable-line nuclide-internal/prefer-nuclide-uri
|
2017-01-31 19:27:44 +03:00
|
|
|
|
|
2017-01-19 22:28:40 +03:00
|
|
|
|
// Comments disappear in-between MemberExpressions
|
2017-01-31 23:32:42 +03:00
|
|
|
|
Observable.of(process)
|
2017-02-22 00:59:19 +03:00
|
|
|
|
// Don't complete until we say so!
|
2017-02-02 03:26:55 +03:00
|
|
|
|
.merge(Observable.never())
|
|
|
|
|
// Get the errors.
|
|
|
|
|
.takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors)
|
2017-01-31 23:32:42 +03:00
|
|
|
|
.takeUntil(exit);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments disappear inside of JSX
|
|
|
|
|
<div>
|
2017-01-28 00:09:15 +03:00
|
|
|
|
{/* Some comment */}
|
2017-01-19 22:28:40 +03:00
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
// Comments in JSX tag are placed in a non optimal way
|
2017-01-26 22:57:43 +03:00
|
|
|
|
<div
|
|
|
|
|
// comment
|
2017-01-24 21:54:01 +03:00
|
|
|
|
/>;
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// Comments disappear in empty blocks
|
|
|
|
|
if (1) {
|
2017-01-19 22:46:37 +03:00
|
|
|
|
// Comment
|
2017-01-19 22:28:40 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Comments trigger invalid JavaScript in-between else if
|
|
|
|
|
if (1) {
|
2017-02-02 03:23:49 +03:00
|
|
|
|
} else {
|
2017-01-26 22:57:43 +03:00
|
|
|
|
// Comment
|
2017-02-02 03:23:49 +03:00
|
|
|
|
}
|
2017-01-19 22:28:40 +03:00
|
|
|
|
|
|
|
|
|
// The comment makes the line break in a weird way
|
2017-02-22 00:59:19 +03:00
|
|
|
|
const result = asyncExecute(\\"non_existing_command\\", /* args */ []);
|
2017-01-31 17:52:53 +03:00
|
|
|
|
|
|
|
|
|
// The closing paren is printed on the same line as the comment
|
|
|
|
|
foo(
|
|
|
|
|
{}
|
|
|
|
|
// Hi
|
|
|
|
|
);
|
2017-01-19 22:28:40 +03:00
|
|
|
|
"
|
|
|
|
|
`;
|
2017-02-04 00:56:06 +03:00
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`jsx.js 1`] = `
|
2017-02-04 00:56:06 +03:00
|
|
|
|
"<div>
|
2017-02-05 05:37:18 +03:00
|
|
|
|
{
|
|
|
|
|
/* comment */
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
2017-02-04 00:56:06 +03:00
|
|
|
|
{/* comment */
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{a/* comment
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment
|
|
|
|
|
*/
|
|
|
|
|
a
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-05 05:37:18 +03:00
|
|
|
|
<div>
|
2017-02-14 04:08:58 +03:00
|
|
|
|
{/* comment */}
|
2017-02-05 05:37:18 +03:00
|
|
|
|
</div>;
|
|
|
|
|
|
2017-02-04 00:56:06 +03:00
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment
|
|
|
|
|
*/}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{a /* comment
|
|
|
|
|
*/}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
/* comment
|
|
|
|
|
*/
|
|
|
|
|
a
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`jsx.js 2`] = `
|
2017-02-04 00:56:06 +03:00
|
|
|
|
"<div>
|
2017-02-05 05:37:18 +03:00
|
|
|
|
{
|
|
|
|
|
/* comment */
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
2017-02-04 00:56:06 +03:00
|
|
|
|
{/* comment */
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{a/* comment
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment
|
|
|
|
|
*/
|
|
|
|
|
a
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-05 05:37:18 +03:00
|
|
|
|
<div>
|
2017-02-14 04:08:58 +03:00
|
|
|
|
{/* comment */}
|
2017-02-05 05:37:18 +03:00
|
|
|
|
</div>;
|
|
|
|
|
|
2017-02-04 00:56:06 +03:00
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment
|
|
|
|
|
*/}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{a /* comment
|
|
|
|
|
*/}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
/* comment
|
|
|
|
|
*/
|
|
|
|
|
a
|
|
|
|
|
}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
{/* comment */}
|
|
|
|
|
</div>;
|
|
|
|
|
"
|
|
|
|
|
`;
|
2017-02-05 05:25:29 +03:00
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`preserve-new-line-last.js 1`] = `
|
2017-02-16 17:56:12 +03:00
|
|
|
|
"function f() {
|
|
|
|
|
a
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f() {
|
|
|
|
|
a
|
|
|
|
|
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function name() {
|
2017-02-07 20:41:49 +03:00
|
|
|
|
// comment1
|
|
|
|
|
func1()
|
|
|
|
|
|
|
|
|
|
// comment2
|
|
|
|
|
func2()
|
|
|
|
|
|
|
|
|
|
// comment3 why func3 commented
|
|
|
|
|
// func3()
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-16 17:56:12 +03:00
|
|
|
|
function f() {
|
|
|
|
|
a;
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f() {
|
|
|
|
|
a;
|
|
|
|
|
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-07 20:41:49 +03:00
|
|
|
|
function name() {
|
|
|
|
|
// comment1
|
|
|
|
|
func1();
|
|
|
|
|
|
|
|
|
|
// comment2
|
|
|
|
|
func2();
|
2017-02-16 17:56:12 +03:00
|
|
|
|
|
2017-02-07 20:41:49 +03:00
|
|
|
|
// comment3 why func3 commented
|
|
|
|
|
// func3()
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`preserve-new-line-last.js 2`] = `
|
2017-02-16 17:56:12 +03:00
|
|
|
|
"function f() {
|
|
|
|
|
a
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f() {
|
|
|
|
|
a
|
|
|
|
|
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function name() {
|
2017-02-07 20:41:49 +03:00
|
|
|
|
// comment1
|
|
|
|
|
func1()
|
|
|
|
|
|
|
|
|
|
// comment2
|
|
|
|
|
func2()
|
|
|
|
|
|
|
|
|
|
// comment3 why func3 commented
|
|
|
|
|
// func3()
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-16 17:56:12 +03:00
|
|
|
|
function f() {
|
|
|
|
|
a;
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f() {
|
|
|
|
|
a;
|
|
|
|
|
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-07 20:41:49 +03:00
|
|
|
|
function name() {
|
|
|
|
|
// comment1
|
|
|
|
|
func1();
|
|
|
|
|
|
|
|
|
|
// comment2
|
|
|
|
|
func2();
|
2017-02-16 17:56:12 +03:00
|
|
|
|
|
2017-02-07 20:41:49 +03:00
|
|
|
|
// comment3 why func3 commented
|
|
|
|
|
// func3()
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`return-statement.js 1`] = `
|
2017-02-14 05:35:42 +03:00
|
|
|
|
"function a() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
<div />
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function b() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
!!x
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function c() {
|
|
|
|
|
return 1337; // Comment
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
function a() {
|
|
|
|
|
return (
|
|
|
|
|
/* Comment*/
|
|
|
|
|
<div />
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function b() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
!!x
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function c() {
|
|
|
|
|
return 1337; // Comment
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`return-statement.js 2`] = `
|
2017-02-14 05:35:42 +03:00
|
|
|
|
"function a() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
<div />
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function b() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
!!x
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function c() {
|
|
|
|
|
return 1337; // Comment
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
function a() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
<div />
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function b() {
|
|
|
|
|
return (
|
|
|
|
|
// Comment
|
|
|
|
|
!!x
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function c() {
|
|
|
|
|
return 1337; // Comment
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`try.js 1`] = `
|
2017-02-05 05:25:29 +03:00
|
|
|
|
"// comment 1
|
|
|
|
|
try {
|
|
|
|
|
// comment 2
|
|
|
|
|
}
|
|
|
|
|
// comment 3
|
|
|
|
|
catch(e) {
|
|
|
|
|
// comment 4
|
|
|
|
|
}
|
|
|
|
|
// comment 5
|
|
|
|
|
finally // comment 6
|
|
|
|
|
{
|
|
|
|
|
// comment 7
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// comment 1
|
|
|
|
|
try {
|
|
|
|
|
// comment 2
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// comment 3
|
|
|
|
|
// comment 4
|
|
|
|
|
} finally { // comment 6
|
|
|
|
|
// comment 5
|
|
|
|
|
// comment 7
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
|
exports[`try.js 2`] = `
|
2017-02-05 05:25:29 +03:00
|
|
|
|
"// comment 1
|
|
|
|
|
try {
|
|
|
|
|
// comment 2
|
|
|
|
|
}
|
|
|
|
|
// comment 3
|
|
|
|
|
catch(e) {
|
|
|
|
|
// comment 4
|
|
|
|
|
}
|
|
|
|
|
// comment 5
|
|
|
|
|
finally // comment 6
|
|
|
|
|
{
|
|
|
|
|
// comment 7
|
|
|
|
|
}
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
// comment 1
|
|
|
|
|
try {
|
|
|
|
|
// comment 2
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// comment 3
|
|
|
|
|
// comment 4
|
|
|
|
|
} finally { // comment 6
|
|
|
|
|
// comment 5
|
|
|
|
|
// comment 7
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
`;
|