From 5895277b3278b7ae9a84424159ed065bdc7b8ead Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 29 May 2018 10:00:45 -0500 Subject: [PATCH] Bump prettier to v1.13.2 --- package.json | 4 ++-- .../babel-core/src/config/config-chain.js | 24 +++++++++++-------- .../src/index.js | 10 ++++---- packages/babel-parser/src/parser/statement.js | 4 +++- .../babel-parser/src/plugins/typescript.js | 4 +++- .../src/index.js | 7 +++++- .../src/index.js | 10 +++++++- .../babel-traverse/src/path/evaluation.js | 4 +++- .../tests/test262/run_babel_parser_test262.js | 2 +- yarn.lock | 8 +++---- 10 files changed, 49 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 6285b641d9..9c38ad2bd2 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "eslint": "^4.18.2", "eslint-config-babel": "^7.0.2", "eslint-plugin-flowtype": "^2.20.0", - "eslint-plugin-prettier": "^2.5.0", + "eslint-plugin-prettier": "^2.6.0", "flow-bin": "^0.73.0", "graceful-fs": "^4.1.11", "gulp": "^4.0.0", @@ -51,7 +51,7 @@ "lodash": "^4.17.5", "merge-stream": "^1.0.1", "output-file-sync": "^2.0.0", - "prettier": "1.11.1", + "prettier": "1.13.2", "pump": "^1.0.2", "rimraf": "^2.4.3", "rollup-plugin-babel": "^4.0.0-beta.0", diff --git a/packages/babel-core/src/config/config-chain.js b/packages/babel-core/src/config/config-chain.js index 73345d0cfb..d117e7c538 100644 --- a/packages/babel-core/src/config/config-chain.js +++ b/packages/babel-core/src/config/config-chain.js @@ -236,11 +236,13 @@ function babelrcLoadEnabled( return micromatch(pkgData.directories, babelrcPatterns).length > 0; } -const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({ - filepath: file.filepath, - dirname: file.dirname, - options: validate("configfile", file.options), -})); +const validateConfigFile = makeWeakCache( + (file: ConfigFile): ValidatedFile => ({ + filepath: file.filepath, + dirname: file.dirname, + options: validate("configfile", file.options), + }), +); const validateBabelrcFile = makeWeakCache( (file: ConfigFile): ValidatedFile => ({ @@ -250,11 +252,13 @@ const validateBabelrcFile = makeWeakCache( }), ); -const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({ - filepath: file.filepath, - dirname: file.dirname, - options: validate("extendsfile", file.options), -})); +const validateExtendFile = makeWeakCache( + (file: ConfigFile): ValidatedFile => ({ + filepath: file.filepath, + dirname: file.dirname, + options: validate("extendsfile", file.options), + }), +); /** * Build a config chain for just the programmatic options passed into Babel. diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index 5e8138631b..209720f5fd 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -62,12 +62,10 @@ function runModuleInTestContext(id: string, relativeFilename: string) { const src = fs.readFileSync(filename, "utf8"); const code = `(function (exports, require, module, __filename, __dirname) {${src}\n});`; - vm - .runInContext(code, testContext, { - filename, - displayErrors: true, - }) - .call(module.exports, module.exports, req, module, filename, dirname); + vm.runInContext(code, testContext, { + filename, + displayErrors: true, + }).call(module.exports, module.exports, req, module, filename, dirname); return module.exports; } diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 0f22ec3d7f..0fe94de1be 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -616,7 +616,9 @@ export default class StatementParser extends ExpressionParser { const kind = this.state.type.isLoop ? "loop" - : this.match(tt._switch) ? "switch" : null; + : this.match(tt._switch) + ? "switch" + : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { diff --git a/packages/babel-parser/src/plugins/typescript.js b/packages/babel-parser/src/plugins/typescript.js index dbb5be43b5..b5d26fc300 100644 --- a/packages/babel-parser/src/plugins/typescript.js +++ b/packages/babel-parser/src/plugins/typescript.js @@ -1327,7 +1327,9 @@ export default (superClass: Class): Class => const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" - : type === "ClassMethod" ? "TSDeclareMethod" : undefined; + : type === "ClassMethod" + ? "TSDeclareMethod" + : undefined; if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { this.finishNode(node, bodilessType); return; diff --git a/packages/babel-plugin-proposal-class-properties/src/index.js b/packages/babel-plugin-proposal-class-properties/src/index.js index 7ae92b0514..24e34b6b75 100644 --- a/packages/babel-plugin-proposal-class-properties/src/index.js +++ b/packages/babel-plugin-proposal-class-properties/src/index.js @@ -277,7 +277,12 @@ export default declare((api, options) => { } if (path.isClassPrivateProperty()) { - const { static: isStatic, key: { id: { name } } } = path.node; + const { + static: isStatic, + key: { + id: { name }, + }, + } = path.node; if (isStatic) { throw path.buildCodeFrameError( diff --git a/packages/babel-plugin-transform-flow-strip-types/src/index.js b/packages/babel-plugin-transform-flow-strip-types/src/index.js index 9e2ec6aac1..063319cf9d 100644 --- a/packages/babel-plugin-transform-flow-strip-types/src/index.js +++ b/packages/babel-plugin-transform-flow-strip-types/src/index.js @@ -13,7 +13,15 @@ export default declare(api => { inherits: syntaxFlow, visitor: { - Program(path, { file: { ast: { comments } }, opts }) { + Program( + path, + { + file: { + ast: { comments }, + }, + opts, + }, + ) { skipStrip = false; let directiveFound = false; diff --git a/packages/babel-traverse/src/path/evaluation.js b/packages/babel-traverse/src/path/evaluation.js index 0d1175172b..90029cbe1e 100644 --- a/packages/babel-traverse/src/path/evaluation.js +++ b/packages/babel-traverse/src/path/evaluation.js @@ -101,7 +101,9 @@ function _evaluate(path, state) { path.get("tag").isMemberExpression() ) { const object = path.get("tag.object"); - const { node: { name } } = object; + const { + node: { name }, + } = object; const property = path.get("tag.property"); if ( diff --git a/scripts/tests/test262/run_babel_parser_test262.js b/scripts/tests/test262/run_babel_parser_test262.js index 622ed0c718..1589901d6e 100644 --- a/scripts/tests/test262/run_babel_parser_test262.js +++ b/scripts/tests/test262/run_babel_parser_test262.js @@ -17,7 +17,7 @@ Promise.all([utils.getTests(testDir), utils.getWhitelist(whitelistFile)]) const results = tests.map(function(test, idx) { if (idx % reportInc === 0) { - console.log(`> ${Math.round(100 * idx / total)}% complete`); + console.log(`> ${Math.round((100 * idx) / total)}% complete`); } return utils.runTest(test); diff --git a/yarn.lock b/yarn.lock index f4cdd16e55..e1b7bca962 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3070,7 +3070,7 @@ eslint-plugin-flowtype@^2.20.0: dependencies: lodash "^4.15.0" -eslint-plugin-prettier@^2.5.0: +eslint-plugin-prettier@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" dependencies: @@ -6497,9 +6497,9 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" +prettier@1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.2.tgz#412b87bc561cb11074d2877a33a38f78c2303cda" pretty-format@^21.2.1: version "21.2.1"