Rename "babylon" with "babel" (#5647)
parent
a18d80253a
commit
91c20f7fbe
|
@ -13,7 +13,7 @@ Here's what you need to know about the tests:
|
|||
- The tests use [Jest snapshots](https://facebook.github.io/jest/docs/en/snapshot-testing.html).
|
||||
- You can make changes and run `jest -u` (or `yarn test -u`) to update the snapshots. Then run `git diff` to take a look at what changed. Always update the snapshots when opening a PR.
|
||||
- You can run `AST_COMPARE=1 jest` for a more robust test run. That formats each file, re-parses it, and compares the new AST with the original one and makes sure they are semantically equivalent.
|
||||
- Each test folder has a `jsfmt.spec.js` that runs the tests. For JavaScript files, generally you can just put `run_spec(__dirname, ["babylon", "flow", "typescript"]);` there. This will verify that the output using each parser is the same. You can also pass options as the third argument, like this: `run_spec(__dirname, ["babylon"], { trailingComma: "es5" });`
|
||||
- Each test folder has a `jsfmt.spec.js` that runs the tests. For JavaScript files, generally you can just put `run_spec(__dirname, ["babel", "flow", "typescript"]);` there. This will verify that the output using each parser is the same. You can also pass options as the third argument, like this: `run_spec(__dirname, ["babel"], { trailingComma: "es5" });`
|
||||
- `tests/flow/` contains the Flow test suite, and is not supposed to be edited by hand. To update it, clone the Flow repo next to the Prettier repo and run: `node scripts/sync-flow-tests.js ../flow/tests/`.
|
||||
- If you would like to debug prettier locally, you can either debug it in node or the browser. The easiest way to debug it in the browser is to run the interactive `docs` REPL locally. The easiest way to debug it in node, is to create a local test file and run it in an editor like VS Code.
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const prettier = require("prettier");
|
|||
`format` is used to format text using Prettier. [Options](options.md) may be provided to override the defaults.
|
||||
|
||||
```js
|
||||
prettier.format("foo ( );", { semi: false, parser: "babylon" });
|
||||
prettier.format("foo ( );", { semi: false, parser: "babel" });
|
||||
// -> "foo()"
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ prettier.format("foo ( );", { semi: false, parser: "babylon" });
|
|||
The `cursorOffset` option should be provided, to specify where the cursor is. This option cannot be used with `rangeStart` and `rangeEnd`.
|
||||
|
||||
```js
|
||||
prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babylon" });
|
||||
prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
|
||||
// -> { formatted: '1;\n', cursorOffset: 1 }
|
||||
```
|
||||
|
||||
|
@ -130,8 +130,8 @@ Prettier's built-in parsers are exposed as properties on the `parsers` argument.
|
|||
|
||||
```js
|
||||
prettier.format("lodash ( )", {
|
||||
parser(text, { babylon }) {
|
||||
const ast = babylon(text);
|
||||
parser(text, { babel }) {
|
||||
const ast = babel(text);
|
||||
ast.program.body[0].expression.callee.name = "_";
|
||||
return ast;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ For example, to get Prettier to format its own `.prettierrc` file, you can do:
|
|||
}
|
||||
```
|
||||
|
||||
You can also switch to the `flow` parser instead of the default `babylon` for .js files:
|
||||
You can also switch to the `flow` parser instead of the default `babel` for .js files:
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
|
@ -176,11 +176,11 @@ Specify which parser to use.
|
|||
|
||||
Prettier automatically infers the parser from the input file path, so you shouldn't have to change this setting.
|
||||
|
||||
Both the `babylon` and `flow` parsers support the same set of JavaScript features (including Flow type annotations). They might differ in some edge cases, so if you run into one of those you can try `flow` instead of `babylon`.
|
||||
Both the `babel` and `flow` parsers support the same set of JavaScript features (including Flow type annotations). They might differ in some edge cases, so if you run into one of those you can try `flow` instead of `babel`.
|
||||
|
||||
Valid options:
|
||||
|
||||
- `"babylon"` (via [@babel/parser](https://github.com/babel/babel/tree/master/packages/babel-parser))
|
||||
- `"babel"` (via [@babel/parser](https://github.com/babel/babel/tree/master/packages/babel-parser)) _Named `"babylon"` until v1.16.0_
|
||||
- `"flow"` (via [flow-parser](https://github.com/facebook/flow/tree/master/src/parser))
|
||||
- `"typescript"` (via [typescript-estree](https://github.com/JamesHenry/typescript-estree)) _First available in v1.4.0_
|
||||
- `"css"` (via [postcss-scss](https://github.com/postcss/postcss-scss) and [postcss-less](https://github.com/shellscape/postcss-less), autodetects which to use) _First available in v1.7.1_
|
||||
|
|
|
@ -10,9 +10,12 @@ module.exports = [
|
|||
require("../language-js"),
|
||||
{
|
||||
parsers: {
|
||||
// JS - Babylon
|
||||
// JS - Babel
|
||||
get babel() {
|
||||
return eval("require")("../language-js/parser-babylon").parsers.babel;
|
||||
},
|
||||
get babylon() {
|
||||
return eval("require")("../language-js/parser-babylon").parsers.babylon;
|
||||
return eval("require")("../language-js/parser-babylon").parsers.babel;
|
||||
},
|
||||
get json() {
|
||||
return eval("require")("../language-js/parser-babylon").parsers.json;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
function createError(message, loc) {
|
||||
// Construct an error similar to the ones thrown by Babylon.
|
||||
// Construct an error similar to the ones thrown by Babel.
|
||||
const error = new SyntaxError(
|
||||
message + " (" + loc.start.line + ":" + loc.start.column + ")"
|
||||
);
|
||||
|
|
|
@ -15,7 +15,7 @@ function printVueFor(value, textToDoc) {
|
|||
return concat([
|
||||
group(
|
||||
textToDoc(`function _(${left}) {}`, {
|
||||
parser: "babylon",
|
||||
parser: "babel",
|
||||
__isVueForBindingLeft: true
|
||||
})
|
||||
),
|
||||
|
@ -61,7 +61,7 @@ function parseVueFor(value) {
|
|||
|
||||
function printVueSlotScope(value, textToDoc) {
|
||||
return textToDoc(`function _(${value}) {}`, {
|
||||
parser: "babylon",
|
||||
parser: "babel",
|
||||
__isVueSlotScope: true
|
||||
});
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ function inferScriptParser(node) {
|
|||
node.attrMap.type === "text/babel" ||
|
||||
node.attrMap.type === "application/javascript"
|
||||
) {
|
||||
return "babylon";
|
||||
return "babel";
|
||||
}
|
||||
|
||||
if (
|
||||
|
|
|
@ -9,7 +9,7 @@ const languages = [
|
|||
createLanguage(require("linguist-languages/data/javascript"), {
|
||||
override: {
|
||||
since: "0.0.0",
|
||||
parsers: ["babylon", "flow"],
|
||||
parsers: ["babel", "flow"],
|
||||
vscodeLanguageIds: ["javascript"]
|
||||
},
|
||||
extend: {
|
||||
|
@ -20,7 +20,7 @@ const languages = [
|
|||
override: {
|
||||
name: "Flow",
|
||||
since: "0.0.0",
|
||||
parsers: ["babylon", "flow"],
|
||||
parsers: ["babel", "flow"],
|
||||
vscodeLanguageIds: ["javascript"],
|
||||
|
||||
aliases: [],
|
||||
|
@ -31,7 +31,7 @@ const languages = [
|
|||
createLanguage(require("linguist-languages/data/jsx"), {
|
||||
override: {
|
||||
since: "0.0.0",
|
||||
parsers: ["babylon", "flow"],
|
||||
parsers: ["babel", "flow"],
|
||||
vscodeLanguageIds: ["javascriptreact"]
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
"use strict";
|
||||
|
||||
// This file is currently named parser-babylon.js to maintain backwards compatibility.
|
||||
// However, it should be named parser-babel.js in the next major release.
|
||||
|
||||
const createError = require("../common/parser-create-error");
|
||||
const hasPragma = require("./pragma").hasPragma;
|
||||
const locFns = require("./loc");
|
||||
const postprocess = require("./postprocess");
|
||||
|
||||
function babylonOptions(extraOptions, extraPlugins) {
|
||||
function babelOptions(extraOptions, extraPlugins) {
|
||||
return Object.assign(
|
||||
{
|
||||
sourceType: "module",
|
||||
|
@ -45,25 +48,22 @@ function babylonOptions(extraOptions, extraPlugins) {
|
|||
function createParse(parseMethod) {
|
||||
return (text, parsers, opts) => {
|
||||
// Inline the require to avoid loading all the JS if we don't use it
|
||||
const babylon = require("@babel/parser");
|
||||
const babel = require("@babel/parser");
|
||||
|
||||
const combinations = [
|
||||
babylonOptions({ strictMode: true }, ["decorators-legacy"]),
|
||||
babylonOptions({ strictMode: false }, ["decorators-legacy"]),
|
||||
babylonOptions({ strictMode: true }, [
|
||||
babelOptions({ strictMode: true }, ["decorators-legacy"]),
|
||||
babelOptions({ strictMode: false }, ["decorators-legacy"]),
|
||||
babelOptions({ strictMode: true }, [
|
||||
["decorators", { decoratorsBeforeExport: false }]
|
||||
]),
|
||||
babylonOptions({ strictMode: false }, [
|
||||
babelOptions({ strictMode: false }, [
|
||||
["decorators", { decoratorsBeforeExport: false }]
|
||||
])
|
||||
];
|
||||
|
||||
let ast;
|
||||
try {
|
||||
ast = tryCombinations(
|
||||
babylon[parseMethod].bind(null, text),
|
||||
combinations
|
||||
);
|
||||
ast = tryCombinations(babel[parseMethod].bind(null, text), combinations);
|
||||
} catch (error) {
|
||||
throw createError(
|
||||
// babel error prints (l:c) with cols that are zero indexed
|
||||
|
@ -166,24 +166,23 @@ function assertJsonNode(node, parent) {
|
|||
}
|
||||
}
|
||||
|
||||
const babylon = Object.assign(
|
||||
{ parse, astFormat: "estree", hasPragma },
|
||||
locFns
|
||||
);
|
||||
const babylonExpression = Object.assign({}, babylon, {
|
||||
const babel = Object.assign({ parse, astFormat: "estree", hasPragma }, locFns);
|
||||
const babelExpression = Object.assign({}, babel, {
|
||||
parse: parseExpression
|
||||
});
|
||||
|
||||
// Export as a plugin so we can reuse the same bundle for UMD loading
|
||||
module.exports = {
|
||||
parsers: {
|
||||
babylon,
|
||||
json: Object.assign({}, babylonExpression, {
|
||||
babel,
|
||||
// aliased to keep backwards compatibility
|
||||
babylon: babel,
|
||||
json: Object.assign({}, babelExpression, {
|
||||
hasPragma() {
|
||||
return true;
|
||||
}
|
||||
}),
|
||||
json5: babylonExpression,
|
||||
json5: babelExpression,
|
||||
"json-stringify": Object.assign(
|
||||
{
|
||||
parse: parseJson,
|
||||
|
@ -192,10 +191,10 @@ module.exports = {
|
|||
locFns
|
||||
),
|
||||
/** @internal */
|
||||
__js_expression: babylonExpression,
|
||||
__js_expression: babelExpression,
|
||||
/** for vue filter */
|
||||
__vue_expression: babylonExpression,
|
||||
__vue_expression: babelExpression,
|
||||
/** for vue event binding to handle semicolon */
|
||||
__vue_event_binding: babylon
|
||||
__vue_event_binding: babel
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1849,7 +1849,7 @@ function printPathNoParens(path, options, print, args) {
|
|||
|
||||
case "ForOfStatement":
|
||||
case "ForAwaitStatement": {
|
||||
// Babylon 7 removed ForAwaitStatement in favor of ForOfStatement
|
||||
// Babel 7 removed ForAwaitStatement in favor of ForOfStatement
|
||||
// with `"await": true`:
|
||||
// https://github.com/estree/estree/pull/138
|
||||
const isAwait = n.type === "ForAwaitStatement" || n.await;
|
||||
|
@ -2999,7 +2999,7 @@ function printPathNoParens(path, options, print, args) {
|
|||
// a type annotation comment.
|
||||
//
|
||||
// Note that we're able to use the normal whitespace regex here because the Flow parser has
|
||||
// already deemed this AST node to be a type cast. Only the Babylon parser needs the
|
||||
// already deemed this AST node to be a type cast. Only the Babel parser needs the
|
||||
// non-line-break whitespace regex, which is why hasFlowShorthandAnnotationComment() is
|
||||
// implemented differently.
|
||||
const commentSyntax =
|
||||
|
@ -4426,7 +4426,7 @@ function getFlowVariance(path) {
|
|||
return null;
|
||||
}
|
||||
|
||||
// Babylon 7.0 currently uses variance node type, and flow should
|
||||
// Babel 7.0 currently uses variance node type, and flow should
|
||||
// follow suit soon:
|
||||
// https://github.com/babel/babel/issues/4722
|
||||
const variance = path.variance.kind || path.variance;
|
||||
|
@ -6011,7 +6011,7 @@ function classChildNeedsASIProtection(node) {
|
|||
case "TSAbstractMethodDefinition": // TypeScript
|
||||
case "ClassMethod":
|
||||
case "ClassPrivateMethod": {
|
||||
// Babylon
|
||||
// Babel
|
||||
const isAsync = node.value ? node.value.async : node.async;
|
||||
const isGenerator = node.value ? node.value.generator : node.generator;
|
||||
if (isAsync || node.kind === "get" || node.kind === "set") {
|
||||
|
|
|
@ -55,7 +55,7 @@ function embed(path, print, textToDoc, options) {
|
|||
// MDX
|
||||
switch (node.type) {
|
||||
case "importExport":
|
||||
return textToDoc(node.value, { parser: "babylon" });
|
||||
return textToDoc(node.value, { parser: "babel" });
|
||||
case "jsx":
|
||||
return textToDoc(node.value, { parser: "__js_expression" });
|
||||
}
|
||||
|
|
|
@ -364,7 +364,7 @@ function findExpressionIndexForComment(quasis, comment, options) {
|
|||
|
||||
function getQuasiRange(expr) {
|
||||
if (expr.start !== undefined) {
|
||||
// Babylon
|
||||
// Babel
|
||||
return { start: expr.start, end: expr.end };
|
||||
}
|
||||
// Flow
|
||||
|
|
|
@ -123,7 +123,13 @@ const options = {
|
|||
typeof value === "string" || typeof value === "function",
|
||||
choices: [
|
||||
{ value: "flow", description: "Flow" },
|
||||
{ value: "babylon", description: "JavaScript" },
|
||||
{
|
||||
value: "babylon",
|
||||
description: "JavaScript",
|
||||
deprecated: "1.16.0",
|
||||
redirect: "babel"
|
||||
},
|
||||
{ value: "babel", since: "1.16.0", description: "JavaScript" },
|
||||
{ value: "typescript", since: "1.4.0", description: "TypeScript" },
|
||||
{ value: "css", since: "1.7.1", description: "CSS" },
|
||||
{
|
||||
|
|
|
@ -392,7 +392,7 @@ module.exports = {
|
|||
// Doesn't handle shebang for now
|
||||
formatDoc(doc, opts) {
|
||||
const debug = printDocToDebug(doc);
|
||||
opts = normalizeOptions(Object.assign({}, opts, { parser: "babylon" }));
|
||||
opts = normalizeOptions(Object.assign({}, opts, { parser: "babel" }));
|
||||
return format(debug, opts).formatted;
|
||||
},
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ function normalize(options, opts) {
|
|||
if (!rawOptions.filepath) {
|
||||
const logger = opts.logger || console;
|
||||
logger.warn(
|
||||
"No parser and no filepath given, using 'babylon' the parser now " +
|
||||
"No parser and no filepath given, using 'babel' the parser now " +
|
||||
"but this will throw an error in the future. " +
|
||||
"Please specify a parser or a filepath so one can be inferred."
|
||||
);
|
||||
rawOptions.parser = "babylon";
|
||||
rawOptions.parser = "babel";
|
||||
} else {
|
||||
rawOptions.parser = inferParser(rawOptions.filepath, rawOptions.plugins);
|
||||
if (!rawOptions.parser) {
|
||||
|
|
|
@ -136,7 +136,7 @@ function isSourceElement(opts, node) {
|
|||
];
|
||||
switch (opts.parser) {
|
||||
case "flow":
|
||||
case "babylon":
|
||||
case "babel":
|
||||
case "typescript":
|
||||
return jsSourceElements.indexOf(node.type) > -1;
|
||||
case "json":
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`arrow_call.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "flow", "typescript"]
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -112,7 +112,7 @@ promise.then(result =>
|
|||
|
||||
exports[`arrow_call.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "flow", "typescript"]
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
trailingComma: "all"
|
||||
| printWidth
|
||||
|
@ -224,7 +224,7 @@ promise.then(result =>
|
|||
exports[`arrow_call.js 3`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "flow", "typescript"]
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
run_spec(__dirname, ["babylon", "flow", "typescript"]);
|
||||
run_spec(__dirname, ["babylon", "flow", "typescript"], {
|
||||
run_spec(__dirname, ["babel", "flow", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "flow", "typescript"], {
|
||||
trailingComma: "all"
|
||||
});
|
||||
run_spec(__dirname, ["babylon", "flow", "typescript"], {
|
||||
run_spec(__dirname, ["babel", "flow", "typescript"], {
|
||||
arrowParens: "always"
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
exports[`arrow_function_expression.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -87,7 +87,7 @@ a = b => {
|
|||
exports[`arrow_function_expression.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -171,7 +171,7 @@ a = (b) => {
|
|||
exports[`block_like.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -186,7 +186,7 @@ a = () => ({} = this);
|
|||
exports[`block_like.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -201,7 +201,7 @@ a = () => ({} = this);
|
|||
exports[`call.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -382,7 +382,7 @@ fooooooooooooooooooooooooooooooooooooooooooooooooooo(action => next =>
|
|||
exports[`call.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -563,7 +563,7 @@ fooooooooooooooooooooooooooooooooooooooooooooooooooo((action) => (next) =>
|
|||
exports[`comment.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -636,7 +636,7 @@ export const bem = block =>
|
|||
exports[`comment.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -709,7 +709,7 @@ export const bem = (block) =>
|
|||
exports[`currying.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -756,7 +756,7 @@ const middleware = options => (req, res, next) => {
|
|||
exports[`currying.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -803,7 +803,7 @@ const middleware = (options) => (req, res, next) => {
|
|||
exports[`long-call-no-args.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -821,7 +821,7 @@ veryLongCall(
|
|||
exports[`long-call-no-args.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -839,7 +839,7 @@ veryLongCall(
|
|||
exports[`long-contents.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -863,7 +863,7 @@ const foo = () => {
|
|||
exports[`long-contents.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -887,7 +887,7 @@ const foo = () => {
|
|||
exports[`parens.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -935,7 +935,7 @@ foo(a => b, d);
|
|||
exports[`parens.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -983,7 +983,7 @@ foo((a) => b, d);
|
|||
exports[`short_body.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1008,7 +1008,7 @@ const initializeSnapshotState = (
|
|||
exports[`short_body.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1033,7 +1033,7 @@ const initializeSnapshotState = (
|
|||
exports[`type_params.js 1`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "avoid"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1048,7 +1048,7 @@ printWidth: 80
|
|||
exports[`type_params.js 2`] = `
|
||||
====================================options=====================================
|
||||
arrowParens: "always"
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
run_spec(__dirname, ["babylon", "typescript"], { arrowParens: "avoid" });
|
||||
run_spec(__dirname, ["babylon", "typescript"], { arrowParens: "always" });
|
||||
run_spec(__dirname, ["babel", "typescript"], { arrowParens: "avoid" });
|
||||
run_spec(__dirname, ["babel", "typescript"], { arrowParens: "always" });
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`arrows-bind.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`logical-assignment.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`example.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`literal.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`parens.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"]);
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`await.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -22,7 +22,7 @@ const doBothThings = async () => {
|
|||
|
||||
exports[`await.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
@ -43,7 +43,7 @@ const doBothThings = async () => {
|
|||
|
||||
exports[`bind_parens.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -115,7 +115,7 @@ b.c::d.e;
|
|||
|
||||
exports[`bind_parens.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
@ -188,7 +188,7 @@ b.c::d.e
|
|||
|
||||
exports[`long_name_method.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -218,7 +218,7 @@ class X {
|
|||
|
||||
exports[`long_name_method.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
@ -249,7 +249,7 @@ class X {
|
|||
|
||||
exports[`method_chain.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -295,7 +295,7 @@ function test(observable) {
|
|||
|
||||
exports[`method_chain.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
@ -342,7 +342,7 @@ function test(observable) {
|
|||
|
||||
exports[`short_name_method.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -371,7 +371,7 @@ class X {
|
|||
|
||||
exports[`short_name_method.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babylon"], { semi: false });
|
||||
run_spec(__dirname, ["babel"]);
|
||||
run_spec(__dirname, ["babel"], { semi: false });
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`binary.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -22,7 +22,7 @@ printWidth: 80
|
|||
|
||||
exports[`break.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -107,7 +107,7 @@ export class VisTimelineComponent2
|
|||
|
||||
exports[`call.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -121,7 +121,7 @@ printWidth: 80
|
|||
|
||||
exports[`empty.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -159,7 +159,7 @@ class A {
|
|||
|
||||
exports[`member.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -175,7 +175,7 @@ printWidth: 80
|
|||
|
||||
exports[`method.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -205,7 +205,7 @@ class C {
|
|||
|
||||
exports[`property.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -253,7 +253,7 @@ class B {
|
|||
|
||||
exports[`ternary.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"]);
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`example.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`private_fields.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -118,7 +118,7 @@ class E {
|
|||
|
||||
exports[`private_fields.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
@ -235,7 +235,7 @@ class E {
|
|||
|
||||
exports[`with_comments.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -261,7 +261,7 @@ class A {
|
|||
|
||||
exports[`with_comments.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babylon"], { semi: false });
|
||||
run_spec(__dirname, ["babel"]);
|
||||
run_spec(__dirname, ["babel"], { semi: false });
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`assignment-pattern.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -27,7 +27,7 @@ let {
|
|||
|
||||
exports[`before-comma.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -51,7 +51,7 @@ const foo = {
|
|||
|
||||
exports[`binary-expressions.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -205,7 +205,7 @@ function bitwiseXor() {
|
|||
|
||||
exports[`blank.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -259,7 +259,7 @@ printWidth: 80
|
|||
|
||||
exports[`break-continue-statements.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -293,7 +293,7 @@ loop: for (;;) {
|
|||
|
||||
exports[`call_comment.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -325,7 +325,7 @@ React.render(
|
|||
|
||||
exports[`closure-compiler-type-cast.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -379,7 +379,7 @@ var newArray = /** @type {array} */ (numberOrString.map(x => x));
|
|||
|
||||
exports[`dangling.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -421,7 +421,7 @@ export /* dangling */{};
|
|||
|
||||
exports[`dangling_array.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -443,7 +443,7 @@ expect(() => {}).toTriggerReadyStateChanges([
|
|||
|
||||
exports[`dangling_for.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -464,7 +464,7 @@ for (;;);
|
|||
|
||||
exports[`dynamic_imports.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -490,7 +490,7 @@ import("something" /* Hello */ + "else");
|
|||
|
||||
exports[`export.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -538,7 +538,7 @@ export {
|
|||
|
||||
exports[`first-line.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -554,7 +554,7 @@ b;
|
|||
|
||||
exports[`flow_union.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -604,7 +604,7 @@ type UploadState<E, EM, D> =
|
|||
|
||||
exports[`function-declaration.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -738,7 +738,7 @@ function foo() {
|
|||
|
||||
exports[`if.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -886,7 +886,7 @@ if (14) {
|
|||
|
||||
exports[`issues.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1117,7 +1117,7 @@ foo(
|
|||
|
||||
exports[`jsx.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1358,7 +1358,7 @@ onClick={() => {}}>
|
|||
|
||||
exports[`last-arg.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1550,7 +1550,7 @@ class Foo {
|
|||
|
||||
exports[`preserve-new-line-last.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1604,7 +1604,7 @@ function name() {
|
|||
|
||||
exports[`return-statement.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1866,7 +1866,7 @@ function inlineComment() {
|
|||
|
||||
exports[`single-star-jsdoc.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -1938,7 +1938,7 @@ if (true) {
|
|||
|
||||
exports[`switch.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -2025,7 +2025,7 @@ switch (foo) {
|
|||
|
||||
exports[`template-literal.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -2063,7 +2063,7 @@ d //comment
|
|||
|
||||
exports[`trailing_space.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -2085,7 +2085,7 @@ printWidth: 80
|
|||
|
||||
exports[`trailing-jsdocs.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -2146,7 +2146,7 @@ const CONNECTION_STATUS = (exports.CONNECTION_STATUS = {
|
|||
|
||||
exports[`try.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -2185,7 +2185,7 @@ try {
|
|||
|
||||
exports[`variable_declarator.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -2335,7 +2335,7 @@ const foo = 123;
|
|||
|
||||
exports[`while.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
exports[`jsx_same_line.js 1`] = `
|
||||
====================================options=====================================
|
||||
jsxBracketSameLine: true
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"], {
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"], {
|
||||
jsxBracketSameLine: true
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`pipeline_own_line.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`comments-1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -22,7 +22,7 @@ function ehllooo() {
|
|||
|
||||
exports[`comments-2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -41,7 +41,7 @@ const y = 5;
|
|||
|
||||
exports[`comments-3.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -59,7 +59,7 @@ const y = 5;
|
|||
|
||||
exports[`comments-4.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -79,7 +79,7 @@ const y = 5;
|
|||
|
||||
exports[`cursor-0.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -95,7 +95,7 @@ printWidth: 80
|
|||
|
||||
exports[`cursor-1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -111,7 +111,7 @@ printWidth: 80
|
|||
|
||||
exports[`cursor-2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -126,7 +126,7 @@ foo<|>(bar);
|
|||
|
||||
exports[`cursor-3.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -144,7 +144,7 @@ printWidth: 80
|
|||
|
||||
exports[`cursor-4.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -166,7 +166,7 @@ const y = 5;
|
|||
|
||||
exports[`cursor-5.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -180,7 +180,7 @@ const /* h<|>i */ y = 5;
|
|||
|
||||
exports[`cursor-6.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -194,7 +194,7 @@ const y /* h<|>i */ = 5;
|
|||
|
||||
exports[`cursor-7.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -213,7 +213,7 @@ const z = 9;
|
|||
|
||||
exports[`cursor-8.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -226,7 +226,7 @@ func<|>tion banana() {}
|
|||
|
||||
exports[`cursor-9.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -239,7 +239,7 @@ thisWillBeFormatted<|>(2, 3);
|
|||
|
||||
exports[`cursor-10.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -258,7 +258,7 @@ const y = 5;
|
|||
|
||||
exports[`file-start-with-comment-1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -274,7 +274,7 @@ haha();
|
|||
|
||||
exports[`file-start-with-comment-2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -290,7 +290,7 @@ haha()<|>;
|
|||
|
||||
exports[`range-0.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -312,7 +312,7 @@ thisWontBeFormatted ( 1 ,3)
|
|||
|
||||
exports[`range-1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -334,7 +334,7 @@ thisWontBeFormatted ( 1 ,3)
|
|||
|
||||
exports[`range-2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -356,7 +356,7 @@ thisWontBeFormatted ( 1 ,3)
|
|||
|
||||
exports[`range-3.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -378,7 +378,7 @@ thisWontBeFormatted <|> ( 1 ,3)
|
|||
|
||||
exports[`range-4.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
run_spec(__dirname, ["babylon", "typescript", "flow"]);
|
||||
run_spec(__dirname, ["babel", "typescript", "flow"]);
|
||||
|
||||
const prettier = require("prettier/local");
|
||||
|
||||
test("translates cursor correctly in basic case", () => {
|
||||
expect(
|
||||
prettier.formatWithCursor(" 1", { parser: "babylon", cursorOffset: 2 })
|
||||
prettier.formatWithCursor(" 1", { parser: "babel", cursorOffset: 2 })
|
||||
).toEqual({
|
||||
formatted: "1;\n",
|
||||
cursorOffset: 1
|
||||
|
@ -14,7 +14,7 @@ test("translates cursor correctly in basic case", () => {
|
|||
test("positions cursor relative to closest node, not SourceElement", () => {
|
||||
const code = "return 15";
|
||||
expect(
|
||||
prettier.formatWithCursor(code, { parser: "babylon", cursorOffset: 15 })
|
||||
prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 15 })
|
||||
).toEqual({
|
||||
formatted: "return 15;\n",
|
||||
cursorOffset: 7
|
||||
|
@ -24,7 +24,7 @@ test("positions cursor relative to closest node, not SourceElement", () => {
|
|||
test("keeps cursor inside formatted node", () => {
|
||||
const code = "return 15";
|
||||
expect(
|
||||
prettier.formatWithCursor(code, { parser: "babylon", cursorOffset: 14 })
|
||||
prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 14 })
|
||||
).toEqual({
|
||||
formatted: "return 15;\n",
|
||||
cursorOffset: 7
|
||||
|
@ -37,7 +37,7 @@ foo('bar', cb => {
|
|||
console.log('stuff')
|
||||
})`;
|
||||
expect(
|
||||
prettier.formatWithCursor(code, { parser: "babylon", cursorOffset: 24 })
|
||||
prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 24 })
|
||||
).toEqual({
|
||||
formatted: `foo("bar", cb => {
|
||||
console.log("stuff");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`comments.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`classes.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -49,7 +49,7 @@ const foo =
|
|||
|
||||
exports[`comments.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -120,7 +120,7 @@ export class Bar {}
|
|||
|
||||
exports[`methods.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -152,7 +152,7 @@ class Yo {
|
|||
|
||||
exports[`mobx.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -246,7 +246,7 @@ class OrderLine {
|
|||
|
||||
exports[`multiline.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -268,7 +268,7 @@ class Foo {
|
|||
|
||||
exports[`multiple.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -313,7 +313,7 @@ const foo = {
|
|||
|
||||
exports[`redux.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`after_export.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -24,7 +24,7 @@ class {}
|
|||
|
||||
exports[`before_export.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
// TypeScript and Flow don't accept decorator after export
|
||||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`destructuring.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"]);
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`escaped.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -84,7 +84,7 @@ printWidth: 80
|
|||
|
||||
exports[`last-line-0.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -97,7 +97,7 @@ printWidth: 80
|
|||
|
||||
exports[`last-line-1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -111,7 +111,7 @@ printWidth: 80
|
|||
|
||||
exports[`last-line-2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -126,7 +126,7 @@ printWidth: 80
|
|||
|
||||
exports[`newline.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -152,7 +152,7 @@ a();
|
|||
|
||||
exports[`no-newline.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -168,7 +168,7 @@ a;
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"]);
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`do.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"]);
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`empty 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
parsers: ["flow", "babel", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -14,7 +14,7 @@ printWidth: 80
|
|||
|
||||
exports[`newline 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
parsers: ["flow", "babel", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -27,7 +27,7 @@ printWidth: 80
|
|||
|
||||
exports[`space 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
parsers: ["flow", "babel", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -40,7 +40,7 @@ printWidth: 80
|
|||
|
||||
exports[`space-newline 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
parsers: ["flow", "babel", "typescript", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "html", "angular"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`class.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -27,7 +27,7 @@ class x {
|
|||
|
||||
exports[`empty_paren_comment.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon", "typescript"]
|
||||
parsers: ["flow", "babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon", "typescript"]);
|
||||
run_spec(__dirname, ["flow", "babel", "typescript"]);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
exports[`example.js 1`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "cr"
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -22,7 +22,7 @@ function f() {<CR>
|
|||
exports[`example.js 2`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "crlf"
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -41,7 +41,7 @@ function f() {<CRLF>
|
|||
exports[`example.js 3`] = `
|
||||
====================================options=====================================
|
||||
endOfLine: "lf"
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
run_spec(__dirname, ["babylon"], { endOfLine: "cr" });
|
||||
run_spec(__dirname, ["babylon"], { endOfLine: "crlf" });
|
||||
run_spec(__dirname, ["babylon"], { endOfLine: "lf" });
|
||||
run_spec(__dirname, ["babel"], { endOfLine: "cr" });
|
||||
run_spec(__dirname, ["babel"], { endOfLine: "crlf" });
|
||||
run_spec(__dirname, ["babel"], { endOfLine: "lf" });
|
||||
|
|
|
@ -16,7 +16,7 @@ export default () => {};
|
|||
|
||||
exports[`export_default_arrow_expression.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -44,7 +44,7 @@ export default foo();
|
|||
|
||||
exports[`export_default_call_expression.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -72,7 +72,7 @@ export default class Foo {}
|
|||
|
||||
exports[`export_default_class_declaration.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -100,7 +100,7 @@ export default (class foobar {});
|
|||
|
||||
exports[`export_default_class_expression.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -128,7 +128,7 @@ export default function() {}
|
|||
|
||||
exports[`export_default_function_declaration.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -156,7 +156,7 @@ export default async function foo() {}
|
|||
|
||||
exports[`export_default_function_declaration_async.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -184,7 +184,7 @@ export default function f() {}
|
|||
|
||||
exports[`export_default_function_declaration_named.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -212,7 +212,7 @@ export default (function() {});
|
|||
|
||||
exports[`export_default_function_expression.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -240,7 +240,7 @@ export default (function f() {});
|
|||
|
||||
exports[`export_default_function_expression_named.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -268,7 +268,7 @@ export default new Foo();
|
|||
|
||||
exports[`export_default_new_expression.js 2`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "typescript"]
|
||||
parsers: ["babel", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
run_spec(__dirname, ["flow"]);
|
||||
// FIXME export_default_function_declaration_async.js flow != babylon output
|
||||
run_spec(__dirname, ["babylon", "typescript"]);
|
||||
// FIXME export_default_function_declaration_async.js flow != babel output
|
||||
run_spec(__dirname, ["babel", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`export.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon"]
|
||||
parsers: ["babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon"]);
|
||||
run_spec(__dirname, ["babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`no_regression.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "flow", "typescript"]
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -18,7 +18,7 @@ printWidth: 80
|
|||
|
||||
exports[`use_strict.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "flow", "typescript"]
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon", "flow", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "flow", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babylon", "flow", "typescript"]
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["babylon", "flow", "typescript"]);
|
||||
run_spec(__dirname, ["babel", "flow", "typescript"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`delegate_yield.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -66,7 +66,7 @@ async function* delegate_return() {
|
|||
|
||||
exports[`generator.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -128,7 +128,7 @@ async function f() {
|
|||
|
||||
exports[`return.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -186,7 +186,7 @@ refuse_return()
|
|||
|
||||
exports[`throw.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`B.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -20,7 +20,7 @@ exports.numberValue = 42;
|
|||
|
||||
exports[`C.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -34,7 +34,7 @@ printWidth: 80
|
|||
|
||||
exports[`CommonJS_Clobbering_Class.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -98,7 +98,7 @@ module.exports = Test;
|
|||
|
||||
exports[`CommonJS_Clobbering_Lit.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -134,7 +134,7 @@ module.exports = {
|
|||
|
||||
exports[`CommonJS_Named.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -166,7 +166,7 @@ exports.numberValue5 = 5;
|
|||
|
||||
exports[`ES6_Default_AnonFunction1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -190,7 +190,7 @@ declare export default () => number;
|
|||
|
||||
exports[`ES6_Default_AnonFunction2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -214,7 +214,7 @@ declare export default () => number;
|
|||
|
||||
exports[`ES6_Default_NamedClass1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -252,7 +252,7 @@ declare export function getAFoo(): FooImpl;
|
|||
|
||||
exports[`ES6_Default_NamedClass2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -278,7 +278,7 @@ declare export default class Foo {
|
|||
|
||||
exports[`ES6_Default_NamedFunction1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -302,7 +302,7 @@ declare export default function foo(): number;
|
|||
|
||||
exports[`ES6_Default_NamedFunction2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -326,7 +326,7 @@ declare export default function foo(): number;
|
|||
|
||||
exports[`ES6_DefaultAndNamed.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -346,7 +346,7 @@ declare export var str: string;
|
|||
|
||||
exports[`ES6_ExportAllFrom_Intermediary1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -370,7 +370,7 @@ declare export * from "ES6_ExportAllFrom_Source1"
|
|||
|
||||
exports[`ES6_ExportAllFrom_Intermediary2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -394,7 +394,7 @@ declare export * from "ES6_ExportAllFrom_Source2"
|
|||
|
||||
exports[`ES6_ExportAllFrom_Source1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -418,7 +418,7 @@ declare export var numberValue1: number;
|
|||
|
||||
exports[`ES6_ExportAllFrom_Source2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -442,7 +442,7 @@ declare export var numberValue2: number;
|
|||
|
||||
exports[`ES6_ExportAllFromMulti.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -462,7 +462,7 @@ declare export * from "./ES6_ExportAllFrom_Source2"
|
|||
|
||||
exports[`ES6_ExportFrom_Intermediary1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -492,7 +492,7 @@ declare export {
|
|||
|
||||
exports[`ES6_ExportFrom_Intermediary2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -522,7 +522,7 @@ declare export {
|
|||
|
||||
exports[`ES6_ExportFrom_Source1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -548,7 +548,7 @@ declare export var numberValue2: number;
|
|||
|
||||
exports[`ES6_ExportFrom_Source2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -574,7 +574,7 @@ declare export var numberValue2: number;
|
|||
|
||||
exports[`ES6_Named1.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -630,7 +630,7 @@ declare export var varDeclNumber2: number;
|
|||
|
||||
exports[`ES6_Named2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -682,7 +682,7 @@ declare export var varDeclNumber4: number;
|
|||
|
||||
exports[`ProvidesModuleA.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -714,7 +714,7 @@ exports.stringValue = "str";
|
|||
|
||||
exports[`ProvidesModuleCJSDefault.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -742,7 +742,7 @@ module.exports = {
|
|||
|
||||
exports[`ProvidesModuleD.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -762,7 +762,7 @@ printWidth: 80
|
|||
|
||||
exports[`ProvidesModuleES6Default.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -794,7 +794,7 @@ export default {
|
|||
|
||||
exports[`SideEffects.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -808,7 +808,7 @@ printWidth: 80
|
|||
|
||||
exports[`es6modules.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`any.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -24,7 +24,7 @@ const val: string = dict[k]; // error: number incompatible with string
|
|||
|
||||
exports[`compatible.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -68,7 +68,7 @@ function foo2(x: {
|
|||
|
||||
exports[`dictionary.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -676,7 +676,7 @@ function subtype_optional_c_to_dict(x: { p?: C }): { [k: string]: B } {
|
|||
|
||||
exports[`incompatible.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -806,7 +806,7 @@ function foo8(x: { [key: string]: number }) {
|
|||
|
||||
exports[`issue-1745.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -868,7 +868,7 @@ class B {
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -900,7 +900,7 @@ module.exports = o;
|
|||
|
||||
exports[`test_client.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`es_declare_module.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
run_spec(__dirname, ["flow"]);
|
||||
|
||||
// TODO: While the tests render the same, Flow is dropping the line breaks
|
||||
// between each declaration while Babylon preserves them.
|
||||
//run_spec(__dirname, null, ["babylon"]);
|
||||
// between each declaration while babel preserves them.
|
||||
//run_spec(__dirname, null, ["babel"]);
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`getters_and_setters.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`class.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -150,7 +150,7 @@ foo.propOverriddenWithSetter = 123; // Error number ~> string
|
|||
|
||||
exports[`declare_class.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -256,7 +256,7 @@ foo.propOverriddenWithSetter = 123; // Error number ~> string
|
|||
|
||||
exports[`object.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -412,7 +412,7 @@ var testExampleOrOrderOfGetterAndSetterReordered: number =
|
|||
|
||||
exports[`object_type.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -531,7 +531,7 @@ function test(obj: T) {
|
|||
|
||||
exports[`react.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -583,7 +583,7 @@ const Example = React.createClass({
|
|||
|
||||
exports[`variance.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`client_object.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -20,7 +20,7 @@ var a: number = o.w.z.y;
|
|||
|
||||
exports[`object.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -50,7 +50,7 @@ module.exports = o3;
|
|||
|
||||
exports[`proto.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -76,7 +76,7 @@ var o2: Foo = new Foo();
|
|||
|
||||
exports[`super.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`type.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -208,7 +208,7 @@ declare var o13: O13;
|
|||
|
||||
exports[`type_any.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -246,7 +246,7 @@ var o3: O3 = (0: mixed); // ok
|
|||
|
||||
exports[`type_contra.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -284,7 +284,7 @@ declare var o2: O2;
|
|||
|
||||
exports[`type_dict.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -372,7 +372,7 @@ declare var o12: { ...{| [string]: T |}, ...{| [string]: U |} };
|
|||
|
||||
exports[`type_generic.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -390,7 +390,7 @@ declare function spread<A, B>(a: A, b: B): { ...A, ...B };
|
|||
|
||||
exports[`type_instance.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -430,7 +430,7 @@ declare var o2: O2;
|
|||
|
||||
exports[`type_intersection.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -498,7 +498,7 @@ declare var o5: O5;
|
|||
|
||||
exports[`type_intersection_optional.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -640,7 +640,7 @@ declare var o21: { ...{| p: T |} & { q: U } };
|
|||
|
||||
exports[`type_optional.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -712,7 +712,7 @@ declare var p: { ...{| p?: T |}, ...{| p?: U |} };
|
|||
|
||||
exports[`type_union.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`id.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -20,7 +20,7 @@ module.exports = id;
|
|||
|
||||
exports[`subtype.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -46,7 +46,7 @@ function subtypeCheck(x: Interface): ObjectType {
|
|||
|
||||
exports[`test.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -82,7 +82,7 @@ module.exports = id(methodCaller);
|
|||
|
||||
exports[`test2.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -128,7 +128,7 @@ b.f(); // error, property \`p\` not found
|
|||
|
||||
exports[`test3.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`filter.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -43,7 +43,7 @@ function is_string(x): %checks {
|
|||
|
||||
exports[`filter-union.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -91,7 +91,7 @@ declare var ab: Array<A | B | C>;
|
|||
|
||||
exports[`refine.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -198,7 +198,7 @@ function is_string_and_number(x, y): %checks {
|
|||
|
||||
exports[`sanity-filter.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -256,7 +256,7 @@ function is_string_regular(x): boolean {
|
|||
|
||||
exports[`sanity-filter-union.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -304,7 +304,7 @@ declare var ab: Array<A | B | C>;
|
|||
|
||||
exports[`sanity-refine.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
|
@ -1 +1 @@
|
|||
run_spec(__dirname, ["flow", "babylon"]);
|
||||
run_spec(__dirname, ["flow", "babel"]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`function-bind.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -95,7 +95,7 @@ if (m.bind(this)(x)) {
|
|||
|
||||
exports[`function-union.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -142,7 +142,7 @@ function foo(x: number | string | Array<string>): number {
|
|||
|
||||
exports[`is-string-decl.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -190,7 +190,7 @@ function foo(x: string | Array<string>): string {
|
|||
|
||||
exports[`logical-or.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -248,7 +248,7 @@ Number(dollars) || 0;
|
|||
|
||||
exports[`object-invariant.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -307,7 +307,7 @@ function f(_this: { m: ?Meeting }): string {
|
|||
|
||||
exports[`orig-string-tag-check.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -342,7 +342,7 @@ function foo(x: string | Array<string>): string {
|
|||
|
||||
exports[`sanity-fall-through.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -380,7 +380,7 @@ function foo(s: Array<string>): string {
|
|||
|
||||
exports[`sanity-invalid-calls.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -429,7 +429,7 @@ function foo(s: Array<string>): string {
|
|||
|
||||
exports[`sanity-is-string-bug.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -471,7 +471,7 @@ function bar(x: string | Array<string>): string {
|
|||
|
||||
exports[`sanity-parameter-mismatch.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -503,7 +503,7 @@ foo(3, 3);
|
|||
|
||||
exports[`sanity-pred-with-body.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
@ -546,7 +546,7 @@ function foo(x: string | Array<string>): string {
|
|||
|
||||
exports[`sanity-return-type.js 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["flow", "babylon"]
|
||||
parsers: ["flow", "babel"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue