diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..7e09d0a0e --- /dev/null +++ b/.eslintrc @@ -0,0 +1,11 @@ +{ + "parserOptions": { + "ecmaVersion": "2015" + }, + "plugins": [ + "prettier" + ], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/.travis.yml b/.travis.yml index 9e1a0728a..0ad56dfcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,6 @@ cache: yarn: true directories: - node_modules -script: npm test -- --runInBand +script: + - npm run lint + - npm test -- --runInBand diff --git a/bin/prettier.js b/bin/prettier.js index 5f5dcd244..4ccf24f53 100755 --- a/bin/prettier.js +++ b/bin/prettier.js @@ -9,7 +9,7 @@ const chalk = require("chalk"); const minimist = require("minimist"); const readline = require("readline"); const prettier = require("../index"); -const cleanAST = require('../src/clean-ast.js').cleanAST; +const cleanAST = require("../src/clean-ast.js").cleanAST; const argv = minimist(process.argv.slice(2), { boolean: [ @@ -33,8 +33,20 @@ const argv = minimist(process.argv.slice(2), { // Deprecated in 0.0.10 "flow-parser" ], - string: ["print-width", "tab-width", "parser", "trailing-comma", "range-start", "range-end"], - default: { semi: true, color: true, "bracket-spacing": true, parser: "babylon" }, + string: [ + "print-width", + "tab-width", + "parser", + "trailing-comma", + "range-start", + "range-end" + ], + default: { + semi: true, + color: true, + "bracket-spacing": true, + parser: "babylon" + }, alias: { help: "h", version: "v", "list-different": "l" }, unknown: param => { if (param.startsWith("-")) { @@ -148,8 +160,9 @@ function format(input) { if (argv["debug-check"]) { function diff(a, b) { - return require("diff") - .createTwoFilesPatch("", "", a, b, "", "", { context: 2 }); + return require("diff").createTwoFilesPatch("", "", a, b, "", "", { + context: 2 + }); } const pp = prettier.format(input, options); @@ -162,14 +175,13 @@ function format(input) { if (ast !== past) { const MAX_AST_SIZE = 2097152; // 2MB - const astDiff = (ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE) + const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past); - throw ( - "ast(input) !== ast(prettier(input))\n" + - astDiff + "\n" + - diff(input, pp) - ); + throw "ast(input) !== ast(prettier(input))\n" + + astDiff + + "\n" + + diff(input, pp); } } return; diff --git a/package.json b/package.json index 737011602..286b7aeb1 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,11 @@ }, "devDependencies": { "diff": "3.2.0", + "eslint": "^3.19.0", + "eslint-plugin-prettier": "^2.1.1", "jest": "20.0.0", "mkdirp": "^0.5.1", + "prettier": "^1.3.1", "rimraf": "^2.6.1", "rollup": "0.41.1", "rollup-plugin-commonjs": "7.0.0", @@ -39,7 +42,8 @@ "test": "jest", "format": "./bin/prettier.js --write", "format:single": "npm run format -- src/printer.js", - "format:all": "npm run format -- index.js \"{src,bin,tests_config,scripts}/*.js\" \"tests/**/jsfmt.spec.js\"", + "format:all": "npm run lint -- --fix", + "lint": "eslint index.js \"{src,bin,tests_config,scripts}/*.js\" \"tests/**/jsfmt.spec.js\"", "build:docs": "rollup -c docs/rollup.config.js" }, "jest": { diff --git a/src/clean-ast.js b/src/clean-ast.js index f7659dcbd..6e1828bc0 100644 --- a/src/clean-ast.js +++ b/src/clean-ast.js @@ -59,7 +59,7 @@ function massageAST(ast) { if ( (ast.type === "Property" || ast.type === "MethodDefinition" || - ast.type === "ClassProperty") && + ast.type === "ClassProperty") && typeof ast.key === "object" && ast.key && (ast.key.type === "Literal" || ast.key.type === "Identifier") diff --git a/src/comments.js b/src/comments.js index 1a32ef420..bb75334d2 100644 --- a/src/comments.js +++ b/src/comments.js @@ -403,7 +403,9 @@ function handleIfStatementComments( comment ) { if ( - !enclosingNode || enclosingNode.type !== "IfStatement" || !followingNode + !enclosingNode || + enclosingNode.type !== "IfStatement" || + !followingNode ) { return false; } @@ -435,7 +437,9 @@ function handleIfStatementComments( // Same as IfStatement but for TryStatement function handleTryStatementComments(enclosingNode, followingNode, comment) { if ( - !enclosingNode || enclosingNode.type !== "TryStatement" || !followingNode + !enclosingNode || + enclosingNode.type !== "TryStatement" || + !followingNode ) { return false; } @@ -903,7 +907,8 @@ function printComments(path, print, options, needsSemi) { const value = path.getValue(); const parent = path.getParentNode(); const printed = print(path); - const comments = n.Node.check(value) && types.getFieldValue(value, "comments"); + const comments = + n.Node.check(value) && types.getFieldValue(value, "comments"); if (!comments || comments.length === 0) { return printed; diff --git a/src/doc-debug.js b/src/doc-debug.js index 21d8a38ad..870b80cd6 100644 --- a/src/doc-debug.js +++ b/src/doc-debug.js @@ -102,10 +102,7 @@ function printDoc(doc) { } if (doc.type === "fill") { - return ("fill") + - "(" + - doc.parts.map(printDoc).join(", ") + - ")"; + return "fill" + "(" + doc.parts.map(printDoc).join(", ") + ")"; } if (doc.type === "line-suffix") { diff --git a/src/doc-printer.js b/src/doc-printer.js index f667eecd1..16af957a8 100644 --- a/src/doc-printer.js +++ b/src/doc-printer.js @@ -236,7 +236,6 @@ function printDocToString(doc, options) { break; } break; - // Fills each line with as much code as possible before moving to a new // line with the same indentation. // @@ -268,7 +267,7 @@ function printDocToString(doc, options) { const content = parts[0]; const contentFlatCmd = [ind, MODE_FLAT, content]; const contentBreakCmd = [ind, MODE_BREAK, content]; - const contentFits = fits(contentFlatCmd, [], width - rem, true) + const contentFits = fits(contentFlatCmd, [], width - rem, true); if (parts.length === 1) { if (contentFits) { @@ -280,8 +279,8 @@ function printDocToString(doc, options) { } const whitespace = parts[1]; - const whitespaceFlatCmd = [ind, MODE_FLAT, whitespace] - const whitespaceBreakCmd = [ind, MODE_BREAK, whitespace] + const whitespaceFlatCmd = [ind, MODE_FLAT, whitespace]; + const whitespaceBreakCmd = [ind, MODE_BREAK, whitespace]; if (parts.length === 2) { if (contentFits) { @@ -298,15 +297,24 @@ function printDocToString(doc, options) { const remainingCmd = [ind, mode, fill(remaining)]; const secondContent = parts[2]; - const firstAndSecondContentFlatCmd = [ind, MODE_FLAT, concat([content, whitespace, secondContent])]; - const firstAndSecondContentFits = fits(firstAndSecondContentFlatCmd, [], rem, true); + const firstAndSecondContentFlatCmd = [ + ind, + MODE_FLAT, + concat([content, whitespace, secondContent]) + ]; + const firstAndSecondContentFits = fits( + firstAndSecondContentFlatCmd, + [], + rem, + true + ); if (firstAndSecondContentFits) { - cmds.push(remainingCmd) + cmds.push(remainingCmd); cmds.push(whitespaceFlatCmd); cmds.push(contentFlatCmd); } else if (contentFits) { - cmds.push(remainingCmd) + cmds.push(remainingCmd); cmds.push(whitespaceBreakCmd); cmds.push(contentFlatCmd); } else { diff --git a/src/fast-path.js b/src/fast-path.js index ddf28ccb1..eca2b99c4 100644 --- a/src/fast-path.js +++ b/src/fast-path.js @@ -69,7 +69,7 @@ function getNodeHelper(path, count) { for (let i = s.length - 1; i >= 0; i -= 2) { const value = s[i]; - if ((n.Node.check(value)) && --count < 0) { + if (n.Node.check(value) && --count < 0) { return value; } } @@ -449,7 +449,7 @@ FPp.needsParens = function() { ); case "AssignmentExpression": { - const grandParent = this.getParentNode(1) + const grandParent = this.getParentNode(1); if (parent.type === "ArrowFunctionExpression" && parent.body === node) { return true; @@ -459,7 +459,10 @@ FPp.needsParens = function() { parent.computed ) { return false; - } else if (parent.type === "TSPropertySignature" && parent.name === node) { + } else if ( + parent.type === "TSPropertySignature" && + parent.name === node + ) { return false; } else if ( parent.type === "ForStatement" && diff --git a/src/parser.js b/src/parser.js index 9de488dd1..3cf853236 100644 --- a/src/parser.js +++ b/src/parser.js @@ -103,12 +103,8 @@ function parseWithTypeScript(text) { // But if we get it wrong, try the opposite. return tryParseTypeScript(text, !jsx); } - } catch(e) { - throw createError( - e.message, - e.lineNumber, - e.column - ); + } catch (e) { + throw createError(e.message, e.lineNumber, e.column); } } @@ -131,11 +127,14 @@ function tryParseTypeScript(text, jsx) { * https://github.com/prettier/prettier/issues/1538 */ function isProbablyJsx(text) { - return new RegExp([ - "(^[^\"'`]*)" // Contains "/>" on line not starting with "//" - ].join(""), "m").test(text); + return new RegExp( + [ + "(^[^\"'`]*)" // Contains "/>" on line not starting with "//" + ].join(""), + "m" + ).test(text); } module.exports = { parse }; diff --git a/src/printer.js b/src/printer.js index 140059326..c5ac5bb2c 100644 --- a/src/printer.js +++ b/src/printer.js @@ -67,7 +67,12 @@ function genericPrint(path, options, printPath, args) { const parts = []; let needsParens = false; - const linesWithoutParens = genericPrintNoParens(path, options, printPath, args); + const linesWithoutParens = genericPrintNoParens( + path, + options, + printPath, + args + ); if (!node || isEmpty(linesWithoutParens)) { return linesWithoutParens; @@ -185,14 +190,7 @@ function genericPrintNoParens(path, options, print, args) { case "ExpressionStatement": // Detect Flow-parsed directives if (n.directive) { - return concat([ - nodeStr( - n.expression, - options, - true - ), - semi - ]); + return concat([nodeStr(n.expression, options, true), semi]); } return concat([path.call(print, "expression"), semi]); // Babel extension. case "ParenthesizedExpression": @@ -285,16 +283,15 @@ function genericPrintNoParens(path, options, print, args) { firstNonMemberParent = path.getParentNode(i); i++; } while ( - firstNonMemberParent && - firstNonMemberParent.type === "MemberExpression" + firstNonMemberParent && firstNonMemberParent.type === "MemberExpression" ); const shouldInline = - firstNonMemberParent && ( - (firstNonMemberParent.type === "VariableDeclarator" && + (firstNonMemberParent && + ((firstNonMemberParent.type === "VariableDeclarator" && firstNonMemberParent.id.type !== "Identifier") || - (firstNonMemberParent.type === "AssignmentExpression" && - firstNonMemberParent.left.type !== "Identifier")) || + (firstNonMemberParent.type === "AssignmentExpression" && + firstNonMemberParent.left.type !== "Identifier"))) || n.computed || (n.object.type === "Identifier" && n.property.type === "Identifier" && @@ -328,15 +325,14 @@ function genericPrintNoParens(path, options, print, args) { case "Path": return join(".", n.body); case "Identifier": { - const parentNode = path.getParentNode() + const parentNode = path.getParentNode(); const isFunctionDeclarationIdentifier = - parentNode.type === 'DeclareFunction' && - parentNode.id === n; + parentNode.type === "DeclareFunction" && parentNode.id === n; return concat([ n.name, n.optional ? "?" : "", - (n.typeAnnotation && !isFunctionDeclarationIdentifier) ? ": " : "", + n.typeAnnotation && !isFunctionDeclarationIdentifier ? ": " : "", path.call(print, "typeAnnotation") ]); } @@ -773,11 +769,7 @@ function genericPrintNoParens(path, options, print, args) { ); if (n.heritage.length) { - parts.push( - "extends ", - join(", ", path.map(print, "heritage")), - " " - ); + parts.push("extends ", join(", ", path.map(print, "heritage")), " "); } parts.push(path.call(print, "body")); @@ -791,7 +783,8 @@ function genericPrintNoParens(path, options, print, args) { const isTypeAnnotation = n.type === "ObjectTypeAnnotation"; const isTypeScriptTypeAnnotation = n.type === "TSTypeLiteral"; const isTypeScriptInterfaceBody = n.type === "TSInterfaceBody"; - const isTypeScriptType = isTypeScriptTypeAnnotation || isTypeScriptInterfaceBody; + const isTypeScriptType = + isTypeScriptTypeAnnotation || isTypeScriptInterfaceBody; // Leave this here because we *might* want to make this // configurable later -- flow accepts ";" for type separators, // typescript accepts ";" and newlines @@ -807,7 +800,7 @@ function genericPrintNoParens(path, options, print, args) { const parentIsUnionTypeAnnotation = parent.type === "UnionTypeAnnotation"; let propertiesField; - if (n.type === 'TSTypeLiteral') { + if (n.type === "TSTypeLiteral") { propertiesField = "members"; } else if (n.type === "TSInterfaceBody") { propertiesField = "body"; @@ -836,25 +829,19 @@ function genericPrintNoParens(path, options, print, args) { }); let separatorParts = []; - const props = propsAndLoc - .sort((a, b) => a.loc - b.loc) - .map(prop => { - const result = concat(separatorParts.concat(group(prop.printed))); - separatorParts = [separator, line]; - if ( - util.isNextLineEmpty(options.originalText, prop.node) - ) { - separatorParts.push(hardline); - } - return result; - }); + const props = propsAndLoc.sort((a, b) => a.loc - b.loc).map(prop => { + const result = concat(separatorParts.concat(group(prop.printed))); + separatorParts = [separator, line]; + if (util.isNextLineEmpty(options.originalText, prop.node)) { + separatorParts.push(hardline); + } + return result; + }); const lastElem = util.getLast(n[propertiesField]); - const canHaveTrailingSeparator = !( - lastElem && - (lastElem.type === "RestProperty" || lastElem.type === "RestElement") - ); + const canHaveTrailingSeparator = !(lastElem && + (lastElem.type === "RestProperty" || lastElem.type === "RestElement")); let content; if (props.length === 0 && !n.typeAnnotation) { @@ -876,17 +863,14 @@ function genericPrintNoParens(path, options, print, args) { indent( align( parentIsUnionTypeAnnotation ? 2 : 0, - concat([ - options.bracketSpacing ? line : softline, - concat(props) - ]) + concat([options.bracketSpacing ? line : softline, concat(props)]) ) ), ifBreak( canHaveTrailingSeparator && (separator !== "," || shouldPrintComma(options)) - ? separator - : "" + ? separator + : "" ), align( parentIsUnionTypeAnnotation ? 2 : 0, @@ -1100,9 +1084,13 @@ function genericPrintNoParens(path, options, print, args) { concat([ line, "? ", - n.consequent.type === "ConditionalExpression" ? ifBreak("", "(") : "", + n.consequent.type === "ConditionalExpression" + ? ifBreak("", "(") + : "", align(2, path.call(print, "consequent")), - n.consequent.type === "ConditionalExpression" ? ifBreak("", ")") : "", + n.consequent.type === "ConditionalExpression" + ? ifBreak("", ")") + : "", line, ": ", align(2, path.call(print, "alternate")) @@ -1162,12 +1150,14 @@ function genericPrintNoParens(path, options, print, args) { options ); case "WithStatement": - return group(concat([ - "with (", - path.call(print, "object"), - ")", - adjustClause(n.body, path.call(print, "body")) - ])); + return group( + concat([ + "with (", + path.call(print, "object"), + ")", + adjustClause(n.body, path.call(print, "body")) + ]) + ); case "IfStatement": const con = adjustClause(n.consequent, path.call(print, "consequent")); const opening = group( @@ -1224,52 +1214,58 @@ function genericPrintNoParens(path, options, print, args) { return concat([ printedComments, - group(concat([ - "for (", + group( + concat([ + "for (", + group( + concat([ + indent( + concat([ + softline, + path.call(print, "init"), + ";", + line, + path.call(print, "test"), + ";", + line, + path.call(print, "update") + ]) + ), + softline + ]) + ), + ")", + body + ]) + ) + ]); + } + case "WhileStatement": + return group( + concat([ + "while (", group( concat([ - indent( - concat([ - softline, - path.call(print, "init"), - ";", - line, - path.call(print, "test"), - ";", - line, - path.call(print, "update") - ]) - ), + indent(concat([softline, path.call(print, "test")])), softline ]) ), ")", - body - ])) - ]); - } - case "WhileStatement": - return group(concat([ - "while (", - group( - concat([ - indent(concat([softline, path.call(print, "test")])), - softline - ]) - ), - ")", - adjustClause(n.body, path.call(print, "body")) - ])); + adjustClause(n.body, path.call(print, "body")) + ]) + ); case "ForInStatement": // Note: esprima can't actually parse "for each (". - return group(concat([ - n.each ? "for each (" : "for (", - path.call(print, "left"), - " in ", - path.call(print, "right"), - ")", - adjustClause(n.body, path.call(print, "body")) - ])); + return group( + concat([ + n.each ? "for each (" : "for (", + path.call(print, "left"), + " in ", + path.call(print, "right"), + ")", + adjustClause(n.body, path.call(print, "body")) + ]) + ); case "ForOfStatement": case "ForAwaitStatement": @@ -1278,16 +1274,18 @@ function genericPrintNoParens(path, options, print, args) { // https://github.com/estree/estree/pull/138 const isAwait = n.type === "ForAwaitStatement" || n.await; - return group(concat([ - "for", - isAwait ? " await" : "", - " (", - path.call(print, "left"), - " of ", - path.call(print, "right"), - ")", - adjustClause(n.body, path.call(print, "body")) - ])); + return group( + concat([ + "for", + isAwait ? " await" : "", + " (", + path.call(print, "left"), + " of ", + path.call(print, "right"), + ")", + adjustClause(n.body, path.call(print, "body")) + ]) + ); case "DoWhileStatement": const clause = adjustClause(n.body, path.call(print, "body")); @@ -1301,12 +1299,11 @@ function genericPrintNoParens(path, options, print, args) { } parts.push("while ("); - parts.push(group( - concat([ - indent(softline), path.call(print, "test"), - softline - ]) - ), ")", semi); + parts.push( + group(concat([indent(softline), path.call(print, "test"), softline])), + ")", + semi + ); return concat(parts); case "DoExpression": @@ -1544,7 +1541,8 @@ function genericPrintNoParens(path, options, print, args) { case "JSXText": throw new Error("JSXTest should be handled by JSXElement"); case "JSXEmptyExpression": - const requiresHardline = n.comments && !n.comments.every(util.isBlockComment); + const requiresHardline = + n.comments && !n.comments.every(util.isBlockComment); return concat([ comments.printDanglingComments( @@ -1668,7 +1666,7 @@ function genericPrintNoParens(path, options, print, args) { // of the `. let size = 0; const value = childPath.getValue().value.raw; - const index = value.lastIndexOf('\n'); + const index = value.lastIndexOf("\n"); const tabWidth = options.tabWidth; if (index !== -1) { size = util.getAlignmentSize(value, tabWidth, index + 1); @@ -1680,12 +1678,7 @@ function genericPrintNoParens(path, options, print, args) { tabWidth ); - parts.push( - "${", - aligned, - lineSuffixBoundary, - "}" - ); + parts.push("${", aligned, lineSuffixBoundary, "}"); } }, "quasis"); @@ -1717,7 +1710,7 @@ function genericPrintNoParens(path, options, print, args) { // transformed away before printing. case "TypeAnnotation": if (n.typeAnnotation) { - return path.call(print, 'typeAnnotation') + return path.call(print, "typeAnnotation"); } return ""; @@ -1930,11 +1923,10 @@ function genericPrintNoParens(path, options, print, args) { const parent = path.getParentNode(); // If there's a leading comment, the parent is doing the indentation - const shouldIndent = ( + const shouldIndent = parent.type !== "TypeParameterInstantiation" && !(parent.type === "TypeAlias" && - hasLeadingOwnLineComment(options.originalText, n)) - ); + hasLeadingOwnLineComment(options.originalText, n)); //const token = isIntersection ? "&" : "|"; const code = concat([ @@ -2012,9 +2004,7 @@ function genericPrintNoParens(path, options, print, args) { parts.push("declare "); } - const canBreak = ( - n.right.type === "StringLiteralTypeAnnotation" - ); + const canBreak = n.right.type === "StringLiteralTypeAnnotation"; const printed = printAssignmentRight( n.right, @@ -2093,7 +2083,7 @@ function genericPrintNoParens(path, options, print, args) { case "TSConstKeyword": return "const"; case "TSDeclareKeyword": - return "declare" + return "declare"; case "TSExportKeyword": return "export"; case "TSNeverKeyword": @@ -2129,7 +2119,8 @@ function genericPrintNoParens(path, options, print, args) { case "TSArrayType": return concat([path.call(print, "elementType"), "[]"]); case "TSPropertySignature": - const computed = !namedTypes.Identifier.check(n.name) && + const computed = + !namedTypes.Identifier.check(n.name) && !namedTypes.Literal.check(n.name); parts.push(printTypeScriptModifiers(path, options, print)); @@ -2155,7 +2146,7 @@ function genericPrintNoParens(path, options, print, args) { // This isn't valid semantically, but it's in the AST so we can print it. if (n.initializer) { - parts.push(" = ", path.call(print, "initializer")); + parts.push(" = ", path.call(print, "initializer")); } return concat(parts); @@ -2200,14 +2191,14 @@ function genericPrintNoParens(path, options, print, args) { case "TSThisType": return "this"; case "TSLastTypeNode": - return path.call(print, "literal") + return path.call(print, "literal"); case "TSIndexedAccessType": return concat([ path.call(print, "objectType"), "[", path.call(print, "indexType"), "]" - ]) + ]); case "TSConstructSignature": case "TSConstructorType": case "TSCallSignature": @@ -2217,26 +2208,16 @@ function genericPrintNoParens(path, options, print, args) { const isType = n.type === "TSConstructorType"; if (n.typeParameters) { - parts.push(printTypeParameters(path, options, print, "typeParameters")) + parts.push(printTypeParameters(path, options, print, "typeParameters")); } - parts.push( - "(", - join(", ", path.map(print, "parameters")), - ")" - ); + parts.push("(", join(", ", path.map(print, "parameters")), ")"); if (n.typeAnnotation) { - parts.push( - isType ? " => " : ": ", - path.call(print, "typeAnnotation") - ); + parts.push(isType ? " => " : ": ", path.call(print, "typeAnnotation")); } return concat(parts); case "TSTypeOperator": - return concat([ - "keyof ", - path.call(print, "typeAnnotation") - ]) + return concat(["keyof ", path.call(print, "typeAnnotation")]); case "TSMappedType": return group( concat([ @@ -2256,11 +2237,7 @@ function genericPrintNoParens(path, options, print, args) { path.call(print, "typeAnnotation") ]) ), - comments.printDanglingComments( - path, - options, - /* sameIndent */ true - ), + comments.printDanglingComments(path, options, /* sameIndent */ true), options.bracketSpacing ? line : softline, "}" ]) @@ -2269,41 +2246,29 @@ function genericPrintNoParens(path, options, print, args) { parts.push(path.call(print, "name")); if (n.constraint) { - parts.push( - " in ", - path.call(print, "constraint") - ); + parts.push(" in ", path.call(print, "constraint")); } - return concat(parts) + return concat(parts); case "TSMethodSignature": parts.push( path.call(print, "name"), printFunctionTypeParameters(path, options, print), printFunctionParams(path, print, options) - ) + ); if (n.typeAnnotation) { - parts.push( - ": ", - path.call(print, "typeAnnotation") - ) + parts.push(": ", path.call(print, "typeAnnotation")); } - return concat(parts) + return concat(parts); case "TSNamespaceExportDeclaration": if (n.declaration) { - parts.push( - "export ", - path.call(print, "declaration") - ) + parts.push("export ", path.call(print, "declaration")); } else { - parts.push( - "export as namespace ", - path.call(print, "name") - ) + parts.push("export as namespace ", path.call(print, "name")); if (options.semi) { - parts.push(";") + parts.push(";"); } } @@ -2313,11 +2278,7 @@ function genericPrintNoParens(path, options, print, args) { parts.push(printTypeScriptModifiers(path, options, print)); } - parts.push( - "enum ", - path.call(print, "name"), - " " - ) + parts.push("enum ", path.call(print, "name"), " "); if (n.members.length === 0) { parts.push( @@ -2370,19 +2331,15 @@ function genericPrintNoParens(path, options, print, args) { path.call(print, "name"), " = ", path.call(print, "moduleReference") - ) + ); if (options.semi) { - parts.push(";") + parts.push(";"); } return group(concat(parts)); case "TSExternalModuleReference": - return concat([ - "require(", - path.call(print, "expression"), - ")" - ]) + return concat(["require(", path.call(print, "expression"), ")"]); case "TSModuleDeclaration": { const parent = path.getParentNode(); const isExternalModule = namedTypes.Literal.check(n.name); @@ -2396,10 +2353,11 @@ function genericPrintNoParens(path, options, print, args) { // Global declaration looks like this: // declare global { ... } - const isGlobalDeclaration = n.name.type === "Identifier" && + const isGlobalDeclaration = + n.name.type === "Identifier" && n.name.name === "global" && - n.modifiers && - n.modifiers.some(modifier => modifier.type === "TSDeclareKeyword"); + n.modifiers && + n.modifiers.some(modifier => modifier.type === "TSDeclareKeyword"); if (!isGlobalDeclaration) { parts.push(isExternalModule ? "module " : "namespace "); @@ -2495,10 +2453,7 @@ function printStatementSequence(path, options, print) { // in no-semi mode, prepend statement with semicolon if it might break ASI if (!options.semi && !isClass && stmtNeedsASIProtection(stmtPath)) { - if ( - stmt.comments && - stmt.comments.some(comment => comment.leading) - ) { + if (stmt.comments && stmt.comments.some(comment => comment.leading)) { // Note: stmtNeedsASIProtection requires stmtPath to already be printed // as it reads needsParens which is mutated on the instance parts.push(print(stmtPath, { needsSemi: true })); @@ -2583,13 +2538,20 @@ function printMethod(path, options, print) { parts.push( key, - concat(path.call(valuePath => [ - printFunctionTypeParameters(valuePath, options, print), - group(concat([ - printFunctionParams(valuePath, print, options), - printReturnType(valuePath, print) - ])) - ], "value")) + concat( + path.call( + valuePath => [ + printFunctionTypeParameters(valuePath, options, print), + group( + concat([ + printFunctionParams(valuePath, print, options), + printReturnType(valuePath, print) + ]) + ) + ], + "value" + ) + ) ); if (!node.value.body || node.value.body.length === 0) { @@ -2671,9 +2633,9 @@ function printArgumentsList(path, options, print) { let i = 0; path.each(function(argPath) { if (shouldGroupFirst && i === 0) { - printedExpanded = - [argPath.call(p => print(p, { expandFirstArg: true }))] - .concat(printed.slice(1)); + printedExpanded = [ + argPath.call(p => print(p, { expandFirstArg: true })) + ].concat(printed.slice(1)); } if (shouldGroupLast && i === args.length - 1) { printedExpanded = printed @@ -2735,17 +2697,13 @@ function printArgumentsList(path, options, print) { function printFunctionTypeParameters(path, options, print) { const fun = path.getValue(); - const paramsFieldIsArray = Array.isArray(fun["typeParameters"]) + const paramsFieldIsArray = Array.isArray(fun["typeParameters"]); if (fun.typeParameters) { // for TSFunctionType typeParameters is an array // for FunctionTypeAnnotation it's a single node if (paramsFieldIsArray) { - return concat( - "<", - join(", ", path.map(print, "typeParameters")), - ">" - ) + return concat("<", join(", ", path.map(print, "typeParameters")), ">"); } else { return path.call(print, "typeParameters"); } @@ -2757,10 +2715,10 @@ function printFunctionTypeParameters(path, options, print) { function printFunctionParams(path, print, options, expandArg) { const fun = path.getValue(); // namedTypes.Function.assert(fun); - const paramsField = (fun.type === "TSFunctionType" || - fun.type === "TSMethodSignature") - ? "parameters" - : "params"; + const paramsField = fun.type === "TSFunctionType" || + fun.type === "TSMethodSignature" + ? "parameters" + : "params"; const printed = path.map(print, paramsField); @@ -2842,7 +2800,8 @@ function printFunctionParams(path, print, options, expandArg) { fun[paramsField].length === 1 && fun[paramsField][0].name === null && fun[paramsField][0].typeAnnotation && - flowTypeAnnotations.indexOf(fun[paramsField][0].typeAnnotation.type) !== -1 && + flowTypeAnnotations.indexOf(fun[paramsField][0].typeAnnotation.type) !== + -1 && !fun.rest; if (isFlowShorthandWithOneArg) { @@ -2850,8 +2809,7 @@ function printFunctionParams(path, print, options, expandArg) { } const canHaveTrailingComma = - !(lastParam && lastParam.type === "RestElement") && - !fun.rest; + !(lastParam && lastParam.type === "RestElement") && !fun.rest; return concat([ "(", @@ -2920,7 +2878,9 @@ function printObjectMethod(path, options, print) { parts.push("*"); } if ( - objMethod.method || objMethod.kind === "get" || objMethod.kind === "set" + objMethod.method || + objMethod.kind === "get" || + objMethod.kind === "set" ) { return printMethod(path, options, print); } @@ -3100,10 +3060,7 @@ function printTypeScriptModifiers(path, options, print) { if (!n.modifiers || !n.modifiers.length) { return ""; } - return concat([ - join(" ", path.map(print, "modifiers")), - " " - ]); + return concat([join(" ", path.map(print, "modifiers")), " "]); } function printTypeParameters(path, options, print, paramsKey) { @@ -3115,7 +3072,7 @@ function printTypeParameters(path, options, print, paramsKey) { // for TypeParameterDeclaration typeParameters is a single node if (!Array.isArray(n[paramsKey])) { - return path.call(print, paramsKey) + return path.call(print, paramsKey); } const shouldInline = @@ -3200,18 +3157,13 @@ function printMemberLookup(path, options, print) { if ( !n.property || (n.property.type === "Literal" && typeof n.property.value === "number") || - n.property.type === "NumericLiteral" + n.property.type === "NumericLiteral" ) { return concat(["[", property, "]"]); } return group( - concat([ - "[", - indent(concat([softline, property])), - softline, - "]" - ]) + concat(["[", indent(concat([softline, property])), softline, "]"]) ); } @@ -3243,10 +3195,11 @@ function printMemberChain(path, options, print) { node: node, printed: comments.printComments( path, - () => concat([ + () => + concat([ printFunctionTypeParameters(path, options, print), printArgumentsList(path, options, print) - ]), + ]), options ) }); @@ -3274,8 +3227,8 @@ function printMemberChain(path, options, print) { printedNodes.unshift({ node: path.getValue(), printed: concat([ - printFunctionTypeParameters(path, options, print), - printArgumentsList(path, options, print) + printFunctionTypeParameters(path, options, print), + printArgumentsList(path, options, print) ]) }); path.call(callee => rec(callee), "callee"); @@ -3332,7 +3285,8 @@ function printMemberChain(path, options, print) { let hasSeenCallExpression = false; for (; i < printedNodes.length; ++i) { if ( - hasSeenCallExpression && printedNodes[i].node.type === "MemberExpression" + hasSeenCallExpression && + printedNodes[i].node.type === "MemberExpression" ) { // [0] should be appended at the end of the group instead of the // beginning of the next one @@ -3494,7 +3448,6 @@ function printJSXChildren(path, options, print, jsxWhitespace) { const stripped = textLine.replace(/^\s+|\s+$/g, ""); if (stripped) { - // Split text into words separated by "line"s. stripped.split(/(\s+)/).forEach(word => { const space = /\s+/.test(word); @@ -3529,7 +3482,7 @@ function printJSXChildren(path, options, print, jsxWhitespace) { // we need to include an empty content part between each JSX // whitespace. if (i + 1 < value.length) { - children.push(''); + children.push(""); } } } @@ -3598,7 +3551,10 @@ function printJSXElement(path, options, print) { let forcedBreak = willBreak(openingLines); const rawJsxWhitespace = options.singleQuote ? "{' '}" : '{" "}'; - const jsxWhitespace = ifBreak(concat([softline, rawJsxWhitespace, softline]), " ") + const jsxWhitespace = ifBreak( + concat([softline, rawJsxWhitespace, softline]), + " " + ); const children = printJSXChildren(path, options, print, jsxWhitespace); @@ -3634,7 +3590,6 @@ function printJSXElement(path, options, print) { // Also detect whether we will force this element to output over multiple lines. let multilineChildren = []; children.forEach((child, i) => { - // Ensure that we display leading, trailing, and solitary whitespace as // `{" "}` when outputting this element over multiple lines. if (child === jsxWhitespace) { @@ -3714,11 +3669,17 @@ function shouldInlineLogicalExpression(node) { return false; } - if (node.right.type === "ObjectExpression" && node.right.properties.length !== 0) { + if ( + node.right.type === "ObjectExpression" && + node.right.properties.length !== 0 + ) { return true; } - if (node.right.type === "ArrayExpression" && node.right.elements.length !== 0) { + if ( + node.right.type === "ArrayExpression" && + node.right.elements.length !== 0 + ) { return true; } @@ -3733,7 +3694,13 @@ function shouldInlineLogicalExpression(node) { // precedence level and the AST is structured based on precedence // level, things are naturally broken up correctly, i.e. `&&` is // broken before `+`. -function printBinaryishExpressions(path, print, options, isNested, isInsideParenthesis) { +function printBinaryishExpressions( + path, + print, + options, + isNested, + isInsideParenthesis +) { let parts = []; let node = path.getValue(); @@ -3750,7 +3717,8 @@ function printBinaryishExpressions(path, print, options, isNested, isInsideParen // which is unique in that it is right-associative.) if ( util.getPrecedence(node.left.operator) === - util.getPrecedence(node.operator) && node.operator !== "**" + util.getPrecedence(node.operator) && + node.operator !== "**" ) { // Flatten them out by recursively calling this function. parts = parts.concat( @@ -3825,13 +3793,12 @@ function printAssignment( return printedLeft; } - const canBreak = ( + const canBreak = (isBinaryish(rightNode) && !shouldInlineLogicalExpression(rightNode)) || - (leftNode.type === "Identifier" || leftNode.type === "MemberExpression") && + ((leftNode.type === "Identifier" || leftNode.type === "MemberExpression") && (rightNode.type === "StringLiteral" || (rightNode.type === "Literal" && typeof rightNode.value === "string") || - isMemberExpressionChain(rightNode)) - ); + isMemberExpressionChain(rightNode))); const printed = printAssignmentRight( rightNode, @@ -3953,7 +3920,7 @@ function makeString(rawContent, enclosingQuote) { } function printRegex(node) { - const flags = node.flags.split('').sort().join(''); + const flags = node.flags.split("").sort().join(""); return `/${node.pattern}/${flags}`; } @@ -4009,7 +3976,14 @@ function getLeftSide(node) { if (node.expressions) { return node.expressions[0]; } - return node.left || node.test || node.callee || node.object || node.tag || node.argument; + return ( + node.left || + node.test || + node.callee || + node.object || + node.tag || + node.argument + ); } function exprNeedsASIProtection(node) { @@ -4095,7 +4069,10 @@ function classChildNeedsASIProtection(node) { const isAsync = node.value ? node.value.async : node.async; const isGenerator = node.value ? node.value.generator : node.generator; if ( - isAsync || node.static || node.kind === "get" || node.kind === "set" + isAsync || + node.static || + node.kind === "get" || + node.kind === "set" ) { return false; } @@ -4202,26 +4179,24 @@ function shouldHugArguments(fun) { (fun.params[0].type === "Identifier" && fun.params[0].typeAnnotation && fun.params[0].typeAnnotation.type === "TypeAnnotation" && - fun.params[0].typeAnnotation.typeAnnotation.type === "ObjectTypeAnnotation") || - fun.params[0].type === "FunctionTypeParam" && - fun.params[0].typeAnnotation.type === "ObjectTypeAnnotation") && + fun.params[0].typeAnnotation.typeAnnotation.type === + "ObjectTypeAnnotation") || + (fun.params[0].type === "FunctionTypeParam" && + fun.params[0].typeAnnotation.type === "ObjectTypeAnnotation")) && !fun.rest ); } function templateLiteralHasNewLines(template) { - return template.quasis.some(quasi => quasi.value.raw.includes('\n')); + return template.quasis.some(quasi => quasi.value.raw.includes("\n")); } function isTemplateOnItsOwnLine(n, text) { return ( - (n.type === "TemplateLiteral" && templateLiteralHasNewLines(n) || - n.type === "TaggedTemplateExpression" && templateLiteralHasNewLines(n.quasi)) && - !util.hasNewline( - text, - util.locStart(n), - {backwards: true} - ) + ((n.type === "TemplateLiteral" && templateLiteralHasNewLines(n)) || + (n.type === "TaggedTemplateExpression" && + templateLiteralHasNewLines(n.quasi))) && + !util.hasNewline(text, util.locStart(n), { backwards: true }) ); } @@ -4246,8 +4221,10 @@ function printArrayItems(path, options, printPath, print) { } function hasDanglingComments(node) { - return node.comments && - node.comments.some(comment => !comment.leading && !comment.trailing); + return ( + node.comments && + node.comments.some(comment => !comment.leading && !comment.trailing) + ); } function removeLines(doc) { diff --git a/src/typescript-ast-nodes.js b/src/typescript-ast-nodes.js index f1ecf2fb6..6567cc92d 100644 --- a/src/typescript-ast-nodes.js +++ b/src/typescript-ast-nodes.js @@ -119,7 +119,7 @@ module.exports = function(fork) { .build("modifiers", "name", "questionToken", "typeAnnotation") .field("name", def("Identifier")) .field("typeAnnotation", def("TypeAnnotation")) - .bases("TSSignature") + .bases("TSSignature"); def("TSAsExpression").bases("Expression"); @@ -158,7 +158,7 @@ module.exports = function(fork) { def("TSInterfaceBody") .build("body") - .field("body",[ def("TSPropertySignature")]) + .field("body", [def("TSPropertySignature")]) .bases("Node"); def("TSModuleDeclaration") diff --git a/src/util.js b/src/util.js index 63d804e56..21b91998a 100644 --- a/src/util.js +++ b/src/util.js @@ -257,7 +257,6 @@ function getPrecedence(op) { return PRECEDENCE[op]; } - // Tests if an expression starts with `{`, or (if forbidFunctionAndClass holds) `function` or `class`. // Will be overzealous if there's already necessary grouping parentheses. function startsWithNoLookaheadToken(node, forbidFunctionAndClass) { @@ -325,7 +324,7 @@ function getAlignmentSize(value, tabWidth, startIndex) { let size = 0; for (let i = startIndex; i < value.length; ++i) { - if (value[i] === '\t') { + if (value[i] === "\t") { // Tabs behave in a way that they are aligned to the nearest // multiple of tabWidth: // 0 -> 4, 1 -> 4, 2 -> 4, 3 -> 4 diff --git a/yarn.lock b/yarn.lock index b2cec4008..c8c83c8af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,11 +12,29 @@ acorn-globals@^3.1.0: dependencies: acorn "^4.0.4" +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + acorn@^4.0.1, acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" -ajv@^4.9.1: +acorn@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" + +ajv-keywords@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" + +ajv@^4.7.0, ajv@^4.9.1: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: @@ -35,7 +53,7 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.4.0: +ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -86,6 +104,16 @@ array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -140,7 +168,7 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-code-frame@6.22.0, babel-code-frame@^6.22.0: +babel-code-frame@6.22.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -390,6 +418,10 @@ buffer-es6@^4.9.1, buffer-es6@^4.9.2: version "4.9.3" resolved "https://registry.yarnpkg.com/buffer-es6/-/buffer-es6-4.9.3.tgz#f26347b82df76fd37e18bcb5288c4970cfd5c404" +buffer-shims@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + buffer-xor@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -398,6 +430,16 @@ builtin-modules@^1.0.0, builtin-modules@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -421,7 +463,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@1.1.3, chalk@^1.1.0, chalk@^1.1.3: +chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -441,6 +483,20 @@ cipher-base@^1.0.0, cipher-base@^1.0.1: dependencies: inherits "^2.0.1" +circular-json@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -485,6 +541,14 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" +concat-stream@^1.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + content-type-parser@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" @@ -497,6 +561,10 @@ core-js@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + create-ecdh@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" @@ -551,6 +619,12 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -577,6 +651,18 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -606,6 +692,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" @@ -636,7 +729,59 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -escape-string-regexp@^1.0.2: +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.20" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.20.tgz#72a9b4fd5832797ba1bb65dceb2e25c04241c492" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -651,6 +796,69 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-plugin-prettier@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.1.tgz#2fb7e2ab961f2b61d2c8cf91bc17716ca8c53868" + dependencies: + fast-diff "^1.1.1" + jest-docblock "^20.0.1" + +eslint@^3.19.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.5.2" + debug "^2.1.1" + doctrine "^2.0.0" + escope "^3.6.0" + espree "^3.4.0" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.14.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" + dependencies: + acorn "^5.0.1" + acorn-jsx "^3.0.0" + esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -659,10 +867,31 @@ esprima@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + dependencies: + estraverse "~4.1.0" + object-assign "^4.0.1" + estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +estraverse@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" + estree-walker@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" @@ -675,6 +904,13 @@ esutils@2.0.2, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + evp_bytestokey@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" @@ -687,6 +923,10 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -713,6 +953,10 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +fast-diff@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.1.tgz#0aea0e4e605b6a2189f0e936d4b7fbaf1b7cfd9b" + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -729,6 +973,20 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" @@ -763,6 +1021,15 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + flow-parser@0.45.0: version "0.45.0" resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.45.0.tgz#aa29d4ae27f06aa02817772bba0fcbefef7e62f0" @@ -793,6 +1060,16 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" @@ -820,7 +1097,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@7.1.1, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: +glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -831,10 +1108,21 @@ glob@7.1.1, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.0.0: +globals@^9.0.0, globals@^9.14.0: version "9.17.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -930,6 +1218,14 @@ iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" +ignore@^3.2.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -937,10 +1233,32 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +interpret@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" + invariant@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -1001,18 +1319,47 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" dependencies: is-extglob "^1.0.0" +is-my-json-valid@^2.10.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + is-number@^2.0.2, is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: kind-of "^3.0.2" +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -1021,6 +1368,16 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -1029,7 +1386,7 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1176,6 +1533,10 @@ jest-docblock@^20.0.0: version "20.0.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.0.tgz#5b647c4af36f52dae74df1949a8cb418d146ad3a" +jest-docblock@^20.0.1: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" + jest-environment-jsdom@^20.0.0: version "20.0.0" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.0.tgz#a688499d817e33cdea6400c502d8d5f4aa01c808" @@ -1216,6 +1577,13 @@ jest-jasmine2@^20.0.0: once "^1.4.0" p-map "^1.1.1" +jest-matcher-utils@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" + dependencies: + chalk "^1.1.3" + pretty-format "^19.0.0" + jest-matcher-utils@^20.0.0: version "20.0.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.0.tgz#2c5d9dd11670c5418ffc78baecf9094db9e91e09" @@ -1305,6 +1673,15 @@ jest-util@^20.0.0: leven "^2.1.0" mkdirp "^0.5.1" +jest-validate@19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" + dependencies: + chalk "^1.1.1" + jest-matcher-utils "^19.0.0" + leven "^2.0.0" + pretty-format "^19.0.0" + jest-validate@20.0.0, jest-validate@^20.0.0: version "20.0.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.0.tgz#c0832e8210190b6d5b39a46b8df536083131a7d7" @@ -1330,7 +1707,7 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.7.0: +js-yaml@^3.5.1, js-yaml@^3.7.0: version "3.8.3" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" dependencies: @@ -1373,7 +1750,7 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -1391,6 +1768,10 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + jsprim@^1.2.2: version "1.4.0" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" @@ -1416,11 +1797,11 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -leven@^2.1.0: +leven@^2.0.0, leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" -levn@~0.3.0: +levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" dependencies: @@ -1448,7 +1829,7 @@ lodash.unescape@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" -lodash@^4.14.0, lodash@^4.2.0: +lodash@^4.0.0, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -1541,7 +1922,7 @@ minimist@1.2.0, minimist@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -mkdirp@^0.5.1: +mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -1551,6 +1932,10 @@ ms@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" +mute-stream@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -1595,7 +1980,7 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -1612,6 +1997,10 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -1619,7 +2008,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -1701,6 +2090,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -1737,6 +2130,10 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -1745,6 +2142,27 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +prettier@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.3.1.tgz#fa0ea84b45ac0ba6de6a1e4cecdcff900d563151" + dependencies: + ast-types "0.9.8" + babel-code-frame "6.22.0" + babylon "7.0.0-beta.8" + chalk "1.1.3" + esutils "2.0.2" + flow-parser "0.45.0" + get-stdin "5.0.1" + glob "7.1.1" + jest-validate "19.0.0" + minimist "1.2.0" + +pretty-format@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" + dependencies: + ansi-styles "^3.0.0" + pretty-format@^20.0.0: version "20.0.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.0.tgz#bd100f330e707e4f49fef3f234d6e915242a6e7e" @@ -1759,6 +2177,14 @@ process-es6@^0.11.2, process-es6@^0.11.3: version "0.11.6" resolved "https://registry.yarnpkg.com/process-es6/-/process-es6-0.11.6.tgz#c6bb389f9a951f82bd4eb169600105bd2ff9c778" +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" @@ -1807,6 +2233,32 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +readable-stream@^2.2.2: + version "2.2.9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" + dependencies: + buffer-shims "~1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~1.0.0" + util-deprecate "~1.0.1" + +readline2@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + mute-stream "0.0.5" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + regenerator-runtime@^0.10.0: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" @@ -1871,6 +2323,17 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" @@ -1881,13 +2344,20 @@ resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2: dependencies: path-parse "^1.0.5" +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@^2.6.1: +rimraf@^2.2.8, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -1953,6 +2423,16 @@ rollup@0.41.1: dependencies: source-map-support "^0.4.0" +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +rx-lite@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" + safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" @@ -1987,6 +2467,14 @@ sha.js@^2.3.6: dependencies: inherits "^2.0.1" +shelljs@^0.7.5: + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + shellwords@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" @@ -1995,6 +2483,10 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" @@ -2070,6 +2562,19 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + +string_decoder@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" + dependencies: + safe-buffer "^5.0.1" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -2080,7 +2585,7 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@3.0.0: +strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -2090,6 +2595,10 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -2104,6 +2613,17 @@ symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + test-exclude@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" @@ -2114,10 +2634,18 @@ test-exclude@^4.1.0: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + throat@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -2140,6 +2668,10 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -2156,6 +2688,10 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + "typescript-eslint-parser@git://github.com/eslint/typescript-eslint-parser.git#3f9f41c7d8bcdaa3fbd68767e390f07f05555c3a": version "3.0.0" resolved "git://github.com/eslint/typescript-eslint-parser.git#3f9f41c7d8bcdaa3fbd68767e390f07f05555c3a" @@ -2180,6 +2716,16 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + dependencies: + os-homedir "^1.0.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -2276,11 +2822,17 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -"xtend@>=4.0.0 <4.1.0-0": +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"