[WIP] TypeScript Parser (#915)

* WIP immediate feedback

* typescript parser is drop-in replacement for flow parser

* Add new TypeScript Parser snapshots where drop-in replacement possible

* Snapshot updates after rebasing

* Remove unnecessary stripping of properties on TypeScript parser AST

* Remove annotated issues

* Move TS dependencies to dev for now
master
James Henry 2017-03-08 21:18:13 +00:00 committed by Christopher Chedeau
parent dc2fa2cdd0
commit 72456bf06f
98 changed files with 3829 additions and 169 deletions

View File

@ -18,9 +18,15 @@ function guessLineEnding(text) {
}
function parse(text, opts) {
const parseFunction = opts.parser === "flow"
? parser.parseWithFlow
: parser.parseWithBabylon;
let parseFunction;
if (opts.parser === 'flow') {
parseFunction = parser.parseWithFlow;
} else if (opts.parser === 'typescript') {
parseFunction = parser.parseWithTypeScript;
} else {
parseFunction = parser.parseWithBabylon;
}
try {
return parseFunction(text);

View File

@ -35,7 +35,9 @@
"rollup-plugin-json": "2.1.0",
"rollup-plugin-node-builtins": "2.0.0",
"rollup-plugin-node-globals": "1.1.0",
"rollup-plugin-node-resolve": "2.0.0"
"rollup-plugin-node-resolve": "2.0.0",
"typescript": "2.2.1",
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#215a012ec4d272939fa5a57d0231d22fb7f7a9e0"
},
"scripts": {
"test": "jest",

View File

@ -54,4 +54,17 @@ function parseWithBabylon(text) {
});
}
module.exports = { parseWithFlow, parseWithBabylon };
function parseWithTypeScript(text) {
const parser = require('typescript-eslint-parser')
return parser.parse(text, {
loc: true,
range: true,
tokens: true,
attachComment: true,
ecmaFeatures: {
jsx: true,
}
})
}
module.exports = { parseWithFlow, parseWithBabylon, parseWithTypeScript };

View File

@ -8,3 +8,12 @@ exports[`multiple.js 1`] = `
[...a, ...b];
"
`;
exports[`multiple.js 2`] = `
"[...a, ...b,];
[...a, ...b];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[...a, ...b];
[...a, ...b];
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -13,6 +13,19 @@ exports[`last.js 1`] = `
"
`;
exports[`last.js 2`] = `
"[,];
[,,];
[,,1,];
[,,1,1];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[,];
[, ,];
[, , 1];
[, , 1, 1];
"
`;
exports[`preserve_empty_lines.js 1`] = `
"a = [
@ -30,3 +43,21 @@ exports[`preserve_empty_lines.js 1`] = `
a = [1, 2, 3, 4];
"
`;
exports[`preserve_empty_lines.js 2`] = `
"a = [
1,
2,
3,
4,
]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a = [1, 2, 3, 4];
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -88,3 +88,92 @@ var fnString = // Comment
var fnString = \\"some\\" + \\"long\\" + \\"string\\"; // Comment
"
`;
exports[`assignment_comments.js 2`] = `
"fnString =
// Comment
'some' + 'long' + 'string';
var fnString =
// Comment
'some' + 'long' + 'string';
var fnString =
// Comment
'some' + 'long' + 'string';
var fnString =
// Comment
'some' + 'long' + 'string';
var fnString =
/* comment */
'some' + 'long' + 'string';
var fnString =
/**
* multi-line
*/
'some' + 'long' + 'string';
var fnString =
/* inline */ 'some' + 'long' + 'string' + 'some' + 'long' + 'string' + 'some' + 'long' + 'string' + 'some' + 'long' + 'string';
var fnString = // Comment
// Comment
'some' + 'long' + 'string';
var fnString = // Comment
'some' + 'long' + 'string';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fnString =
// Comment
\\"some\\" + \\"long\\" + \\"string\\";
var fnString =
// Comment
\\"some\\" + \\"long\\" + \\"string\\";
var fnString =
// Comment
\\"some\\" + \\"long\\" + \\"string\\";
var fnString =
// Comment
\\"some\\" + \\"long\\" + \\"string\\";
var fnString =
/* comment */
\\"some\\" + \\"long\\" + \\"string\\";
var fnString =
/**
* multi-line
*/
\\"some\\" + \\"long\\" + \\"string\\";
var fnString = /* inline */ \\"some\\" +
\\"long\\" +
\\"string\\" +
\\"some\\" +
\\"long\\" +
\\"string\\" +
\\"some\\" +
\\"long\\" +
\\"string\\" +
\\"some\\" +
\\"long\\" +
\\"string\\";
var fnString = // Comment
// Comment
\\"some\\" + \\"long\\" + \\"string\\";
var fnString = \\"some\\" + \\"long\\" + \\"string\\"; // Comment
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -29,6 +29,35 @@ async function f() {
"
`;
exports[`await_parse.js 2`] = `
"async function f() { (await f()).length }
async function g() {
invariant(
(await driver.navigator.getUrl()).substr(-7)
);
}
function *f(){
!(yield a);
}
async function f() {
a = !(await f());
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
async function f() {
(await f()).length;
}
async function g() {
invariant((await driver.navigator.getUrl()).substr(-7));
}
function* f() {
!(yield a);
}
async function f() {
a = !await f();
}
"
`;
exports[`conditional-expression.js 1`] = `
"async function f() {
const result = typeof fn === 'function' ? await fn() : null;
@ -49,3 +78,24 @@ async function f() {
})();
"
`;
exports[`conditional-expression.js 2`] = `
"async function f() {
const result = typeof fn === 'function' ? await fn() : null;
}
(async function() {
console.log(
await (true ? Promise.resolve(\\"A\\") : Promise.resolve(\\"B\\"))
);
})()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
async function f() {
const result = typeof fn === \\"function\\" ? await fn() : null;
}
(async function() {
console.log(await (true ? Promise.resolve(\\"A\\") : Promise.resolve(\\"B\\")));
})();
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -18,6 +18,24 @@ const arr2 = [1, 2, 3, 4];
"
`;
exports[`array.js 3`] = `
"const arr1 = [1,2,3,4];
const arr2 = [1, 2, 3, 4];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const arr1 = [1, 2, 3, 4];
const arr2 = [1, 2, 3, 4];
"
`;
exports[`array.js 4`] = `
"const arr1 = [1,2,3,4];
const arr2 = [1, 2, 3, 4];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const arr1 = [1, 2, 3, 4];
const arr2 = [1, 2, 3, 4];
"
`;
exports[`object.js 1`] = `
"const obj1 = {a:1, b:2, c:3}
const obj2 = { a:1, b:2, c:3 };
@ -35,3 +53,21 @@ const obj1 = {a: 1, b: 2, c: 3};
const obj2 = {a: 1, b: 2, c: 3};
"
`;
exports[`object.js 3`] = `
"const obj1 = {a:1, b:2, c:3}
const obj2 = { a:1, b:2, c:3 };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const obj1 = { a: 1, b: 2, c: 3 };
const obj2 = { a: 1, b: 2, c: 3 };
"
`;
exports[`object.js 4`] = `
"const obj1 = {a:1, b:2, c:3}
const obj2 = { a:1, b:2, c:3 };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const obj1 = {a: 1, b: 2, c: 3};
const obj2 = {a: 1, b: 2, c: 3};
"
`;

View File

@ -1,3 +1,5 @@
run_spec(__dirname);
run_spec(__dirname, { bracketSpacing: false });
run_spec(__dirname, {parser: 'typescript'});
run_spec(__dirname, { parser: 'typescript', bracketSpacing: false });

View File

@ -79,3 +79,83 @@ expect(
).toEqualAtomLongLongLongLongRange(new LongLongLongRange([0, 0], [0, 0]));
"
`;
exports[`break.js 2`] = `
"h(f(g(() => {
a
})))
deepCopyAndAsyncMapLeavesA(
{ source: sourceValue, destination: destination[sourceKey] },
{ valueMapper, overwriteExistingKeys }
)
deepCopyAndAsyncMapLeavesB(
1337,
{ source: sourceValue, destination: destination[sourceKey] },
{ valueMapper, overwriteExistingKeys }
)
deepCopyAndAsyncMapLeavesC(
{ source: sourceValue, destination: destination[sourceKey] },
1337,
{ valueMapper, overwriteExistingKeys }
)
function someFunction(url) {
return get(url)
.then(
json => dispatch(success(json)),
error => dispatch(failed(error))
);
}
const mapChargeItems = fp.flow(
l => l < 10 ? l: 1,
l => Immutable.Range(l).toMap()
);
expect(new LongLongLongLongLongRange([0, 0], [0, 0])).toEqualAtomLongLongLongLongRange(new LongLongLongRange([0, 0], [0, 0]));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
h(
f(
g(() => {
a;
})
)
);
deepCopyAndAsyncMapLeavesA(
{ source: sourceValue, destination: destination[sourceKey] },
{ valueMapper, overwriteExistingKeys }
);
deepCopyAndAsyncMapLeavesB(
1337,
{ source: sourceValue, destination: destination[sourceKey] },
{ valueMapper, overwriteExistingKeys }
);
deepCopyAndAsyncMapLeavesC(
{ source: sourceValue, destination: destination[sourceKey] },
1337,
{ valueMapper, overwriteExistingKeys }
);
function someFunction(url) {
return get(url).then(
json => dispatch(success(json)),
error => dispatch(failed(error))
);
}
const mapChargeItems = fp.flow(
l => l < 10 ? l : 1,
l => Immutable.Range(l).toMap()
);
expect(
new LongLongLongLongLongRange([0, 0], [0, 0])
).toEqualAtomLongLongLongLongRange(new LongLongLongRange([0, 0], [0, 0]));
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -56,3 +56,60 @@ class A extends /* a */ B {}
(class A extends /* a */ B {});
"
`;
exports[`comments.js 2`] = `
"class A // comment 1
// comment 2
extends B {}
class A extends B // comment1
// comment2
// comment3
{}
class A /* a */ extends B {}
class A extends B /* a */ {}
class A extends /* a */ B {}
(class A // comment 1
// comment 2
extends B {});
(class A extends B // comment1
// comment2
// comment3
{});
(class A /* a */ extends B {});
(class A extends B /* a */ {});
(class A extends /* a */ B {});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// comment 1
// comment 2
class A extends B {}
// comment1
// comment2
// comment3
class A extends B {}
class A /* a */ extends B {}
class A extends B /* a */ {
}
class A extends /* a */ B {}
// comment 1
// comment 2
(class A extends B {});
// comment1
// comment2
// comment3
(class A extends B {});
(class A /* a */ extends B {});
(class A extends B /* a */ {
});
(class A extends /* a */ B {});
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -118,3 +118,122 @@ function* f() {
x = class extends (++b) {};
"
`;
exports[`extends.js 2`] = `
"// \\"ArrowFunctionExpression\\"
class a extends (() => {}) {}
// \\"AssignmentExpression\\"
class a extends (b = c) {}
// \\"AwaitExpression\\"
async function f() {
class a extends (await b) {}
}
// \\"BinaryExpression\\"
class a extends (b + c) {}
// \\"CallExpression\\"
class a extends b() {}
// \\"ClassExpression\\"
class a extends class {} {}
// \\"ConditionalExpression\\"
class a extends (b ? c : d) {}
// \\"FunctionExpression\\"
class a extends (function() {}) {}
// \\"LogicalExpression\\"
class a extends (b || c) {}
// \\"MemberExpression\\"
class a extends b.c {}
// \\"NewExpression\\"
class a extends (new B()) {}
// \\"ObjectExpression\\"
class a extends ({}) {}
// \\"SequenceExpression\\"
class a extends (b, c) {}
// \\"TaggedTemplateExpression\\"
class a extends \`\` {}
// \\"UnaryExpression\\"
class a extends (void b) {}
// \\"UpdateExpression\\"
class a extends (++b) {}
// \\"YieldExpression\\"
function* f() {
// Flow has a bug parsing it.
// class a extends (yield 1) {}
}
x = class extends (++b) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// \\"ArrowFunctionExpression\\"
class a extends (() => {}) {}
// \\"AssignmentExpression\\"
class a extends (b = c) {}
// \\"AwaitExpression\\"
async function f() {
class a extends (await b) {}
}
// \\"BinaryExpression\\"
class a extends (b + c) {}
// \\"CallExpression\\"
class a extends b() {}
// \\"ClassExpression\\"
class a extends class {} {}
// \\"ConditionalExpression\\"
class a extends (b ? c : d) {}
// \\"FunctionExpression\\"
class a extends function() {} {}
// \\"LogicalExpression\\"
class a extends (b || c) {}
// \\"MemberExpression\\"
class a extends b.c {}
// \\"NewExpression\\"
class a extends (new B()) {}
// \\"ObjectExpression\\"
class a extends ({}) {}
// \\"SequenceExpression\\"
class a extends (b, c) {}
// \\"TaggedTemplateExpression\\"
class a extends \`\` {}
// \\"UnaryExpression\\"
class a extends (void b) {}
// \\"UpdateExpression\\"
class a extends (++b) {}
// \\"YieldExpression\\"
function* f() {
// Flow has a bug parsing it.
// class a extends (yield 1) {}
}
x = class extends (++b) {};
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -10,3 +10,14 @@ class c {
}
"
`;
exports[`classes.js 2`] = `
"class c {
[\\"i\\"]() {}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class c {
[\\"i\\"]() {}
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -79,6 +79,85 @@ const { configureStore } = process.env.NODE_ENV === \\"production\\"
"
`;
exports[`comments.js 2`] = `
"var inspect = 4 === util.inspect.length
? // node <= 0.8.x
(function(v, colors) {
return util.inspect(v, void 0, void 0, colors);
})
: // node > 0.8.x
(function(v, colors) {
return util.inspect(v, { colors: colors });
});
var inspect = 4 === util.inspect.length
? // node <= 0.8.x
(function(v, colors) {
return util.inspect(v, void 0, void 0, colors);
})
: // node > 0.8.x
(function(v, colors) {
return util.inspect(v, { colors: colors });
});
const extractTextPluginOptions = shouldUseRelativeAssetPaths
// Making sure that the publicPath goes back to to build folder.
? { publicPath: Array(cssFilename.split('/').length).join('../') } :
{};
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") }
: {};
const extractTextPluginOptions = shouldUseRelativeAssetPaths // Making sure that the publicPath goes back to to build folder.
? { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") }
: {};
const { configureStore } = process.env.NODE_ENV === \\"production\\"
? require(\\"./configureProdStore\\") // a
: require(\\"./configureDevStore\\"); // b
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var inspect = 4 === util.inspect.length
? // node <= 0.8.x
function(v, colors) {
return util.inspect(v, void 0, void 0, colors);
}
: // node > 0.8.x
function(v, colors) {
return util.inspect(v, { colors: colors });
};
var inspect = 4 === util.inspect.length
? // node <= 0.8.x
function(v, colors) {
return util.inspect(v, void 0, void 0, colors);
}
: // node > 0.8.x
function(v, colors) {
return util.inspect(v, { colors: colors });
};
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") }
: {};
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") }
: {};
const extractTextPluginOptions = shouldUseRelativeAssetPaths // Making sure that the publicPath goes back to to build folder.
? { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") }
: {};
const { configureStore } = process.env.NODE_ENV === \\"production\\"
? require(\\"./configureProdStore\\") // a
: require(\\"./configureDevStore\\"); // b
"
`;
exports[`new-expression.js 1`] = `
"const testConsole = new TestConsole(
config.useStderr ? process.stderr : process.stdout
@ -89,3 +168,14 @@ const testConsole = new TestConsole(
);
"
`;
exports[`new-expression.js 2`] = `
"const testConsole = new TestConsole(
config.useStderr ? process.stderr : process.stdout
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const testConsole = new TestConsole(
config.useStderr ? process.stderr : process.stdout
);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -12,6 +12,12 @@ exports[`last-line-0.js 2`] = `
"
`;
exports[`last-line-0.js 3`] = `
"'use strict';~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\\"use strict\\";
"
`;
exports[`last-line-1.js 1`] = `
"'use strict';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -26,6 +32,13 @@ exports[`last-line-1.js 2`] = `
"
`;
exports[`last-line-1.js 3`] = `
"'use strict';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\\"use strict\\";
"
`;
exports[`last-line-2.js 1`] = `
"'use strict';
@ -42,6 +55,14 @@ exports[`last-line-2.js 2`] = `
"
`;
exports[`last-line-2.js 3`] = `
"'use strict';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\\"use strict\\";
"
`;
exports[`newline.js 1`] = `
"/* @flow */
@ -80,6 +101,25 @@ a();
"
`;
exports[`newline.js 3`] = `
"/* @flow */
\\"use strict\\";
import a from \\"a\\";
a();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* @flow */
\\"use strict\\";
import a from \\"a\\";
a();
"
`;
exports[`no-newline.js 1`] = `
"\\"use strict\\";
a
@ -98,6 +138,15 @@ a;
"
`;
exports[`no-newline.js 3`] = `
"\\"use strict\\";
a
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\\"use strict\\";
a;
"
`;
exports[`test.js 1`] = `
"\\"use strict\\";
@ -127,3 +176,18 @@ function fn() {
}
"
`;
exports[`test.js 3`] = `
"\\"use strict\\";
function fn() {
\\"use strict\\";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\\"use strict\\";
function fn() {
\\"use strict\\";
}
"
`;

View File

@ -1,2 +1,3 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});
run_spec(__dirname, {parser: 'babylon'});

