From 90a908ef94f1335635aff5ef960ba13d0c685c06 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Fri, 10 Jun 2022 23:15:21 +0900 Subject: [PATCH 1/2] Update `flow-parser` --- package.json | 2 +- tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap | 7 ------- tests/format/js/regex/jsfmt.spec.js | 2 +- yarn.lock | 8 ++++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index ec3ff7f23a98..c35b94b51a4d 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "fast-glob": "3.2.11", "fast-json-stable-stringify": "2.1.0", "find-parent-dir": "0.3.1", - "flow-parser": "0.176.3", + "flow-parser": "0.180.0", "get-stdin": "8.0.0", "graphql": "15.6.1", "html-element-attributes": "3.1.0", diff --git a/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap index aa295e37c9e7..18d9ecdde540 100644 --- a/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`d-flag.js [flow] format 1`] = ` -"Invalid flags supplied to RegExp constructor 'd' (1:5) -> 1 | /./d; - | ^ - 2 |" -`; - exports[`d-flag.js [meriyah] format 1`] = ` "Unexpected regular expression flag (1:3) > 1 | /./d; diff --git a/tests/format/js/regex/jsfmt.spec.js b/tests/format/js/regex/jsfmt.spec.js index 1f132f341df6..857c89598f23 100644 --- a/tests/format/js/regex/jsfmt.spec.js +++ b/tests/format/js/regex/jsfmt.spec.js @@ -1,6 +1,6 @@ run_spec(__dirname, ["babel", "flow", "typescript"], { errors: { - flow: ["d-flag.js", "v-flag.js"], + flow: ["v-flag.js"], acorn: ["v-flag.js"], espree: ["v-flag.js"], meriyah: ["d-flag.js", "v-flag.js"], diff --git a/yarn.lock b/yarn.lock index 1612dfd19636..5c71102e3a3d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3427,10 +3427,10 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== -flow-parser@0.176.3: - version "0.176.3" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.176.3.tgz#a12d9c79ff1e857b70c9574c3e88be06d2f96181" - integrity sha512-KDzHEoEtc/kbW7NzujhfFkcTCdNi6VK91UpcdT3tc3yEAQdh4JXAEY/0TVJKipjRuVm8E2FxX/3B5Xpm3EFWXA== +flow-parser@0.180.0: + version "0.180.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.180.0.tgz#05d49a88715ceca0457607499a018e2bf5908d72" + integrity sha512-kkzsuGAhckWgn/G+JfCyEa6BYslGrjlH4CJL0LZhdn9of9ukvi7SzVQSFsrEhuhh/zQUghfUEoaeZy1wjQXpUg== form-data@^3.0.0: version "3.0.1" From 58e1b67dcbd05d4b8c9e4b355c2ba5626b50cbfc Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Fri, 10 Jun 2022 23:25:13 +0900 Subject: [PATCH 2/2] Update snapshots --- tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap | 2 +- .../format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap | 2 +- .../typeparams/consistent/__snapshots__/jsfmt.spec.js.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap index 7630083910b9..d968f3b335e2 100644 --- a/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap @@ -9,7 +9,7 @@ exports[`async-arrow-invalid.js [flow] format 1`] = ` `; exports[`default-escaped.js [flow] format 1`] = ` -"Unexpected identifier, expected the token \`{\` (1:8) +"Unexpected token \`async\`, expected a declaration, statement or export specifiers (1:8) > 1 | export asyn\\u{63} from "async"; | ^^^^^^^^^^ 2 |" diff --git a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap index 62bb784b9f3a..b2c981a4b24c 100644 --- a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap @@ -127,7 +127,7 @@ exports[`snippet: #1 [espree] format 1`] = ` `; exports[`snippet: #1 [flow] format 1`] = ` -"Unexpected token \`switch\` (1:7) +"Unexpected token \`switch\`, expected an identifier (1:7) > 1 | class switch() {} | ^^^^^^" `; diff --git a/tests/format/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap index f3ebb5358fc8..d8a5c91d4ae9 100644 --- a/tests/format/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap @@ -92,7 +92,7 @@ exports[`template-literal-types.ts [babel-flow] format 1`] = ` `; exports[`template-literal-types.ts [flow] format 1`] = ` -"Unexpected token \`\`\` (1:84) +"Unexpected token \`\`\`, expected a type (1:84) > 1 | const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<\`Hello, \${keyof World}\`> = a; | ^ 2 |"