View File

@ -21,3 +21,25 @@ do;
while (1);
"
`;
exports[`body.js 2`] = `
"with (a);
if (1); else if (2); else;
for (;;);
while (1);
for (var i in o);
for (var i of o);
do; while(1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
with (a);
if (1);
else if (2);
else;
for (;;);
while (1);
for (var i in o);
for (var i of o);
do;
while (1);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -54,6 +54,60 @@ export {fitsIn, oneLine};
"
`;
exports[`bracket.js 3`] = `
"export {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
};
export {fitsIn, oneLine};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
};
export { fitsIn, oneLine };
"
`;
exports[`bracket.js 4`] = `
"export {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
};
export {fitsIn, oneLine};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
};
export {fitsIn, oneLine};
"
`;
exports[`empty.js 1`] = `
"export {};
export {} from \\".\\";
@ -71,3 +125,21 @@ export {};
export {} from \\".\\";
"
`;
exports[`empty.js 3`] = `
"export {};
export {} from \\".\\";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export {};
export {} from \\".\\";
"
`;
exports[`empty.js 4`] = `
"export {};
export {} from \\".\\";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export {};
export {} from \\".\\";
"
`;

View File

@ -1,2 +1,5 @@
run_spec(__dirname);
run_spec(__dirname, {bracketSpacing: false});
run_spec(__dirname, {parser: 'typescript'});
run_spec(__dirname, {parser: 'typescript', bracketSpacing: false});

View File

@ -6,3 +6,10 @@ exports[`body.js 1`] = `
export default (class {}[1] = 1);
"
`;
exports[`body.js 2`] = `
"export default (class {}[1] = 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export default (class {}[1] = 1);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -12,3 +12,16 @@ export {
} from \\"exports\\";
"
`;
exports[`test.js 2`] = `
"export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export {
value1,
value2 as value2_renamed,
value3,
value4 as value4_renamed,
value5
} from \\"exports\\";
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -11,6 +11,17 @@ for (var i = 0; i < 10; ++i) {
"
`;
exports[`for.js 2`] = `
"for (;;) {}
for (var i = 0; i < 10; ++i) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (;;) {
}
for (var i = 0; i < 10; ++i) {
}
"
`;
exports[`in.js 1`] = `
"for ((x in a);;) {}
for (a=(a in b);;) {}
@ -22,6 +33,17 @@ for (a = (a in b); ; ) {
"
`;
exports[`in.js 2`] = `
"for ((x in a);;) {}
for (a=(a in b);;) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for ((x in a); ; ) {
}
for (a = (a in b); ; ) {
}
"
`;
exports[`var.js 1`] = `
"for (a in b) var c = {}; [];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -30,3 +52,12 @@ for (a in b)
[];
"
`;
exports[`var.js 2`] = `
"for (a in b) var c = {}; [];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (a in b)
var c = {};
[];
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -26,3 +26,30 @@ a + function() {};
new function() {}();
"
`;
exports[`function_expression.js 2`] = `
"(function() {}).length
typeof (function() {});
export default (function() {})();
(function() {})()\`\`;
(function() {})\`\`;
new (function() {});
(function() {});
a = function f() {} || b;
(function() {} && a);
a + function() {};
new function() {};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(function() {}.length);
typeof function() {};
export default (function() {})();
(function() {})()\`\`;
(function() {})\`\`;
new function() {}();
(function() {});
a = function f() {} || b;
(function() {} && a);
a + function() {};
new function() {}();
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -73,3 +73,77 @@ async function f() {
}
"
`;
exports[`if_comments.js 2`] = `
"async function f() {
if (untrackedChoice === 0) /* Cancel */ {
return null;
} else if (untrackedChoice === 1) /* Add */ {
await repository.addAll(Array.from(untrackedChanges.keys()));
shouldAmend = true;
} else if (untrackedChoice === 2) /* Allow Untracked */ {
allowUntracked = true;
}
}
async function f() {
if (untrackedChoice === 0)
/* Cancel */ {
return null;
}
else if (untrackedChoice === 1)
/* Add */ {
await repository.addAll(Array.from(untrackedChanges.keys()));
shouldAmend = true;
}
else if (untrackedChoice === 2)
/* Allow Untracked */ {
allowUntracked = true;
}
}
async function f() {
if (untrackedChoice === 0) {
/* Cancel */ return null;
} else if (untrackedChoice === 1) {
/* Add */ await repository.addAll(Array.from(untrackedChanges.keys()));
shouldAmend = true;
} else if (untrackedChoice === 2) {
/* Allow Untracked */ allowUntracked = true;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
async function f() {
if (untrackedChoice === 0) {
/* Cancel */ return null;
} else if (untrackedChoice === 1) {
/* Add */ await repository.addAll(Array.from(untrackedChanges.keys()));
shouldAmend = true;
} else if (untrackedChoice === 2) {
/* Allow Untracked */ allowUntracked = true;
}
}
async function f() {
if (untrackedChoice === 0) {
/* Cancel */ return null;
} else if (untrackedChoice === 1) {
/* Add */ await repository.addAll(Array.from(untrackedChanges.keys()));
shouldAmend = true;
} else if (untrackedChoice === 2) {
/* Allow Untracked */ allowUntracked = true;
}
}
async function f() {
if (untrackedChoice === 0) {
/* Cancel */ return null;
} else if (untrackedChoice === 1) {
/* Add */ await repository.addAll(Array.from(untrackedChanges.keys()));
shouldAmend = true;
} else if (untrackedChoice === 2) {
/* Allow Untracked */ allowUntracked = true;
}
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -54,6 +54,60 @@ import {fitsIn, oneLine} from \\".\\";
"
`;
exports[`brackets.js 3`] = `
"import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from '.';
import {fitsIn, oneLine} from '.';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from \\".\\";
import { fitsIn, oneLine } from \\".\\";
"
`;
exports[`brackets.js 4`] = `
"import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from '.';
import {fitsIn, oneLine} from '.';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from \\".\\";
import {fitsIn, oneLine} from \\".\\";
"
`;
exports[`comments.js 1`] = `
"import { a //comment1
//comment2
@ -156,6 +210,108 @@ import {
"
`;
exports[`comments.js 3`] = `
"import { a //comment1
//comment2
//comment3
as b} from \\"\\";
import {
a as //comment1
//comment2
//comment3
b
} from \\"\\";
import {
a as //comment2 //comment1
//comment3
b
} from \\"\\";
import {
a as //comment3 //comment2 //comment1
b
} from \\"\\";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import {
//comment1
//comment2
//comment3
a as b
} from \\"\\";
import {
//comment1
//comment2
//comment3
a as b
} from \\"\\";
import {
//comment2 //comment1
//comment3
a as b
} from \\"\\";
import {
//comment3 //comment2 //comment1
a as b
} from \\"\\";
"
`;
exports[`comments.js 4`] = `
"import { a //comment1
//comment2
//comment3
as b} from \\"\\";
import {
a as //comment1
//comment2
//comment3
b
} from \\"\\";
import {
a as //comment2 //comment1
//comment3
b
} from \\"\\";
import {
a as //comment3 //comment2 //comment1
b
} from \\"\\";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import {
//comment1
//comment2
//comment3
a as b
} from \\"\\";
import {
//comment1
//comment2
//comment3
a as b
} from \\"\\";
import {
//comment2 //comment1
//comment3
a as b
} from \\"\\";
import {
//comment3 //comment2 //comment1
a as b
} from \\"\\";
"
`;
exports[`long-line.js 1`] = `
"import someCoolUtilWithARatherLongName from '../../../../utils/someCoolUtilWithARatherLongName';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -172,6 +328,22 @@ import someCoolUtilWithARatherLongName
"
`;
exports[`long-line.js 3`] = `
"import someCoolUtilWithARatherLongName from '../../../../utils/someCoolUtilWithARatherLongName';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import someCoolUtilWithARatherLongName
from \\"../../../../utils/someCoolUtilWithARatherLongName\\";
"
`;
exports[`long-line.js 4`] = `
"import someCoolUtilWithARatherLongName from '../../../../utils/someCoolUtilWithARatherLongName';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import someCoolUtilWithARatherLongName
from \\"../../../../utils/someCoolUtilWithARatherLongName\\";
"
`;
exports[`multiple_standalones.js 1`] = `
"import a, * as b from 'a';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -185,3 +357,17 @@ exports[`multiple_standalones.js 2`] = `
import a, * as b from \\"a\\";
"
`;
exports[`multiple_standalones.js 3`] = `
"import a, * as b from 'a';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import a, * as b from \\"a\\";
"
`;
exports[`multiple_standalones.js 4`] = `
"import a, * as b from 'a';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import a, * as b from \\"a\\";
"
`;

View File

@ -1,2 +1,5 @@
run_spec(__dirname);
run_spec(__dirname, {bracketSpacing: false});
run_spec(__dirname, {parser: 'typescript'});
run_spec(__dirname, {parser: 'typescript', bracketSpacing: false});

View File

@ -128,3 +128,132 @@ it.only.only(
);
"
`;
exports[`it.js 2`] = `
"// Shouldn't break
it(\\"does something really long and complicated so I have to write a very long name for the test\\", () => {
console.log(\\"hello!\\");
});
it(\\"does something really long and complicated so I have to write a very long name for the test\\", function() {
console.log(\\"hello!\\");
});
it(\`does something really long and complicated so I have to write a very long name for the test\`, function() {
console.log(\\"hello!\\");
});
it(\`{foo + bar} does something really long and complicated so I have to write a very long name for the test\`, function() {
console.log(\\"hello!\\");
});
it(\`handles
some
newlines
does something really long and complicated so I have to write a very long name for the test\`, () => {
console.log(\\"hello!\\");
})
test(\\"does something really long and complicated so I have to write a very long name for the test\\", (done) => {
console.log(\\"hello!\\");
});
test(\`does something really long and complicated so I have to write a very long name for the test\`, (done) => {
console.log(\\"hello!\\");
});
// Should break
it.only(\\"does something really long and complicated so I have to write a very long name for the test\\", () => {
console.log(\\"hello!\\");
});
it.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {
console.log(\\"hello!\\");
});
it.only(\\"does something really long and complicated so I have to write a very long name for the test\\", 10, () => {
console.log(\\"hello!\\");
});
it.only.only(\\"does something really long and complicated so I have to write a very long name for the test\\", () => {
console.log(\\"hello!\\");
});
it.only.only(\\"does something really long and complicated so I have to write a very long name for the test\\", (a, b, c) => {
console.log(\\"hello!\\");
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shouldn't break
it(\\"does something really long and complicated so I have to write a very long name for the test\\", () => {
console.log(\\"hello!\\");
});
it(\\"does something really long and complicated so I have to write a very long name for the test\\", function() {
console.log(\\"hello!\\");
});
it(\`does something really long and complicated so I have to write a very long name for the test\`, function() {
console.log(\\"hello!\\");
});
it(\`{foo + bar} does something really long and complicated so I have to write a very long name for the test\`, function() {
console.log(\\"hello!\\");
});
it(\`handles
some
newlines
does something really long and complicated so I have to write a very long name for the test\`, () => {
console.log(\\"hello!\\");
});
test(\\"does something really long and complicated so I have to write a very long name for the test\\", done => {
console.log(\\"hello!\\");
});
test(\`does something really long and complicated so I have to write a very long name for the test\`, done => {
console.log(\\"hello!\\");
});
// Should break
it.only(
\\"does something really long and complicated so I have to write a very long name for the test\\",
() => {
console.log(\\"hello!\\");
}
);
it.only(
\`does something really long and complicated so I have to write a very long name for the test\`,
() => {
console.log(\\"hello!\\");
}
);
it.only(
\\"does something really long and complicated so I have to write a very long name for the test\\",
10,
() => {
console.log(\\"hello!\\");
}
);
it.only.only(
\\"does something really long and complicated so I have to write a very long name for the test\\",
() => {
console.log(\\"hello!\\");
}
);
it.only.only(
\\"does something really long and complicated so I have to write a very long name for the test\\",
(a, b, c) => {
console.log(\\"hello!\\");
}
);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -52,3 +52,56 @@ const comp4 = (
const comp5 = <div>Keep it on one line.</div>;
"
`;
exports[`test.js 2`] = `
"const comp1 = (
<div style={styles} key=\\"something\\">
Keep the wrapping parens.
</div>
);
const comp2 = <div style={styles} key=\\"something\\">
Create wrapping parens.
</div>;
comp2A = <div style={styles} key=\\"something\\">
Create wrapping parens.
</div>;
const comp3 = <div style={styles} key=\\"something\\">Bump to next line without parens</div>;
const comp4 = <div style={styles} key=\\"something\\">Create wrapping parens and indent <strong>all the things</strong>.</div>;
const comp5 = <div>Keep it on one line.</div>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const comp1 = (
<div style={styles} key=\\"something\\">
Keep the wrapping parens.
</div>
);
const comp2 = (
<div style={styles} key=\\"something\\">
Create wrapping parens.
</div>
);
comp2A = (
<div style={styles} key=\\"something\\">
Create wrapping parens.
</div>
);
const comp3 = (
<div style={styles} key=\\"something\\">Bump to next line without parens</div>
);
const comp4 = (
<div style={styles} key=\\"something\\">
Create wrapping parens and indent <strong>all the things</strong>.
</div>
);
const comp5 = <div>Keep it on one line.</div>;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -187,3 +187,191 @@ regression_extra_newline_2 = (
);
"
`;
exports[`test.js 2`] = `
"keep = <p>
Welcome to the <strong>Universal React Starter-kyt</strong>.
This starter kyt should serve as the base for an advanced,
server-rendered React app.
</p>
newlines_text =
<div>
hi
there
how
are you
are you fine today?
</div>
newlines_text_spaced =
<div>
space above
space below
</div>
newlines_elems_spaced =
<div>
<span>space above</span>
<span>space below</span>
</div>
newlines_mixed =
<div>
hi
<span>there</span>
how
are <strong>you</strong>
are you fine today?
</div>
newlines_elems =
<div>
<div>
<div></div>
</div>
hi
<div></div>
<span />
<Big />
</div>
regression_extra_newline = (
<div>
<span
className=\\"nuclide-console-new-messages-notification-icon icon icon-nuclicon-arrow-down\\"
/>
New Messages
</div>
);
regression_extra_newline_2 = (
<div>
(
<FormattedMessage
id=\\"some-id\\"
defaultMessage=\\"some loooooooooooooooooooooooooooong default\\"
/>
)
</div>
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
keep = (
<p>
Welcome to the <strong>Universal React Starter-kyt</strong>.
This starter kyt should serve as the base for an advanced,
server-rendered React app.
</p>
);
newlines_text = (
<div>
hi
there
how
are you
are you fine today?
</div>
);
newlines_text_spaced = (
<div>
space above
space below
</div>
);
newlines_elems_spaced = (
<div>
<span>space above</span>
<span>space below</span>
</div>
);
newlines_mixed = (
<div>
hi
<span>there</span>
how
are <strong>you</strong>
are you fine today?
</div>
);
newlines_elems = (
<div>
<div>
<div />
</div>
hi
<div />
<span />
<Big />
</div>
);
regression_extra_newline = (
<div>
<span className=\\"nuclide-console-new-messages-notification-icon icon icon-nuclicon-arrow-down\\" />
New Messages
</div>
);
regression_extra_newline_2 = (
<div>
(
<FormattedMessage
id=\\"some-id\\"
defaultMessage=\\"some loooooooooooooooooooooooooooong default\\"
/>
)
</div>
);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -198,3 +198,202 @@ not_broken_begin = (
);
"
`;
exports[`test.js 2`] = `
"after =
<span>
foo <span>bar</span>
</span>
before =
<span>
<span>bar</span> foo
</span>
before_break1 =
<span>
<span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar /> foo
</span>
before_break2 =
<span>
<span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar /> foo
</span>
after_break =
<span>
foo <span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar />
</span>
within =
<span>
foo <span> bar </span>
</span>
break_components =
<div>
<Foo />
<Bar>
<p>foo<span>bar bar bar</span></p><h1><span><em>yep</em></span></h1>
</Bar>
<h2>nope</h2>
</div>
var x = <div>
hello <strong>hi</strong> <foo>sdkflsdfjk</foo>
</div>;
nest_plz =
<div>
<div>
<div></div>
</div>
</div>
regression_not_transformed_1 =
<span> <Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" /></span>;
regression_not_transformed_2 =
<span><Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" /> </span>;
similar_1 =
<span> <Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" /></span>;
similar_2 =
<span><Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" /> </span>;
similar_3 =
<span><Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" /> <Icon icon=\\"\\" /></span>;
not_broken_end =
<div>
long text long text long text long text long text long text long text long text <link>url</link> long text long text
</div>
not_broken_begin =
<div>
<br /> long text long text long text long text long text long text long text long text<link>url</link> long text long text
</div>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
after = (
<span>
foo <span>bar</span>
</span>
);
before = (
<span>
<span>bar</span> foo
</span>
);
before_break1 = (
<span>
<span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar />
{\\" \\"}
foo
</span>
);
before_break2 = (
<span>
<span
barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar
/>
{\\" \\"}
foo
</span>
);
after_break = (
<span>
foo
{\\" \\"}
<span barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar />
</span>
);
within = (
<span>
foo <span> bar </span>
</span>
);
break_components = (
<div>
<Foo />
<Bar>
<p>foo<span>bar bar bar</span></p><h1><span><em>yep</em></span></h1>
</Bar>
<h2>nope</h2>
</div>
);
var x = (
<div>
hello <strong>hi</strong> <foo>sdkflsdfjk</foo>
</div>
);
nest_plz = (
<div>
<div>
<div />
</div>
</div>
);
regression_not_transformed_1 = (
<span>
{\\" \\"}<Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" />
</span>
);
regression_not_transformed_2 = (
<span>
<Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" />{\\" \\"}
</span>
);
similar_1 = (
<span>
{\\" \\"}
<Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" />
</span>
);
similar_2 = (
<span>
<Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" />
{\\" \\"}
</span>
);
similar_3 = (
<span>
<Icon icon=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\" /> <Icon icon=\\"\\" />
</span>
);
not_broken_end = (
<div>
long text long text long text long text long text long text long text long text
{\\" \\"}
<link>url</link>
{\\" \\"}
long text long text
</div>
);
not_broken_begin = (
<div>
<br />
{\\" \\"}
long text long text long text long text long text long text long text long text
<link>url</link>
{\\" \\"}
long text long text
</div>
);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -212,3 +212,216 @@ long_obj = (
);
"
`;
exports[`test.js 2`] = `
"long_closed =
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"/>
long_open =
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">
hello
</BaseForm>
long_open_long_children =
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">
Hello world
</BaseForm>
<div><div><div><div><div><div>hey hiya how are ya</div></div></div></div></div></div>
<div><div><div><div attr=\\"long\\" attr2=\\"also long\\" attr3=\\"gonna break\\"></div></div></div></div>
<div><div><div>
<div attr=\\"long\\" attr2=\\"also long\\" attr3=\\"gonna break\\" attr4=\\"hello please break me\\" />
</div></div></div>
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"><BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"></BaseForm>d</BaseForm>
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"><BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"></BaseForm></BaseForm>
</BaseForm>
short_closed =
<BaseForm url=\\"/auth/google\\" method=\\"GET\\"/>
short_open =
<BaseForm url=\\"/auth/google\\" method=\\"GET\\">
hello
</BaseForm>
make_self_closing =
<div>
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">
</BaseForm>
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"></BaseForm>
</div>
leave_opening =
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\"> </BaseForm>
long_string =
<div className=\\"i use bootstrap and just put loooaads of classnames in here all the time\\">hello world</div>
long_string_with_extra_param =
<div className=\\"i use bootstrap and just put loooaads of classnames in here all the time\\" blah=\\"3\\">hello world</div>
long_obj =
<div style={{ i: 'dont', use: 'bootstrap', and: 'instead', use: 'massive', objects }}>hello world</div>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
long_closed = (
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
/>
);
long_open = (
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
hello
</BaseForm>
);
long_open_long_children = (
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
Hello world
</BaseForm>
<div>
<div><div><div><div><div>hey hiya how are ya</div></div></div></div></div>
</div>
<div>
<div>
<div><div attr=\\"long\\" attr2=\\"also long\\" attr3=\\"gonna break\\" /></div>
</div>
</div>
<div>
<div>
<div>
<div
attr=\\"long\\"
attr2=\\"also long\\"
attr3=\\"gonna break\\"
attr4=\\"hello please break me\\"
/>
</div>
</div>
</div>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
/>
d
</BaseForm>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
/>
</BaseForm>
</BaseForm>
);
short_closed = <BaseForm url=\\"/auth/google\\" method=\\"GET\\" />;
short_open = (
<BaseForm url=\\"/auth/google\\" method=\\"GET\\">
hello
</BaseForm>
);
make_self_closing = (
<div>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
/>
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
/>
</div>
);
leave_opening = (
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
{\\" \\"}
</BaseForm>
);
long_string = (
<div className=\\"i use bootstrap and just put loooaads of classnames in here all the time\\">
hello world
</div>
);
long_string_with_extra_param = (
<div
className=\\"i use bootstrap and just put loooaads of classnames in here all the time\\"
blah=\\"3\\"
>
hello world
</div>
);
long_obj = (
<div
style={{
i: \\"dont\\",
use: \\"bootstrap\\",
and: \\"instead\\",
use: \\"massive\\",
objects
}}
>
hello world
</div>
);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -232,3 +232,236 @@ const renderTernary = props => (
);
"
`;
exports[`test.js 2`] = `
"const render1 = ({ styles }) => (
<div style={styles} key=\\"something\\">
Keep the wrapping parens. Put each key on its own line.
</div>
);
const render2 = ({ styles }) => <div style={styles} key=\\"something\\">
Create wrapping parens.
</div>;
const render3 = ({ styles }) => <div style={styles} key=\\"something\\">Bump to next line without parens</div>;
const render4 = ({ styles }) => <div style={styles} key=\\"something\\">Create wrapping parens and indent <strong>all the things</strong>.</div>;
const render5 = ({ styles }) => <div>Keep it on one line.</div>;
const render6 = ({ styles }) => (
<div attr1=\\"aaaaaaaaaaaaaaaaa\\" attr2=\\"bbbbbbbbbbb\\" attr3=\\"cccccccccccc\\">
<div attr1=\\"aaaaaaaaaaaaaaaaa\\" attr2=\\"bbbbbbbbbbb\\" attr3=\\"cccccccccccc\\" attr4>ddd d dd d d dddd dddd <strong>hello</strong></div>
<div attr1=\\"aaaaaaaaaaaaaaaaa\\" attr2=\\"bbbbbbbbbbb\\" attr3=\\"cccccccccccc\\" attr4>ddd d dd d d dddd dddd <strong>hello</strong></div>
<div attr1=\\"aaaaaaaaaaaaaaaaa\\" attr2=\\"bbbbbbbbbbb\\" attr3=\\"cccccccccccc\\" attr4>
<div attr1=\\"aaaaaaaaaaaaaaaaa\\" attr2=\\"bbbbbbbbbbb\\" attr3=\\"cccccccccccc\\" attr4>ddd d dd d d dddd dddd <strong>hello</strong></div> <strong>hello</strong></div>
</div>
)
const render7 = () =>
<div>
<span /><span>Dont break each elem onto its own line.</span> <span />
<div /> <div />
</div>
const render7A = () => (
<div>
<div /><div /><div />
</div>
)
const render7B = () => (
<div>
<span> <span/> Dont break plz</span>
<span><span/>Dont break plz</span>
<span>Dont break plz<span/></span>
</div>
)
const render8 = (props) => <div>{props.text}</div>
const render9 = (props) => <div>{props.looooooooooooooooooooooooooooooong_text}</div>
const render10 = (props) => <div>{props.even_looooooooooooooooooooooooooooooooooooooooooonger_contents}</div>
const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => this.someLongCallWithParams(aaaaaa, bbbbbbb).anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd)
React.render(
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\" />
, document.querySelector('#react-root')
)
const renderTernary = (props) =>
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">
{props.showTheThing ?
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">Hello world</BaseForm>
: \\"hello \\" + \\"howdy! \\"}
{props.showTheThing ?
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">Hello world</BaseForm>
:
null
}
{props.showTheThing ? null :
<BaseForm url=\\"/auth/google\\" method=\\"GET\\" colour=\\"blue\\" size=\\"large\\" submitLabel=\\"Sign in with Google\\">Hello world</BaseForm>
}
{props.showTheOtherThing ? <div>I am here</div> : <div attr=\\"blah\\" />}
{props.showTheOtherThing ? <div>I am here!!</div> : null}
</BaseForm>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const render1 = ({ styles }) => (
<div style={styles} key=\\"something\\">
Keep the wrapping parens. Put each key on its own line.
</div>
);
const render2 = ({ styles }) => (
<div style={styles} key=\\"something\\">
Create wrapping parens.
</div>
);
const render3 = ({ styles }) => (
<div style={styles} key=\\"something\\">Bump to next line without parens</div>
);
const render4 = ({ styles }) => (
<div style={styles} key=\\"something\\">
Create wrapping parens and indent <strong>all the things</strong>.
</div>
);
const render5 = ({ styles }) => <div>Keep it on one line.</div>;
const render6 = ({ styles }) => (
<div attr1=\\"aaaaaaaaaaaaaaaaa\\" attr2=\\"bbbbbbbbbbb\\" attr3=\\"cccccccccccc\\">
<div
attr1=\\"aaaaaaaaaaaaaaaaa\\"
attr2=\\"bbbbbbbbbbb\\"
attr3=\\"cccccccccccc\\"
attr4
>
ddd d dd d d dddd dddd <strong>hello</strong>
</div>
<div
attr1=\\"aaaaaaaaaaaaaaaaa\\"
attr2=\\"bbbbbbbbbbb\\"
attr3=\\"cccccccccccc\\"
attr4
>
ddd d dd d d dddd dddd <strong>hello</strong>
</div>
<div
attr1=\\"aaaaaaaaaaaaaaaaa\\"
attr2=\\"bbbbbbbbbbb\\"
attr3=\\"cccccccccccc\\"
attr4
>
<div
attr1=\\"aaaaaaaaaaaaaaaaa\\"
attr2=\\"bbbbbbbbbbb\\"
attr3=\\"cccccccccccc\\"
attr4
>
ddd d dd d d dddd dddd <strong>hello</strong>
</div>
{\\" \\"}
<strong>hello</strong>
</div>
</div>
);
const render7 = () => (
<div>
<span /><span>Dont break each elem onto its own line.</span> <span />
<div /> <div />
</div>
);
const render7A = () => (
<div>
<div /><div /><div />
</div>
);
const render7B = () => (
<div>
<span> <span /> Dont break plz</span>
<span><span />Dont break plz</span>
<span>Dont break plz<span /></span>
</div>
);
const render8 = props => <div>{props.text}</div>;
const render9 = props => (
<div>{props.looooooooooooooooooooooooooooooong_text}</div>
);
const render10 = props => (
<div>
{props.even_looooooooooooooooooooooooooooooooooooooooooonger_contents}
</div>
);
const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) =>
this.someLongCallWithParams(aaaaaa, bbbbbbb).anotherLongCallWithParams(
cccccccccccc,
dddddddddddddddddddddd
);
React.render(
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
/>,
document.querySelector(\\"#react-root\\")
);
const renderTernary = props => (
<BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
{props.showTheThing
? <BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
Hello world
</BaseForm>
: \\"hello \\" + \\"howdy! \\"}
{props.showTheThing
? <BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
Hello world
</BaseForm>
: null}
{props.showTheThing
? null
: <BaseForm
url=\\"/auth/google\\"
method=\\"GET\\"
colour=\\"blue\\"
size=\\"large\\"
submitLabel=\\"Sign in with Google\\"
>
Hello world
</BaseForm>}
{props.showTheOtherThing ? <div>I am here</div> : <div attr=\\"blah\\" />}
{props.showTheOtherThing ? <div>I am here!!</div> : null}
</BaseForm>
);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -139,6 +139,145 @@ exports[`expression.js 1`] = `
"
`;
exports[`expression.js 2`] = `
"<View
style={
{
someVeryLongStyle1: \\"true\\",
someVeryLongStyle2: \\"true\\",
someVeryLongStyle3: \\"true\\",
someVeryLongStyle4: \\"true\\"
}
}
/>;
<View
style={
[
{
someVeryLongStyle1: \\"true\\",
someVeryLongStyle2: \\"true\\",
someVeryLongStyle3: \\"true\\",
someVeryLongStyle4: \\"true\\"
}
]
}
/>;
<Something>
{() => (
<SomethingElse>
<span />
</SomethingElse>
)}
</Something>;
<Something>
{items.map(item => (
<SomethingElse>
<span />
</SomethingElse>
))}
</Something>;
<Something>
{function() {
return (
<SomethingElse>
<span />
</SomethingElse>
);
}}
</Something>;
<RadioListItem
key={option}
imageSource={this.props.veryBigItemImageSourceFunc &&
this.props.veryBigItemImageSourceFunc(option)}
imageSize={this.props.veryBigItemImageSize}
imageView={this.props.veryBigItemImageViewFunc &&
this.props.veryBigItemImageViewFunc(option)}
heading={this.props.displayTextFunc(option)}
value={option}
/>;
<ParentComponent prop={
<Child>
test
</Child>
}/>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<View
style={{
someVeryLongStyle1: \\"true\\",
someVeryLongStyle2: \\"true\\",
someVeryLongStyle3: \\"true\\",
someVeryLongStyle4: \\"true\\"
}}
/>;
<View
style={[
{
someVeryLongStyle1: \\"true\\",
someVeryLongStyle2: \\"true\\",
someVeryLongStyle3: \\"true\\",
someVeryLongStyle4: \\"true\\"
}
]}
/>;
<Something>
{() => (
<SomethingElse>
<span />
</SomethingElse>
)}
</Something>;
<Something>
{items.map(item => (
<SomethingElse>
<span />
</SomethingElse>
))}
</Something>;
<Something>
{function() {
return (
<SomethingElse>
<span />
</SomethingElse>
);
}}
</Something>;
<RadioListItem
key={option}
imageSource={
this.props.veryBigItemImageSourceFunc &&
this.props.veryBigItemImageSourceFunc(option)
}
imageSize={this.props.veryBigItemImageSize}
imageView={
this.props.veryBigItemImageViewFunc &&
this.props.veryBigItemImageViewFunc(option)
}
heading={this.props.displayTextFunc(option)}
value={option}
/>;
<ParentComponent
prop={
<Child>
test
</Child>
}
/>;
"
`;
exports[`hug.js 1`] = `
"<div>
{__DEV__
@ -199,6 +338,66 @@ exports[`hug.js 1`] = `
"
`;
exports[`hug.js 2`] = `
"<div>
{__DEV__
? this.renderDevApp()
: <div>
{routes.map(route => (
<MatchAsync
key={\`\${route.to}-async\`}
pattern={route.to}
exactly={route.to === \\"/\\"}
getComponent={routeES6Modules[route.value]}
/>
))}
</div>}
</div>;
<div>
{__DEV__ && <div>
{routes.map(route => (
<MatchAsync
key={\`\${route.to}-async\`}
pattern={route.to}
exactly={route.to === \\"/\\"}
getComponent={routeES6Modules[route.value]}
/>
))}
</div>}
</div>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div>
{__DEV__
? this.renderDevApp()
: <div>
{routes.map(route => (
<MatchAsync
key={\`\${route.to}-async\`}
pattern={route.to}
exactly={route.to === \\"/\\"}
getComponent={routeES6Modules[route.value]}
/>
))}
</div>}
</div>;
<div>
{__DEV__ &&
<div>
{routes.map(route => (
<MatchAsync
key={\`\${route.to}-async\`}
pattern={route.to}
exactly={route.to === \\"/\\"}
getComponent={routeES6Modules[route.value]}
/>
))}
</div>}
</div>;
"
`;
exports[`object-property.js 1`] = `
"const tabs = [
{
@ -230,6 +429,37 @@ const tabs = [
"
`;
exports[`object-property.js 2`] = `
"const tabs = [
{
title: \\"General Info\\",
content: (
<GeneralForm
long-attribute=\\"i-need-long-value-here\\"
onSave={ onSave }
onCancel={ onCancel }
countries={ countries }
/>
)
}
];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const tabs = [
{
title: \\"General Info\\",
content: (
<GeneralForm
long-attribute=\\"i-need-long-value-here\\"
onSave={onSave}
onCancel={onCancel}
countries={countries}
/>
)
}
];
"
`;
exports[`open-break.js 1`] = `
"<td
onClick={() => {
@ -260,6 +490,36 @@ onClick={() => {
"
`;
exports[`open-break.js 2`] = `
"<td
onClick={() => {
a
}}>{header}{showSort}</td>;
<td
onClick={() => {
a
}}>{header}<showSort attr=\\"long long long long long long long long long long long\\"/></td>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<td
onClick={() => {
a;
}}
>
{header}{showSort}
</td>;
<td
onClick={() => {
a;
}}
>
{header}
<showSort attr=\\"long long long long long long long long long long long\\" />
</td>;
"
`;
exports[`parens.js 1`] = `
"a = [
<path
@ -285,6 +545,31 @@ a = [
"
`;
exports[`parens.js 2`] = `
"a = [
<path
key='0'
d='M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,'
/>,
<path
key='1'
d='M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,'
/>,
];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a = [
<path
key=\\"0\\"
d=\\"M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,\\"
/>,
<path
key=\\"1\\"
d=\\"M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,M13.6,10.6l,4-2.8L9.5,\\"
/>
];
"
`;
exports[`quotes.js 1`] = `
"<div id=\\"&quot;'<>&amp;quot;\\" />;
<div id='\\"&#39;<>&amp;quot;' />;
@ -295,3 +580,14 @@ exports[`quotes.js 1`] = `
<div id={\\"'\\\\\\"&quot;<>&amp;quot;\\"} />;
"
`;
exports[`quotes.js 2`] = `
"<div id=\\"&quot;'<>&amp;quot;\\" />;
<div id='\\"&#39;<>&amp;quot;' />;
<div id={'\\\\'\\"&quot;<>&amp;quot;'} />;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div id=\\"&quot;'<>&amp;quot;\\" />;
<div id=\\"&quot;'<>&amp;quot;\\" />;
<div id={\\"'\\\\\\"&quot;<>&amp;quot;\\"} />;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -48,3 +48,52 @@ exports[`last_line.js 2`] = `
</SomeHighlyConfiguredComponent>;
"
`;
exports[`last_line.js 3`] = `
"<SomeHighlyConfiguredComponent
onEnter={this.onEnter}
onLeave={this.onLeave}
onChange={this.onChange}
initialValue={this.state.initialValue}
ignoreStuff={true}
>
<div>and the children go here</div>
<div>and here too</div>
</SomeHighlyConfiguredComponent>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<SomeHighlyConfiguredComponent
onEnter={this.onEnter}
onLeave={this.onLeave}
onChange={this.onChange}
initialValue={this.state.initialValue}
ignoreStuff={true}>
<div>and the children go here</div>
<div>and here too</div>
</SomeHighlyConfiguredComponent>;
"
`;
exports[`last_line.js 4`] = `
"<SomeHighlyConfiguredComponent
onEnter={this.onEnter}
onLeave={this.onLeave}
onChange={this.onChange}
initialValue={this.state.initialValue}
ignoreStuff={true}
>
<div>and the children go here</div>
<div>and here too</div>
</SomeHighlyConfiguredComponent>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<SomeHighlyConfiguredComponent
onEnter={this.onEnter}
onLeave={this.onLeave}
onChange={this.onChange}
initialValue={this.state.initialValue}
ignoreStuff={true}
>
<div>and the children go here</div>
<div>and here too</div>
</SomeHighlyConfiguredComponent>;
"
`;

View File

@ -1,2 +1,5 @@
run_spec(__dirname, {jsxBracketSameLine: true});
run_spec(__dirname, {jsxBracketSameLine: false});
run_spec(__dirname, {parser: 'typescript', jsxBracketSameLine: true});
run_spec(__dirname, {parser: 'typescript', jsxBracketSameLine: false});

View File

@ -8,3 +8,12 @@ a:;
b;
"
`;
exports[`empty_label.js 2`] = `
"a:;
b
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a:;
b;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -14,3 +14,18 @@ let outChannel;
let _commands;
"
`;
exports[`windows.js 2`] = `
"const vscode = require(\\"vscode\\");
const {getDir, getActiveFile, uint8arrayToString} = require(\\"./utils\\");
let outChannel;
let _commands;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const vscode = require(\\"vscode\\");
const { getDir, getActiveFile, uint8arrayToString } = require(\\"./utils\\");
let outChannel;
let _commands;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -9,3 +9,13 @@ const veryVeryVeryVeryVeryVeryVeryLong = doc.expandedStates[
const small = doc.expandedStates[doc.expandedStates.length - 1];
"
`;
exports[`expand.js 2`] = `
"const veryVeryVeryVeryVeryVeryVeryLong = doc.expandedStates[doc.expandedStates.length - 1];
const small = doc.expandedStates[doc.expandedStates.length - 1];~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const veryVeryVeryVeryVeryVeryVeryLong = doc.expandedStates[
doc.expandedStates.length - 1
];
const small = doc.expandedStates[doc.expandedStates.length - 1];
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -8,3 +8,12 @@ new (memoize.Cache || MapCache)();
new (typeof this == \\"function\\" ? this : Dict())();
"
`;
exports[`new_expression.js 2`] = `
"new (memoize.Cache || MapCache)
new (typeof this == \\"function\\" ? this : Dict())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new (memoize.Cache || MapCache)();
new (typeof this == \\"function\\" ? this : Dict())();
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -17,6 +17,23 @@ function foo() {
"
`;
exports[`comment.js 2`] = `
"function foo() {
return {
// this comment causes the problem
bar: baz() + 1
};
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function foo() {
return {
// this comment causes the problem
bar: baz() + 1
};
}
"
`;
exports[`test.js 1`] = `
"const a = classnames({
\\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp
@ -77,3 +94,64 @@ const g = classnames({
});
"
`;
exports[`test.js 2`] = `
"const a = classnames({
\\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp
});
const b = classnames({
\\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === true
});
const c = classnames({
\\"some-prop\\": [ \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\" ]
});
const d = classnames({
\\"some-prop\\": () => {}
});
const e = classnames({
\\"some-prop\\": function bar() {}
});
const f = classnames({
\\"some-prop\\": { foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\" }
});
const g = classnames({
\\"some-prop\\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = classnames({
\\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp
});
const b = classnames({
\\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp ===
true
});
const c = classnames({
\\"some-prop\\": [\\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\"]
});
const d = classnames({
\\"some-prop\\": () => {}
});
const e = classnames({
\\"some-prop\\": function bar() {}
});
const f = classnames({
\\"some-prop\\": { foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\" }
});
const g = classnames({
\\"some-prop\\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar ||
1337
});
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -14,3 +14,18 @@ const foo = {
};
"
`;
exports[`bug.js 2`] = `
"const foo = {
bar: props.bar ? props.bar : noop,
baz: props.baz
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const foo = {
bar: props.bar
? props.bar
: noop,
baz: props.baz
};
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname, {printWidth: 35});
run_spec(__dirname, {parser: 'typescript', printWidth: 35});

View File

@ -60,3 +60,64 @@ function a() {
}
"
`;
exports[`comments.js 2`] = `
"function a() {
const a = 5; // comment
return a;
}
function a() {
const a = 5; /* comment */
return a;
}
function a() {
const a = 5; /* comment */ /* comment */
return a;
}
function a() {
const a = 5; /* comment */ /* comment */ // comment
return a;
}
function a() {
const a = 5; /* comment */ /* comment */ // comment
return a;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function a() {
const a = 5; // comment
return a;
}
function a() {
const a = 5; /* comment */
return a;
}
function a() {
const a = 5; /* comment */ /* comment */
return a;
}
function a() {
const a = 5; /* comment */ /* comment */ // comment
return a;
}
function a() {
const a = 5; /* comment */ /* comment */ // comment
return a;
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -35,3 +35,39 @@ const {
const MyReallyExtrememlyLongModuleName = require(\\"MyReallyExtrememlyLongModuleName\\");
"
`;
exports[`require.js 2`] = `
"const { one, two, thee, four, five, six, seven, eight, nine, ten } = require('./my-utils');
const { one, two, thee, four, five, six, seven, eight, nine, ten, eleven } = require('./my-utils');
const MyReallyExtrememlyLongModuleName = require('MyReallyExtrememlyLongModuleName');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const {
one,
two,
thee,
four,
five,
six,
seven,
eight,
nine,
ten
} = require(\\"./my-utils\\");
const {
one,
two,
thee,
four,
five,
six,
seven,
eight,
nine,
ten,
eleven
} = require(\\"./my-utils\\");
const MyReallyExtrememlyLongModuleName = require(\\"MyReallyExtrememlyLongModuleName\\");
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -9,6 +9,15 @@ function a() {}
"
`;
exports[`shebang.js 2`] = `
"#!/usr/bin/env node
function a() {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/env node
function a() {}
"
`;
exports[`shebang-newline.js 1`] = `
"#!/usr/bin/env node
@ -19,3 +28,14 @@ function a() {}
function a() {}
"
`;
exports[`shebang-newline.js 2`] = `
"#!/usr/bin/env node
function a() {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/env node
function a() {}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -11,3 +11,15 @@ switch (1) {
}
"
`;
exports[`empty_switch.js 2`] = `
"switch (1) { default:; }
switch (1) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
switch (1) {
default:
}
switch (1) {
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -33,6 +33,39 @@ var x = {
"
`;
exports[`faulty-locations.js 2`] = `
"var o = {
[\`key\`]: () => {
// Comment
}
};
var x = {
y: () => Relay.QL\`
query {
\${foo},
field,
}
\`
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var o = {
[\`key\`]: () => {
// Comment
}
};
var x = {
y: () => Relay.QL\`
query {
\${foo},
field,
}
\`
};
"
`;
exports[`parenthesis.js 1`] = `
"// \\"ArrowFunctionExpression\\"
(() => {})\`\`;
@ -145,3 +178,116 @@ function* f() {
}
"
`;
exports[`parenthesis.js 2`] = `
"// \\"ArrowFunctionExpression\\"
(() => {})\`\`;
// \\"AssignmentExpression\\"
(b = c)\`\`;
// \\"AwaitExpression\\"
async function f() {
(await b)\`\`;
}
// \\"BinaryExpression\\"
(b + c)\`\`;
// \\"CallExpression\\"
b()\`\`;
// \\"ClassExpression\\"
(class {})\`\`;
// \\"ConditionalExpression\\"
(b ? c : d)\`\`;
// \\"FunctionExpression\\"
(function() {})\`\`;
// \\"LogicalExpression\\"
(b || c)\`\`;
// \\"MemberExpression\\"
b.c\`\`;
// \\"NewExpression\\"
(new B())\`\`;
// \\"ObjectExpression\\"
({})\`\`;
// \\"SequenceExpression\\"
(b, c)\`\`;
// \\"TaggedTemplateExpression\\"
(\`\`)\`\`;
// \\"UnaryExpression\\"
(void b)\`\`;
// \\"UpdateExpression\\"
(++b)\`\`;
// \\"YieldExpression\\"
function* f() {
(yield 1)\`\`;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// \\"ArrowFunctionExpression\\"
(() => {})\`\`;
// \\"AssignmentExpression\\"
(b = c)\`\`;
// \\"AwaitExpression\\"
async function f() {
(await b)\`\`;
}
// \\"BinaryExpression\\"
(b + c)\`\`;
// \\"CallExpression\\"
b()\`\`;
// \\"ClassExpression\\"
(class {}\`\`);
// \\"ConditionalExpression\\"
(b ? c : d)\`\`;
// \\"FunctionExpression\\"
(function() {})\`\`;
// \\"LogicalExpression\\"
(b || c)\`\`;
// \\"MemberExpression\\"
b.c\`\`;
// \\"NewExpression\\"
new B()\`\`;
// \\"ObjectExpression\\"
({}\`\`);
// \\"SequenceExpression\\"
(b, c)\`\`;
// \\"TaggedTemplateExpression\\"
\`\`\`\`;
// \\"UnaryExpression\\"
(void b)\`\`;
// \\"UpdateExpression\\"
(++b)\`\`;
// \\"YieldExpression\\"
function* f() {
(yield 1)\`\`;
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -103,3 +103,107 @@ const obj5 = conditionIsTruthy
};
"
`;
exports[`test.js 3`] = `
"const obj0 = conditionIsTruthy ? shortThing : otherShortThing
const obj1 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : shortThing
const obj2 = conditionIsTruthy ? shortThing : { some: 'long', object: 'with', lots: 'of', stuff }
const obj3 = conditionIsTruthy ? { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } : shortThing
const obj4 = conditionIsTruthy ? shortThing : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff }
const obj5 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const obj0 = conditionIsTruthy ? shortThing : otherShortThing;
const obj1 = conditionIsTruthy
? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff }
: shortThing;
const obj2 = conditionIsTruthy
? shortThing
: { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff };
const obj3 = conditionIsTruthy
? {
some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\",
object: \\"with\\",
lots: \\"of\\",
stuff
}
: shortThing;
const obj4 = conditionIsTruthy
? shortThing
: {
some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\",
object: \\"with\\",
lots: \\"of\\",
stuff
};
const obj5 = conditionIsTruthy
? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff }
: {
some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\",
object: \\"with\\",
lots: \\"of\\",
stuff
};
"
`;
exports[`test.js 4`] = `
"const obj0 = conditionIsTruthy ? shortThing : otherShortThing
const obj1 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : shortThing
const obj2 = conditionIsTruthy ? shortThing : { some: 'long', object: 'with', lots: 'of', stuff }
const obj3 = conditionIsTruthy ? { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } : shortThing
const obj4 = conditionIsTruthy ? shortThing : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff }
const obj5 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const obj0 = conditionIsTruthy ? shortThing : otherShortThing;
const obj1 = conditionIsTruthy
? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff }
: shortThing;
const obj2 = conditionIsTruthy
? shortThing
: { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff };
const obj3 = conditionIsTruthy
? {
some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\",
object: \\"with\\",
lots: \\"of\\",
stuff
}
: shortThing;
const obj4 = conditionIsTruthy
? shortThing
: {
some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\",
object: \\"with\\",
lots: \\"of\\",
stuff
};
const obj5 = conditionIsTruthy
? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff }
: {
some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\",
object: \\"with\\",
lots: \\"of\\",
stuff
};
"
`;

View File

@ -1,2 +1,5 @@
run_spec(__dirname);
run_spec(__dirname, { tabWidth: 4 });
run_spec(__dirname, {parser: 'typescript'});
run_spec(__dirname, { parser: 'typescript', tabWidth: 4 });

View File

@ -117,6 +117,123 @@ function send_single_email(
"
`;
exports[`es5.js 4`] = `
"function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation( app,
email_id,
email_address,
subject,
html,
reply_to);
return \\"nothing\\";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation(
app,
email_id,
email_address,
subject,
html,
reply_to
);
return \\"nothing\\";
}
"
`;
exports[`es5.js 5`] = `
"function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation( app,
email_id,
email_address,
subject,
html,
reply_to);
return \\"nothing\\";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to,
) {
send_single_email_implementation(
app,
email_id,
email_address,
subject,
html,
reply_to,
);
return \\"nothing\\";
}
"
`;
exports[`es5.js 6`] = `
"function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation( app,
email_id,
email_address,
subject,
html,
reply_to);
return \\"nothing\\";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function send_single_email(
app,
email_id,
email_address,
subject,
html,
reply_to
) {
send_single_email_implementation(
app,
email_id,
email_address,
subject,
html,
reply_to
);
return \\"nothing\\";
}
"
`;
exports[`function-calls.js 1`] = `
"const a = (param1, param2, param3) => {}
@ -210,6 +327,99 @@ a(
"
`;
exports[`function-calls.js 4`] = `
"const a = (param1, param2, param3) => {}
a('value', 'value2', 'value3');
a(
'a-long-value',
'a-really-really-long-value',
'a-really-really-really-long-value',
);
a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3'));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = (param1, param2, param3) => {};
a(\\"value\\", \\"value2\\", \\"value3\\");
a(
\\"a-long-value\\",
\\"a-really-really-long-value\\",
\\"a-really-really-really-long-value\\"
);
a(
\\"value\\",
\\"value2\\",
a(\\"long-nested-value\\", \\"long-nested-value2\\", \\"long-nested-value3\\")
);
"
`;
exports[`function-calls.js 5`] = `
"const a = (param1, param2, param3) => {}
a('value', 'value2', 'value3');
a(
'a-long-value',
'a-really-really-long-value',
'a-really-really-really-long-value',
);
a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3'));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = (param1, param2, param3) => {};
a(\\"value\\", \\"value2\\", \\"value3\\");
a(
\\"a-long-value\\",
\\"a-really-really-long-value\\",
\\"a-really-really-really-long-value\\",
);
a(
\\"value\\",
\\"value2\\",
a(\\"long-nested-value\\", \\"long-nested-value2\\", \\"long-nested-value3\\"),
);
"
`;
exports[`function-calls.js 6`] = `
"const a = (param1, param2, param3) => {}
a('value', 'value2', 'value3');
a(
'a-long-value',
'a-really-really-long-value',
'a-really-really-really-long-value',
);
a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3'));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = (param1, param2, param3) => {};
a(\\"value\\", \\"value2\\", \\"value3\\");
a(
\\"a-long-value\\",
\\"a-really-really-long-value\\",
\\"a-really-really-really-long-value\\"
);
a(
\\"value\\",
\\"value2\\",
a(\\"long-nested-value\\", \\"long-nested-value2\\", \\"long-nested-value3\\")
);
"
`;
exports[`object.js 1`] = `
"const a = {
b: true,
@ -351,6 +561,147 @@ const aLong = {
"
`;
exports[`object.js 4`] = `
"const a = {
b: true,
c: {
c1: 'hello'
},
d: false
};
const aLong = {
bHasALongName: 'a-long-value',
cHasALongName: {
c1: 'a-really-long-value',
c2: 'a-really-really-long-value',
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = {
b: true,
c: {
c1: \\"hello\\"
},
d: false
};
const aLong = {
bHasALongName: \\"a-long-value\\",
cHasALongName: {
c1: \\"a-really-long-value\\",
c2: \\"a-really-really-long-value\\"
},
dHasALongName: \\"a-long-value-too\\"
};
const aLong = {
dHasALongName: \\"a-long-value-too\\",
eHasABooleanExpression: a === a
};
"
`;
exports[`object.js 5`] = `
"const a = {
b: true,
c: {
c1: 'hello'
},
d: false
};
const aLong = {
bHasALongName: 'a-long-value',
cHasALongName: {
c1: 'a-really-long-value',
c2: 'a-really-really-long-value',
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = {
b: true,
c: {
c1: \\"hello\\",
},
d: false,
};
const aLong = {
bHasALongName: \\"a-long-value\\",
cHasALongName: {
c1: \\"a-really-long-value\\",
c2: \\"a-really-really-long-value\\",
},
dHasALongName: \\"a-long-value-too\\",
};
const aLong = {
dHasALongName: \\"a-long-value-too\\",
eHasABooleanExpression: a === a,
};
"
`;
exports[`object.js 6`] = `
"const a = {
b: true,
c: {
c1: 'hello'
},
d: false
};
const aLong = {
bHasALongName: 'a-long-value',
cHasALongName: {
c1: 'a-really-long-value',
c2: 'a-really-really-long-value',
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = {
b: true,
c: {
c1: \\"hello\\",
},
d: false,
};
const aLong = {
bHasALongName: \\"a-long-value\\",
cHasALongName: {
c1: \\"a-really-long-value\\",
c2: \\"a-really-really-long-value\\",
},
dHasALongName: \\"a-long-value-too\\",
};
const aLong = {
dHasALongName: \\"a-long-value-too\\",
eHasABooleanExpression: a === a,
};
"
`;
exports[`trailing_whitespace.js 1`] = `
"let example = [
'FOO',
@ -578,3 +929,231 @@ function supersupersupersuperLongF(
}
"
`;
exports[`trailing_whitespace.js 4`] = `
"let example = [
'FOO',
'BAR',
// Comment
];
foo({},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let example = [
\\"FOO\\",
\\"BAR\\"
// Comment
];
foo(
{}
// Comment
);
o = {
state
// Comment
};
o = {
state
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
) // Comment
{
a;
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
) // Comment
{
a;
}
"
`;
exports[`trailing_whitespace.js 5`] = `
"let example = [
'FOO',
'BAR',
// Comment
];
foo({},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let example = [
\\"FOO\\",
\\"BAR\\",
// Comment
];
foo(
{},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
) // Comment
{
a;
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
) // Comment
{
a;
}
"
`;
exports[`trailing_whitespace.js 6`] = `
"let example = [
'FOO',
'BAR',
// Comment
];
foo({},
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
// Comment
) {
a
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB,
// Comment
) {
a
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let example = [
\\"FOO\\",
\\"BAR\\",
// Comment
];
foo(
{}
// Comment
);
o = {
state,
// Comment
};
o = {
state,
// Comment
};
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
) // Comment
{
a;
}
function supersupersupersuperLongF(
supersupersupersuperLongA,
supersupersupersuperLongB
) // Comment
{
a;
}
"
`;

View File

@ -1,3 +1,7 @@
run_spec(__dirname);
run_spec(__dirname, { trailingComma: "all" });
run_spec(__dirname, { trailingComma: "es5" });
//
run_spec(__dirname, {parser: 'typescript'});
run_spec(__dirname, { parser: 'typescript', trailingComma: "all" });
run_spec(__dirname, { parser: 'typescript', trailingComma: "es5" });

View File

@ -21,6 +21,27 @@ try {
"
`;
exports[`empty.js 2`] = `
"try {
} catch (e) {
}
finally {
}
try {
} catch (e) {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
try {
} catch (e) {
} finally {
}
try {
} catch (e) {}
"
`;
exports[`try.js 1`] = `
"try
/* missing comment */
@ -33,3 +54,16 @@ try {
}
"
`;
exports[`try.js 2`] = `
"try
/* missing comment */
{;}
finally {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
try {
/* missing comment */
} finally {
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -13,6 +13,19 @@ state = {
"
`;
exports[`object.js 2`] = `
"state = {
// students
hoverColumn: -1
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
state = {
// students
hoverColumn: -1
};
"
`;
exports[`series.js 1`] = `
"1 + ++x;
1 + x++;
@ -51,3 +64,42 @@ x-- - 1;
--x - 1;
"
`;
exports[`series.js 2`] = `
"1 + ++x;
1 + x++;
+ ++x;
+ x++;
x++ + 1;
++x + 1;
1 - --x;
1 - x--;
- --x;
- x--;
x-- - 1;
--x - 1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 + ++x;
1 + x++;
+(++x);
+x++;
x++ + 1;
++x + 1;
1 - --x;
1 - x--;
-(--x);
-x--;
x-- - 1;
--x - 1;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -20,3 +20,24 @@ x * +y;
+x * y;
"
`;
exports[`urnary_expression.js 2`] = `
"!!x
x++
x--;
-+1;
x + + + + 1;
x + (+ (+ (+ 1)))
x * +y;
+x * y;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!x;
x++;
x--;
-+1;
x + +(+(+1));
x + +(+(+1));
x * +y;
+x * y;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -12,3 +12,16 @@ new (r++)();
const uuid = String(this._uuidCounter++);
"
`;
exports[`update_expression.js 2`] = `
"(this.x++).toString()
new (r++);
(x++)();
const uuid = String(this._uuidCounter++);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(this.x++).toString();
new (r++)();
(x++)();
const uuid = String(this._uuidCounter++);
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -20,3 +20,24 @@ while (
}
"
`;
exports[`indent.js 2`] = `
"if (someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD) {}
while (someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (
someVeryLongStringA &&
someVeryLongStringB &&
someVeryLongStringC &&
someVeryLongStringD
) {
}
while (
someVeryLongStringA &&
someVeryLongStringB &&
someVeryLongStringC &&
someVeryLongStringD
) {
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -14,3 +14,18 @@ line;
endings;
"
`;
exports[`line-ending.js 2`] = `
"this;
has;
windows;
line;
endings;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this;
has;
windows;
line;
endings;
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'typescript'});

View File

@ -42,3 +42,46 @@ async function f() {
}
"
`;
exports[`conditional.js 2`] = `
"function* f() {
a = (yield) ? 1 : 1;
a = yield 1 ? 1 : 1;
a = (yield 1) ? 1 : 1;
a = 1 ? yield : yield;
a = 1 ? yield 1 : yield 1;
}
function* f() {
a = yield* 1 ? 1 : 1;
a = (yield* 1) ? 1 : 1;
a = 1 ? yield* 1 : yield* 1;
}
async function f() {
a = await 1 ? 1 : 1;
a = (await 1) ? 1 : 1;
a = 1 ? await 1 : await 1;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function* f() {
a = (yield) ? 1 : 1;
a = yield 1 ? 1 : 1;
a = (yield 1) ? 1 : 1;
a = 1 ? yield : yield;
a = 1 ? yield 1 : yield 1;
}
function* f() {
a = yield* 1 ? 1 : 1;
a = (yield* 1) ? 1 : 1;
a = 1 ? yield* 1 : yield* 1;
}
async function f() {
a = (await 1) ? 1 : 1;
a = (await 1) ? 1 : 1;
a = 1 ? await 1 : await 1;
}
"
`;

View File

@ -1 +1,2 @@
run_spec(__dirname, {parser: 'babylon'});
run_spec(__dirname, {parser: 'typescript'});

185
yarn.lock
View File

@ -2,10 +2,6 @@
# yarn lockfile v1
"@comandeer/babel-plugin-banner@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@comandeer/babel-plugin-banner/-/babel-plugin-banner-1.0.0.tgz#40bcce0bbee084b5b02545a33635d053c248356f"
abab@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d"
@ -151,7 +147,7 @@ babel-code-frame@6.22.0, babel-code-frame@^6.20.0:
esutils "^2.0.2"
js-tokens "^3.0.0"
babel-core@^6.0.0, babel-core@^6.18.0, babel-core@^6.21.0:
babel-core@^6.0.0, babel-core@^6.18.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.21.0.tgz#75525480c21c803f826ef3867d22c19f080a3724"
dependencies:
@ -187,30 +183,6 @@ babel-generator@^6.18.0, babel-generator@^6.21.0:
lodash "^4.2.0"
source-map "^0.5.0"
babel-helper-evaluate-path@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.0.3.tgz#1d103ac9d4a59e5d431842212f151785f7ac547b"
babel-helper-flip-expressions@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.0.1.tgz#c2ba1599426e7928333fd5c08eee6cdf8328c848"
babel-helper-is-nodes-equiv@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684"
babel-helper-is-void-0@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.0.1.tgz#ed74553b883e68226ae45f989a99b02c190f105a"
babel-helper-remove-or-void@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.0.1.tgz#f602790e465acf2dfbe84fb3dd210c43a2dd7262"
babel-helper-to-multiple-sequence-expressions@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.0.2.tgz#07d5d2e674aa62962ac9e0000b539920c301c4b9"
babel-helpers@^6.16.0:
version "6.16.0"
resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3"
@ -244,128 +216,6 @@ babel-plugin-jest-hoist@^19.0.0:
version "19.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea"
babel-plugin-minify-constant-folding@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.0.3.tgz#a511e839562489811987a7a503c43c312c40138a"
dependencies:
babel-helper-evaluate-path "^0.0.3"
babel-plugin-minify-dead-code-elimination@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.1.tgz#1a0133fcd06c7fa477b01c193ba3213c8944ff01"
dependencies:
babel-helper-remove-or-void "^0.0.1"
lodash.some "^4.6.0"
babel-plugin-minify-flip-comparisons@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.0.1.tgz#679f4493a692afc705c4b79fde1dadb535c4eb08"
dependencies:
babel-helper-is-void-0 "^0.0.1"
babel-plugin-minify-guarded-expressions@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.0.3.tgz#6da1caa0b6abda964647377bd5e19afdbf91cae8"
dependencies:
babel-helper-flip-expressions "^0.0.1"
babel-plugin-minify-infinity@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.0.3.tgz#4cc99b61d12b434ce80ad675103335c589cba9a1"
babel-plugin-minify-mangle-names@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.0.5.tgz#53e4905de90a215622012cc003c3e0d5bdf18a8a"
babel-plugin-minify-numeric-literals@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.0.1.tgz#9597e6c31154d7daf3744d0bd417c144b275bd53"
babel-plugin-minify-replace@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.1.tgz#5d5aea7cb9899245248d1ee9ce7a2fe556a8facc"
babel-plugin-minify-simplify@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.0.5.tgz#71d1de1993a138282c679aad74060829b2b13ed2"
dependencies:
babel-helper-flip-expressions "^0.0.1"
babel-helper-is-nodes-equiv "^0.0.1"
babel-helper-to-multiple-sequence-expressions "^0.0.2"
babel-plugin-minify-type-constructors@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.0.2.tgz#4f9a28951e776f31ac11a29cd58cf9eef8b2e292"
dependencies:
babel-helper-is-void-0 "^0.0.1"
babel-plugin-transform-member-expression-literals@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.0.tgz#718755a70492a895d8f41810afa9998bc09f57b9"
dependencies:
babel-runtime "^6.0.0"
babel-plugin-transform-merge-sibling-variables@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.0.tgz#724074e4ef78b601fcf9a34165c972a1b6117e99"
dependencies:
babel-runtime "^6.0.0"
babel-plugin-transform-minify-booleans@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.0.tgz#b1a48864a727847696b84eae36fa4d085a54b42b"
dependencies:
babel-runtime "^6.0.0"
babel-plugin-transform-property-literals@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.0.tgz#a65b2e6e1274d25df0f3a4c5e85bc8f1cdd9e019"
dependencies:
babel-runtime "^6.0.0"
babel-plugin-transform-regexp-constructors@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.0.3.tgz#463200d8371a06f077226b967858369211b5cfe3"
babel-plugin-transform-remove-undefined@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.0.3.tgz#34baeb7bde4fc01d5235304ee891e7b6bff00432"
babel-plugin-transform-simplify-comparison-operators@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.0.tgz#0183d65bfdc54c80d922a3a9b3008e25fa9d32a7"
dependencies:
babel-runtime "^6.0.0"
babel-plugin-transform-undefined-to-void@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.0.tgz#bc5b6b4908d3b1262170e67cb3963903ddce167e"
dependencies:
babel-runtime "^6.0.0"
babel-preset-babili@0.0.9:
version "0.0.9"
resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.0.9.tgz#699f08703ff1c84f4f6c229ffe5662c8f1861bf2"
dependencies:
babel-plugin-minify-constant-folding "^0.0.3"
babel-plugin-minify-dead-code-elimination "^0.1.1"
babel-plugin-minify-flip-comparisons "^0.0.1"
babel-plugin-minify-guarded-expressions "^0.0.3"
babel-plugin-minify-infinity "^0.0.3"
babel-plugin-minify-mangle-names "^0.0.5"
babel-plugin-minify-numeric-literals "^0.0.1"
babel-plugin-minify-replace "^0.0.1"
babel-plugin-minify-simplify "^0.0.5"
babel-plugin-minify-type-constructors "^0.0.2"
babel-plugin-transform-member-expression-literals "^6.8.0"
babel-plugin-transform-merge-sibling-variables "^6.8.0"
babel-plugin-transform-minify-booleans "^6.8.0"
babel-plugin-transform-property-literals "^6.8.0"
babel-plugin-transform-regexp-constructors "^0.0.3"
babel-plugin-transform-remove-undefined "^0.0.3"
babel-plugin-transform-simplify-comparison-operators "^6.8.0"
babel-plugin-transform-undefined-to-void "^6.8.0"
babel-preset-jest@^19.0.0:
version "19.0.0"
resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396"
@ -1602,9 +1452,15 @@ locate-path@^2.0.0:
p-locate "^2.0.0"
path-exists "^3.0.0"
lodash.some@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d"
lodash.tostring@^4.0.0:
version "4.1.4"
resolved "https://registry.yarnpkg.com/lodash.tostring/-/lodash.tostring-4.1.4.tgz#560c27d1f8eadde03c2cce198fef5c031d8298fb"
lodash.unescape@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.0.tgz#36debfc492b81478471ef974cd3783e202eb6cef"
dependencies:
lodash.tostring "^4.0.0"
lodash@^4.14.0, lodash@^4.2.0:
version "4.17.4"
@ -1747,7 +1603,7 @@ oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-assign@^4.1.0:
object-assign@^4.0.1, object-assign@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0"
@ -2076,14 +1932,6 @@ rollup-plugin-node-resolve@2.0.0:
builtin-modules "^1.1.0"
resolve "^1.1.6"
rollup-plugin-real-babili@1.0.0-alpha3:
version "1.0.0-alpha3"
resolved "https://registry.yarnpkg.com/rollup-plugin-real-babili/-/rollup-plugin-real-babili-1.0.0-alpha3.tgz#11f7dff284726c18d925da5eb0aff783cc45e305"
dependencies:
"@comandeer/babel-plugin-banner" "^1.0.0"
babel-core "^6.21.0"
babel-preset-babili "0.0.9"
rollup-pluginutils@^1.5.1, rollup-pluginutils@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
@ -2290,6 +2138,17 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"
"typescript-eslint-parser@git://github.com/eslint/typescript-eslint-parser.git#215a012ec4d272939fa5a57d0231d22fb7f7a9e0":
version "2.0.0"
resolved "git://github.com/eslint/typescript-eslint-parser.git#215a012ec4d272939fa5a57d0231d22fb7f7a9e0"
dependencies:
lodash.unescape "4.0.0"
object-assign "^4.0.1"
typescript@2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.1.tgz#4862b662b988a4c8ff691cc7969622d24db76ae9"
uglify-js@^2.6:
version "2.7.5"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8"