diff --git a/src/language-js/parse/meriyah.js b/src/language-js/parse/meriyah.js index c790b6bb5..13776f897 100644 --- a/src/language-js/parse/meriyah.js +++ b/src/language-js/parse/meriyah.js @@ -60,8 +60,21 @@ function parseWithOptions(text, module) { } function createParseError(error) { - // throw the error for `module` parsing - const { message, line, column } = error; + let { message, line, column } = error; + + const matches = ( + message.match(/^\[(?\d+):(?\d+)]: (?.*)$/) || {} + ).groups; + + if (matches) { + message = matches.message; + + /* istanbul ignore next */ + if (typeof line !== "number") { + line = Number(matches.line); + column = Number(matches.column); + } + } /* istanbul ignore next */ if (typeof line !== "number") { diff --git a/tests/format/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap index b025b057a..84be5b56f 100644 --- a/tests/format/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`arrows-bind.js [espree] format 1`] = ` `; exports[`arrows-bind.js [meriyah] format 1`] = ` -"[1:9]: Expected ')' (1:9) +"Expected ')' (1:9) > 1 | a => ({}::b()\`\`[''].c++ && 0 ? 0 : 0); | ^ 2 | (a => b)::c; diff --git a/tests/format/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap index 336e5ebb9..8a8713a20 100644 --- a/tests/format/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap @@ -17,7 +17,7 @@ exports[`newline-before-arrow.js [espree] format 1`] = ` `; exports[`newline-before-arrow.js [meriyah] format 1`] = ` -"[2:2]: No line break is allowed after '=>' (2:2) +"No line break is allowed after '=>' (2:2) 1 | async x > 2 | => x | ^ diff --git a/tests/format/js/async-do-expressions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/async-do-expressions/__snapshots__/jsfmt.spec.js.snap index 020cd53d1..9930e719b 100644 --- a/tests/format/js/async-do-expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/async-do-expressions/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`async-do-expressions.js [espree] format 1`] = ` `; exports[`async-do-expressions.js [meriyah] format 1`] = ` -"[1:8]: Unexpected token: 'do' (1:8) +"Unexpected token: 'do' (1:8) > 1 | async do { | ^ 2 | 1; diff --git a/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap index c3a644550..b0732a255 100644 --- a/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap @@ -15,7 +15,7 @@ exports[`async-do-expressions.js [espree] format 1`] = ` `; exports[`async-do-expressions.js [meriyah] format 1`] = ` -"[1:8]: Unexpected token: 'do' (1:8) +"Unexpected token: 'do' (1:8) > 1 | async do { await requestAPI().json() }; | ^ 2 |" @@ -394,7 +394,7 @@ console.log(Bork.staticFunction()); // > "babelIsCool" `; exports[`class-static-block.js [meriyah] format 1`] = ` -"[4:10]: Unexpected token: '{' (4:10) +"Unexpected token: '{' (4:10) 2 | static #x = 42; 3 | static y; > 4 | static { @@ -461,7 +461,7 @@ exports[`decimal.js [espree] format 1`] = ` `; exports[`decimal.js [meriyah] format 1`] = ` -"[3:3]: No identifiers allowed directly after numeric literal (3:3) +"No identifiers allowed directly after numeric literal (3:3) 1 | // https://github.com/babel/babel/pull/11640 2 | > 3 | 100m; @@ -649,7 +649,7 @@ exports[`destructuring-private.js [espree] format 1`] = ` `; exports[`destructuring-private.js [meriyah] format 1`] = ` -"[5:13]: Unexpected token: 'PrivateField' (5:13) +"Unexpected token: 'PrivateField' (5:13) 3 | constructor() { 4 | console.log(this.#x); // => 1 > 5 | const { #x: x } = this; @@ -718,7 +718,7 @@ exports[`do-expressions.js [espree] format 1`] = ` `; exports[`do-expressions.js [meriyah] format 1`] = ` -"[3:10]: Unexpected token: 'do' (3:10) +"Unexpected token: 'do' (3:10) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions 2 | > 3 | let a = do { @@ -809,7 +809,7 @@ exports[`export-default-from.js [espree] format 1`] = ` `; exports[`export-default-from.js [meriyah] format 1`] = ` -"[4:8]: Unexpected token: 'identifier' (4:8) +"Unexpected token: 'identifier' (4:8) 2 | 3 | > 4 | export v from 'mod'; @@ -873,7 +873,7 @@ exports[`flow.js [espree] format 1`] = ` `; exports[`flow.js [meriyah] format 1`] = ` -"[3:17]: Expected ')' (3:17) +"Expected ')' (3:17) 1 | // https://babeljs.io/docs/en/babel-preset-flow 2 | > 3 | function foo(one: any, two: number, three?): string {} @@ -922,7 +922,7 @@ exports[`function-bind.js [espree] format 1`] = ` `; exports[`function-bind.js [meriyah] format 1`] = ` -"[3:5]: Unexpected token: ':' (3:5) +"Unexpected token: ':' (3:5) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind 2 | > 3 | obj::func @@ -1000,7 +1000,7 @@ exports[`function-sent.js [espree] format 1`] = ` `; exports[`function-sent.js [meriyah] format 1`] = ` -"[4:33]: Expected '(' (4:33) +"Expected '(' (4:33) 2 | 3 | function* generator() { > 4 | console.log(\\"Sent\\", function.sent); @@ -1057,7 +1057,7 @@ exports[`import-assertions-dynamic.js [espree] format 1`] = ` `; exports[`import-assertions-dynamic.js [meriyah] format 1`] = ` -"[1:20]: Expected ')' (1:20) +"Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ 2 |" @@ -1092,7 +1092,7 @@ exports[`import-assertions-static.js [espree] format 1`] = ` `; exports[`import-assertions-static.js [meriyah] format 1`] = ` -"[1:36]: Unexpected token: 'identifier' (1:36) +"Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ 2 |" @@ -1231,7 +1231,7 @@ exports[`module-blocks.js [espree] format 1`] = ` `; exports[`module-blocks.js [meriyah] format 1`] = ` -"[1:16]: Unexpected token: '{' (1:16) +"Unexpected token: '{' (1:16) > 1 | let m = module { | ^ 2 | export let m = 2; @@ -1260,7 +1260,7 @@ let m = module { `; exports[`module-string-names.js [meriyah] format 1`] = ` -"[1:13]: Expected '}' (1:13) +"Expected '}' (1:13) > 1 | import { \\"😄\\" as smile } from \\"./emojis.js\\"; | ^ 2 | export { smile as \\"😄\\" } from \\"./emojis.js\\"; @@ -1615,7 +1615,7 @@ exports[`partial-application.js [espree] format 1`] = ` `; exports[`partial-application.js [meriyah] format 1`] = ` -"[5:23]: Unexpected token: '?' (5:23) +"Unexpected token: '?' (5:23) 3 | function add(x, y) { return x + y; } 4 | > 5 | const addOne = add(1, ?); // apply from the left @@ -1702,7 +1702,7 @@ exports[`pipeline-operator-fsharp.js [espree] format 1`] = ` `; exports[`pipeline-operator-fsharp.js [meriyah] format 1`] = ` -"[5:4]: Unexpected token: '>' (5:4) +"Unexpected token: '>' (5:4) 3 | 4 | promise > 5 | |> await @@ -1810,7 +1810,7 @@ exports[`pipeline-operator-hack.js [espree] format 1`] = ` `; exports[`pipeline-operator-hack.js [meriyah] format 1`] = ` -"[5:3]: Unexpected token: '>' (5:3) +"Unexpected token: '>' (5:3) 3 | 4 | return list > 5 | |> take(prefix.length, %) @@ -1869,7 +1869,7 @@ exports[`pipeline-operator-minimal.js [espree] format 1`] = ` `; exports[`pipeline-operator-minimal.js [meriyah] format 1`] = ` -"[8:4]: Unexpected token: '>' (8:4) +"Unexpected token: '>' (8:4) 6 | 7 | let result = \\"hello\\" > 8 | |> doubleSay @@ -2104,7 +2104,7 @@ exports[`record-tuple-record.js [espree] format 1`] = ` `; exports[`record-tuple-record.js [meriyah] format 1`] = ` -"[1:17]: '#' not followed by identifier (1:17) +"'#' not followed by identifier (1:17) > 1 | const record1 = #{ | ^ 2 | a: 1, @@ -2153,7 +2153,7 @@ exports[`record-tuple-tuple.js [espree] format 1`] = ` `; exports[`record-tuple-tuple.js [meriyah] format 1`] = ` -"[1:16]: '#' not followed by identifier (1:16) +"'#' not followed by identifier (1:16) > 1 | const tuple1 = #[1, 2, 3]; | ^ 2 |" @@ -2188,7 +2188,7 @@ exports[`regex-v-flag.js [espree] format 1`] = ` `; exports[`regex-v-flag.js [meriyah] format 1`] = ` -"[1:3]: Unexpected regular expression flag (1:3) +"Unexpected regular expression flag (1:3) > 1 | /a/v; | ^ 2 |" @@ -2231,7 +2231,7 @@ exports[`throw-expressions.js [espree] format 1`] = ` `; exports[`throw-expressions.js [meriyah] format 1`] = ` -"[3:27]: Unexpected token: 'throw' (3:27) +"Unexpected token: 'throw' (3:27) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions 2 | > 3 | function test(param = throw new Error('required!')) { @@ -2282,7 +2282,7 @@ exports[`typescript.js [espree] format 1`] = ` `; exports[`typescript.js [meriyah] format 1`] = ` -"[3:8]: Missing initializer in const declaration (3:8) +"Missing initializer in const declaration (3:8) 1 | // https://babeljs.io/docs/en/babel-preset-typescript 2 | > 3 | const x: number = 0; @@ -2331,7 +2331,7 @@ exports[`v8intrinsic.js [espree] format 1`] = ` `; exports[`v8intrinsic.js [meriyah] format 1`] = ` -"[3:1]: Unexpected token: '%' (3:1) +"Unexpected token: '%' (3:1) 1 | // https://github.com/babel/babel/pull/10148 2 | > 3 | %DebugPrint(foo); diff --git a/tests/format/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap index d05d09d70..35e2c9e8d 100644 --- a/tests/format/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`await.js [espree] format 1`] = ` `; exports[`await.js [meriyah] format 1`] = ` -"[3:27]: Unexpected token: ':' (3:27) +"Unexpected token: ':' (3:27) 1 | const doBothThings = async () => { 2 | const request = doAsyncThing(); > 3 | return (await request)::doSyncThing(); @@ -51,7 +51,7 @@ exports[`await.js - {"semi":false} [espree] format 1`] = ` `; exports[`await.js - {"semi":false} [meriyah] format 1`] = ` -"[3:27]: Unexpected token: ':' (3:27) +"Unexpected token: ':' (3:27) 1 | const doBothThings = async () => { 2 | const request = doAsyncThing(); > 3 | return (await request)::doSyncThing(); @@ -120,7 +120,7 @@ exports[`bind_parens.js [espree] format 1`] = ` `; exports[`bind_parens.js [meriyah] format 1`] = ` -"[1:9]: Unexpected token: ':' (1:9) +"Unexpected token: ':' (1:9) > 1 | (a || b)::c; | ^ 2 | a || (b::c); @@ -147,7 +147,7 @@ exports[`bind_parens.js - {"semi":false} [espree] format 1`] = ` `; exports[`bind_parens.js - {"semi":false} [meriyah] format 1`] = ` -"[1:9]: Unexpected token: ':' (1:9) +"Unexpected token: ':' (1:9) > 1 | (a || b)::c; | ^ 2 | a || (b::c); @@ -339,7 +339,7 @@ exports[`long_name_method.js [espree] format 1`] = ` `; exports[`long_name_method.js [meriyah] format 1`] = ` -"[3:54]: Unexpected token: ':' (3:54) +"Unexpected token: ':' (3:54) 1 | class X { 2 | constructor() { > 3 | this.testLongNameMethodAndSomethingElseLallala = ::this.testLongNameMethodAndSomethingElseLallala; @@ -372,7 +372,7 @@ exports[`long_name_method.js - {"semi":false} [espree] format 1`] = ` `; exports[`long_name_method.js - {"semi":false} [meriyah] format 1`] = ` -"[3:54]: Unexpected token: ':' (3:54) +"Unexpected token: ':' (3:54) 1 | class X { 2 | constructor() { > 3 | this.testLongNameMethodAndSomethingElseLallala = ::this.testLongNameMethodAndSomethingElseLallala; @@ -466,7 +466,7 @@ exports[`method_chain.js [espree] format 1`] = ` `; exports[`method_chain.js [meriyah] format 1`] = ` -"[10:9]: Unexpected token: ':' (10:9) +"Unexpected token: ':' (10:9) 8 | function test(observable) { 9 | return observable > 10 | ::filter(data => data.someTest) @@ -499,7 +499,7 @@ exports[`method_chain.js - {"semi":false} [espree] format 1`] = ` `; exports[`method_chain.js - {"semi":false} [meriyah] format 1`] = ` -"[10:9]: Unexpected token: ':' (10:9) +"Unexpected token: ':' (10:9) 8 | function test(observable) { 9 | return observable > 10 | ::filter(data => data.someTest) @@ -625,7 +625,7 @@ exports[`short_name_method.js [espree] format 1`] = ` `; exports[`short_name_method.js [meriyah] format 1`] = ` -"[3:24]: Unexpected token: ':' (3:24) +"Unexpected token: ':' (3:24) 1 | class X { 2 | constructor() { > 3 | this.shortMethod = ::this.shortMethod; @@ -658,7 +658,7 @@ exports[`short_name_method.js - {"semi":false} [espree] format 1`] = ` `; exports[`short_name_method.js - {"semi":false} [meriyah] format 1`] = ` -"[3:24]: Unexpected token: ':' (3:24) +"Unexpected token: ':' (3:24) 1 | class X { 2 | constructor() { > 3 | this.shortMethod = ::this.shortMethod; @@ -746,7 +746,7 @@ exports[`unary.js [espree] format 1`] = ` `; exports[`unary.js [meriyah] format 1`] = ` -"[1:3]: Unexpected token: ':' (1:3) +"Unexpected token: ':' (1:3) > 1 | !x::y; | ^ 2 | !(x::y /* foo */); @@ -773,7 +773,7 @@ exports[`unary.js - {"semi":false} [espree] format 1`] = ` `; exports[`unary.js - {"semi":false} [meriyah] format 1`] = ` -"[1:3]: Unexpected token: ':' (1:3) +"Unexpected token: ':' (1:3) > 1 | !x::y; | ^ 2 | !(x::y /* foo */); diff --git a/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap index 01db1d544..2c2ef6537 100644 --- a/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap @@ -37,7 +37,7 @@ exports[`null-arguments-item.js [espree] format 1`] = ` `; exports[`null-arguments-item.js [meriyah] format 1`] = ` -"[1:11]: Unexpected token: ',' (1:11) +"Unexpected token: ',' (1:11) > 1 | foor('a', , 'b'); | ^ 2 | foo('looooooooooooooooooooooooooooooooooooooooooooooong', , 'looooooooooooooooooooooooooooooooooooooooooooooong'); diff --git a/tests/format/js/class-static-block/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/class-static-block/__snapshots__/jsfmt.spec.js.snap index 8a1cf7d94..dd0cc3f43 100644 --- a/tests/format/js/class-static-block/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/class-static-block/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`class-static-block.js [meriyah] format 1`] = ` -"[4:10]: Unexpected token: '{' (4:10) +"Unexpected token: '{' (4:10) 2 | static #x = 42; 3 | static y; > 4 | static { @@ -80,7 +80,7 @@ class A2 { `; exports[`with-line-breaks.js [meriyah] format 1`] = ` -"[3:3]: Unexpected token: '{' (3:3) +"Unexpected token: '{' (3:3) 1 | class Foo { 2 | static > 3 | { diff --git a/tests/format/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap index 327a88c6b..f6184ecb6 100644 --- a/tests/format/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`optional-chaining.js [espree] format 1`] = ` `; exports[`optional-chaining.js [meriyah] format 1`] = ` -"[3:13]: Dot property must be an identifier (3:13) +"Dot property must be an identifier (3:13) 1 | // https://github.com/babel/babel/pull/11669 2 | > 3 | delete obj?.#x.a @@ -46,7 +46,7 @@ exports[`optional-chaining.js - {"semi":false} [espree] format 1`] = ` `; exports[`optional-chaining.js - {"semi":false} [meriyah] format 1`] = ` -"[3:13]: Dot property must be an identifier (3:13) +"Dot property must be an identifier (3:13) 1 | // https://github.com/babel/babel/pull/11669 2 | > 3 | delete obj?.#x.a diff --git a/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap index e3060ae46..2900df233 100644 --- a/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap @@ -15,7 +15,7 @@ exports[`example.js [espree] format 1`] = ` `; exports[`example.js [meriyah] format 1`] = ` -"[1:6]: Calls to super must be in the \\"constructor\\" method of a class expression or class declaration that has a superclass (1:6) +"Calls to super must be in the \\"constructor\\" method of a class expression or class declaration that has a superclass (1:6) > 1 | super(); | ^ 2 |" diff --git a/tests/format/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap index 773828743..67630267b 100644 --- a/tests/format/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap @@ -23,7 +23,7 @@ exports[`pipeline_own_line.js [espree] format 1`] = ` `; exports[`pipeline_own_line.js [meriyah] format 1`] = ` -"[4:3]: Unexpected token: '>' (4:3) +"Unexpected token: '>' (4:3) 2 | 0 3 | // Comment > 4 | |> x diff --git a/tests/format/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap index ce6d7d0cd..74842af57 100644 --- a/tests/format/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`comments.js [espree] format 1`] = ` `; exports[`comments.js [meriyah] format 1`] = ` -"[4:20]: Unexpected token: ':' (4:20) +"Unexpected token: ':' (4:20) 2 | @Annotateme() 3 | // comment > 4 | static property: Array; diff --git a/tests/format/js/decorators-export/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorators-export/__snapshots__/jsfmt.spec.js.snap index 81881da32..36873709b 100644 --- a/tests/format/js/decorators-export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/decorators-export/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`after_export.js [espree] format 1`] = ` `; exports[`after_export.js [meriyah] format 1`] = ` -"[1:8]: Unexpected token: '@' (1:8) +"Unexpected token: '@' (1:8) > 1 | export @decorator class Foo {} | ^ 2 | diff --git a/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap index 091a9620b..62aab4d14 100644 --- a/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap @@ -287,7 +287,7 @@ exports[`mobx.js [espree] format 1`] = ` `; exports[`mobx.js [meriyah] format 1`] = ` -"[4:20]: Unexpected token: ':' (4:20) +"Unexpected token: ':' (4:20) 2 | 3 | @observer class OrderLine { > 4 | @observable price:number = 0; @@ -471,7 +471,7 @@ exports[`multiple.js [espree] format 1`] = ` `; exports[`multiple.js [meriyah] format 1`] = ` -"[2:3]: Unexpected token: '@' (2:3) +"Unexpected token: '@' (2:3) 1 | const dog = { > 2 | @readonly | ^ diff --git a/tests/format/js/destructuring-private-fields/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/destructuring-private-fields/__snapshots__/jsfmt.spec.js.snap index be675be4d..43e7fa3a4 100644 --- a/tests/format/js/destructuring-private-fields/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/destructuring-private-fields/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`arrow-params.js [espree] format 1`] = ` `; exports[`arrow-params.js [meriyah] format 1`] = ` -"[3:11]: Unexpected token: 'PrivateField' (3:11) +"Unexpected token: 'PrivateField' (3:11) 1 | class C { 2 | #x = 1; > 3 | #p = ({ #x: x }) => {} @@ -73,7 +73,7 @@ exports[`assignment.js [espree] format 1`] = ` `; exports[`assignment.js [meriyah] format 1`] = ` -"[5:8]: Unexpected token: 'PrivateField' (5:8) +"Unexpected token: 'PrivateField' (5:8) 3 | m() { 4 | let x; > 5 | ({ #x: x } = this); @@ -130,7 +130,7 @@ exports[`async-arrow-params.js [espree] format 1`] = ` `; exports[`async-arrow-params.js [meriyah] format 1`] = ` -"[3:17]: Unexpected token: 'PrivateField' (3:17) +"Unexpected token: 'PrivateField' (3:17) 1 | class C { 2 | #x = 1; > 3 | #p = async ({ #x: x }) => {} @@ -182,7 +182,7 @@ exports[`bindings.js [espree] format 1`] = ` `; exports[`bindings.js [meriyah] format 1`] = ` -"[4:12]: Unexpected token: 'PrivateField' (4:12) +"Unexpected token: 'PrivateField' (4:12) 2 | #x = 1; 3 | m() { > 4 | const {#x: x} = this; @@ -239,7 +239,7 @@ exports[`for-lhs.js [espree] format 1`] = ` `; exports[`for-lhs.js [meriyah] format 1`] = ` -"[5:11]: Unexpected token: 'PrivateField' (5:11) +"Unexpected token: 'PrivateField' (5:11) 3 | m() { 4 | let x; > 5 | for ({#x: x} of [this]); @@ -298,7 +298,7 @@ exports[`nested-bindings.js [espree] format 1`] = ` `; exports[`nested-bindings.js [meriyah] format 1`] = ` -"[4:17]: Unexpected token: 'PrivateField' (4:17) +"Unexpected token: 'PrivateField' (4:17) 2 | #x = 1; 3 | m() { > 4 | const {x: { #x: [x] }, y: [...{ #x: y }]} = this; @@ -360,7 +360,7 @@ exports[`valid-multiple-bindings.js [espree] format 1`] = ` `; exports[`valid-multiple-bindings.js [meriyah] format 1`] = ` -"[4:12]: Unexpected token: 'PrivateField' (4:12) +"Unexpected token: 'PrivateField' (4:12) 2 | #x = 1; 3 | m() { > 4 | const {#x: x1, #x: x2 = x1 } = this; diff --git a/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap index 27c4eb490..b73a8ff8c 100644 --- a/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap @@ -23,7 +23,7 @@ exports[`call-arguments.js [espree] format 1`] = ` `; exports[`call-arguments.js [meriyah] format 1`] = ` -"[3:4]: Unexpected token: 'do' (3:4) +"Unexpected token: 'do' (3:4) 1 | // from https://github.com/babel/babel/pull/13122/ 2 | expect( > 3 | do { @@ -142,7 +142,7 @@ exports[`do.js [espree] format 1`] = ` `; exports[`do.js [meriyah] format 1`] = ` -"[3:6]: Unexpected token: 'do' (3:6) +"Unexpected token: 'do' (3:6) 1 | const envSpecific = { 2 | domain: > 3 | do { diff --git a/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap index 162cb7350..f4d7d3870 100644 --- a/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap @@ -22,7 +22,7 @@ exports[`assertions.js [flow] format 1`] = ` `; exports[`assertions.js [meriyah] format 1`] = ` -"[1:20]: Expected ')' (1:20) +"Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ 2 |" diff --git a/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap index 33fd57a7d..1763a573f 100644 --- a/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap @@ -15,7 +15,7 @@ exports[`default-escaped.js [espree] format 1`] = ` `; exports[`default-escaped.js [meriyah] format 1`] = ` -"[2:12]: Unexpected token: 'identifier' (2:12) +"Unexpected token: 'identifier' (2:12) 1 | // export asyn\\\\u{63} from \\"async\\"; > 2 | export n\\\\u{63} from \\"async\\"; | ^" diff --git a/tests/format/js/export-extension/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/export-extension/__snapshots__/jsfmt.spec.js.snap index 07d57957e..5de3516e7 100644 --- a/tests/format/js/export-extension/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/export-extension/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`export.js [espree] format 1`] = ` `; exports[`export.js [meriyah] format 1`] = ` -"[2:8]: Unexpected token: 'identifier' (2:8) +"Unexpected token: 'identifier' (2:8) 1 | export * as ns from 'mod'; > 2 | export v from 'mod'; | ^ diff --git a/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap index 6956f8507..eeab830d1 100644 --- a/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap @@ -23,7 +23,7 @@ exports[`test.js [espree] format 1`] = ` `; exports[`test.js [meriyah] format 1`] = ` -"[3:8]: Unexpected token: 'identifier' (3:8) +"Unexpected token: 'identifier' (3:8) 1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\"; 2 | > 3 | export a,{b} from \\"./baz\\"; diff --git a/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap index 62c0be91c..b92499e61 100644 --- a/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap @@ -15,7 +15,7 @@ exports[`dynamic-import.js [espree] format 1`] = ` `; exports[`dynamic-import.js [meriyah] format 1`] = ` -"[1:20]: Expected ')' (1:20) +"Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ 2 |" @@ -56,7 +56,7 @@ exports[`empty.js [espree] format 1`] = ` `; exports[`empty.js [meriyah] format 1`] = ` -"[2:38]: Unexpected token: 'identifier' (2:38) +"Unexpected token: 'identifier' (2:38) 1 | export * as foo from \\"foo.json\\" > 2 | export * as bar from \\"bar.json\\" assert { } | ^ @@ -105,7 +105,7 @@ exports[`multi-types.js [espree] format 1`] = ` `; exports[`multi-types.js [meriyah] format 1`] = ` -"[1:36]: Unexpected token: 'identifier' (1:36) +"Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\", type: \\"bar\\" }; | ^ 2 |" @@ -140,7 +140,7 @@ exports[`non-type.js [espree] format 1`] = ` `; exports[`non-type.js [meriyah] format 1`] = ` -"[1:33]: Unexpected token: 'identifier' (1:33) +"Unexpected token: 'identifier' (1:33) > 1 | import foo from \\"foo.json\\" assert { lazy: \\"true\\" }; | ^ 2 |" @@ -195,7 +195,7 @@ exports[`re-export.js [espree] format 1`] = ` `; exports[`re-export.js [meriyah] format 1`] = ` -"[1:38]: Unexpected token: 'identifier' (1:38) +"Unexpected token: 'identifier' (1:38) > 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" }; | ^ 2 | export * from \\"foo.json\\" assert { type: \\"json\\" }; @@ -236,7 +236,7 @@ exports[`static-import.js [espree] format 1`] = ` `; exports[`static-import.js [meriyah] format 1`] = ` -"[1:36]: Unexpected token: 'identifier' (1:36) +"Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ 2 |" @@ -271,7 +271,7 @@ exports[`without-from.js [espree] format 1`] = ` `; exports[`without-from.js [meriyah] format 1`] = ` -"[1:19]: Unexpected token: 'identifier' (1:19) +"Unexpected token: 'identifier' (1:19) > 1 | import \\"foo\\" assert { type: \\"json\\" } | ^ 2 |" diff --git a/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap index 53f15c841..26fa4d66e 100644 --- a/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap @@ -15,7 +15,7 @@ exports[`dynamic-import.js - {"bracketSpacing":false} [espree] format 1`] = ` `; exports[`dynamic-import.js - {"bracketSpacing":false} [meriyah] format 1`] = ` -"[1:20]: Expected ')' (1:20) +"Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ 2 |" @@ -49,7 +49,7 @@ exports[`empty.js - {"bracketSpacing":false} [espree] format 1`] = ` `; exports[`empty.js - {"bracketSpacing":false} [meriyah] format 1`] = ` -"[1:38]: Unexpected token: 'identifier' (1:38) +"Unexpected token: 'identifier' (1:38) > 1 | export * as bar from \\"bar.json\\" assert { } | ^" `; @@ -83,7 +83,7 @@ exports[`re-export.js - {"bracketSpacing":false} [espree] format 1`] = ` `; exports[`re-export.js - {"bracketSpacing":false} [meriyah] format 1`] = ` -"[1:38]: Unexpected token: 'identifier' (1:38) +"Unexpected token: 'identifier' (1:38) > 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" }; | ^ 2 |" @@ -119,7 +119,7 @@ exports[`static-import.js - {"bracketSpacing":false} [espree] format 1`] = ` `; exports[`static-import.js - {"bracketSpacing":false} [meriyah] format 1`] = ` -"[1:36]: Unexpected token: 'identifier' (1:36) +"Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ 2 |" diff --git a/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap index 1ff2ad357..439ae2c5d 100644 --- a/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`comments.js [espree] format 1`] = ` `; exports[`comments.js [meriyah] format 1`] = ` -"[1:32]: Unexpected token: '{' (1:32) +"Unexpected token: '{' (1:32) > 1 | const m = /*A1*/ module /*A2*/ { /*A3*/ | ^ 2 | /*A4*/ @@ -80,7 +80,7 @@ exports[`module-blocks.js [espree] format 1`] = ` `; exports[`module-blocks.js [meriyah] format 1`] = ` -"[1:8]: Unexpected token: '{' (1:8) +"Unexpected token: '{' (1:8) > 1 | module { await 3 }; | ^ 2 | @@ -224,7 +224,7 @@ exports[`range.js [espree] format 1`] = ` `; exports[`range.js [meriyah] format 1`] = ` -"[1:26]: Unexpected token: '{' (1:26) +"Unexpected token: '{' (1:26) > 1 | let moduleBlock = module { export let y = 1; | ^ 2 | }; @@ -280,7 +280,7 @@ exports[`worker.js [espree] format 1`] = ` `; exports[`worker.js [meriyah] format 1`] = ` -"[1:32]: Expected ')' (1:32) +"Expected ')' (1:32) > 1 | let worker = new Worker(module { | ^ 2 | onmessage = function({data}) { diff --git a/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap index 06fdd576d..084e2f09d 100644 --- a/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`module-string-names-export.js [meriyah] format 1`] = ` -"[1:26]: Only a identifier can be used to indicate alias (1:26) +"Only a identifier can be used to indicate alias (1:26) > 1 | export { smile as \\"smile1\\" } from \\"./emojis.js\\"; | ^ 2 | export { \\"smile\\" as smile2 } from \\"./emojis.js\\"; @@ -37,7 +37,7 @@ export { "smile4" } from "./emojis.js"; `; exports[`module-string-names-import.js [meriyah] format 1`] = ` -"[1:18]: Expected '}' (1:18) +"Expected '}' (1:18) > 1 | import { \\"default\\" as quotation1 } from \\"Confucius\\"; | ^ 2 | import { \\"foo\\" as bar, \\"default\\" as qux } from \\"module-a\\"; diff --git a/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap index ba3febd04..b60f0193a 100644 --- a/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap @@ -32,7 +32,7 @@ exports[`text.js [flow] format 1`] = ` `; exports[`text.js [meriyah] format 1`] = ` -"[6:20]: Invalid hexadecimal escape sequence (6:20) +"Invalid hexadecimal escape sequence (6:20) 4 | foo = markdown\`\\\\u{prettier}\\\\u{0065}\`; 5 | foo = css\`\\\\u{prettier}\\\\u{0065}\`; > 6 | foo = /* HTML */\`\\\\u{prettier}\\\\u{0065}\`; diff --git a/tests/format/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap index cb804da2d..62fddaed3 100644 --- a/tests/format/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`no-semi.js [espree] format 1`] = ` `; exports[`no-semi.js [meriyah] format 1`] = ` -"[2:2]: Unexpected token: ':' (2:2) +"Unexpected token: ':' (2:2) 1 | a > 2 | ;::b.c | ^ @@ -51,7 +51,7 @@ exports[`no-semi.js - {"semi":false} [espree] format 1`] = ` `; exports[`no-semi.js - {"semi":false} [meriyah] format 1`] = ` -"[2:2]: Unexpected token: ':' (2:2) +"Unexpected token: ':' (2:2) 1 | a > 2 | ;::b.c | ^ diff --git a/tests/format/js/objects/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/objects/__snapshots__/jsfmt.spec.js.snap index d7b950671..0ebca7556 100644 --- a/tests/format/js/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/objects/__snapshots__/jsfmt.spec.js.snap @@ -75,7 +75,7 @@ exports[`expression.js [espree] format 1`] = ` `; exports[`expression.js [meriyah] format 1`] = ` -"[5:4]: Expected ')' (5:4) +"Expected ')' (5:4) 3 | a = () => ({}).x; 4 | ({} && a, b); > 5 | ({}::b, 0); diff --git a/tests/format/js/partial-application/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/partial-application/__snapshots__/jsfmt.spec.js.snap index 13e4b5e30..de5ca9608 100644 --- a/tests/format/js/partial-application/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/partial-application/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`test.js [espree] format 1`] = ` `; exports[`test.js [meriyah] format 1`] = ` -"[1:23]: Unexpected token: '?' (1:23) +"Unexpected token: '?' (1:23) > 1 | const addOne = add(1, ?); // apply from the left | ^ 2 | addOne(2); // 3 diff --git a/tests/format/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap index eea2e3f96..c532009d4 100644 --- a/tests/format/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`block-comments.js [espree] format 1`] = ` `; exports[`block-comments.js [meriyah] format 1`] = ` -"[2:2]: Unexpected token: '>' (2:2) +"Unexpected token: '>' (2:2) 1 | bifornCringerMoshedPerplexSawder > 2 | |> foo1 | ^ @@ -75,7 +75,7 @@ exports[`fsharp_style_pipeline_operator.js [espree] format 1`] = ` `; exports[`fsharp_style_pipeline_operator.js [meriyah] format 1`] = ` -"[2:4]: Unexpected token: '>' (2:4) +"Unexpected token: '>' (2:4) 1 | promise > 2 | |> await | ^ @@ -198,7 +198,7 @@ exports[`hack_pipeline_operator.js [espree] format 1`] = ` `; exports[`hack_pipeline_operator.js [meriyah] format 1`] = ` -"[1:4]: Unexpected token: '>' (1:4) +"Unexpected token: '>' (1:4) > 1 | a |> await % |> % * 3; | ^ 2 | @@ -339,7 +339,7 @@ exports[`minimal_pipeline_operator.js [espree] format 1`] = ` `; exports[`minimal_pipeline_operator.js [meriyah] format 1`] = ` -"[1:4]: Unexpected token: '>' (1:4) +"Unexpected token: '>' (1:4) > 1 | a |> b |> c; | ^ 2 | diff --git a/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap index 8bfef37d2..4a848e587 100644 --- a/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap @@ -21,7 +21,7 @@ exports[`computed.js [espree] format 1`] = ` `; exports[`computed.js [meriyah] format 1`] = ` -"[2:8]: '#' not followed by identifier (2:8) +"'#' not followed by identifier (2:8) 1 | const key = \\"a\\"; > 2 | assert(#{ [key]: 1 } === #{ a: 1 }) | ^ @@ -79,7 +79,7 @@ exports[`destructuring.js [espree] format 1`] = ` `; exports[`destructuring.js [meriyah] format 1`] = ` -"[1:18]: '#' not followed by identifier (1:18) +"'#' not followed by identifier (1:18) > 1 | const { a, b } = #{ a: 1, b: 2 }; | ^ 2 | assert(a === 1); @@ -136,7 +136,7 @@ exports[`record.js [espree] format 1`] = ` `; exports[`record.js [meriyah] format 1`] = ` -"[1:17]: '#' not followed by identifier (1:17) +"'#' not followed by identifier (1:17) > 1 | const record1 = #{ | ^ 2 | a: 1, @@ -207,7 +207,7 @@ exports[`shorthand.js [espree] format 1`] = ` `; exports[`shorthand.js [meriyah] format 1`] = ` -"[2:16]: '#' not followed by identifier (2:16) +"'#' not followed by identifier (2:16) 1 | const url = \\"https://github.com/tc39/proposal-record-tuple\\"; > 2 | const record = #{ url } | ^ @@ -252,7 +252,7 @@ exports[`spread.js [espree] format 1`] = ` `; exports[`spread.js [meriyah] format 1`] = ` -"[1:18]: '#' not followed by identifier (1:18) +"'#' not followed by identifier (1:18) > 1 | const formData = #{ title: \\"Implement all the things\\" } | ^ 2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData } @@ -303,7 +303,7 @@ exports[`syntax.js [espree] format 1`] = ` `; exports[`syntax.js [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #{} | ^ 2 | #{ a: 1, b: 2 } diff --git a/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap index 738db240d..3413b6890 100644 --- a/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/regex/__snapshots__/jsfmt.spec.js.snap @@ -8,7 +8,7 @@ exports[`d-flag.js [flow] format 1`] = ` `; exports[`d-flag.js [meriyah] format 1`] = ` -"[1:3]: Unexpected regular expression flag (1:3) +"Unexpected regular expression flag (1:3) > 1 | /./d; | ^ 2 |" @@ -64,7 +64,7 @@ exports[`v-flag.js [flow] format 1`] = ` `; exports[`v-flag.js [meriyah] format 1`] = ` -"[1:3]: Unexpected regular expression flag (1:3) +"Unexpected regular expression flag (1:3) > 1 | /a/v; | ^ 2 |" diff --git a/tests/format/js/rest/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/rest/__snapshots__/jsfmt.spec.js.snap index 14bbc72c2..5b00a3583 100644 --- a/tests/format/js/rest/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/rest/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`trailing-commas.js - {"trailingComma":"all"} [espree] format 1`] = ` `; exports[`trailing-commas.js - {"trailingComma":"all"} [meriyah] format 1`] = ` -"[1:13]: Unexpected token: 'class' (1:13) +"Unexpected token: 'class' (1:13) > 1 | declare class C { | ^ 2 | f( diff --git a/tests/format/js/sloppy-mode/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/sloppy-mode/__snapshots__/jsfmt.spec.js.snap index 4e9094e7c..78a0d596b 100644 --- a/tests/format/js/sloppy-mode/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/sloppy-mode/__snapshots__/jsfmt.spec.js.snap @@ -95,7 +95,7 @@ exports[`function-declaration-in-while.js [flow] format 1`] = ` `; exports[`function-declaration-in-while.js [meriyah] format 1`] = ` -"[1:22]: In strict mode code, functions can only be declared at top level or inside a block (1:22) +"In strict mode code, functions can only be declared at top level or inside a block (1:22) > 1 | while (false) function foo(){} | ^ 2 |" diff --git a/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap index 8c9e74ea2..7c47a75fc 100644 --- a/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`throw_expression.js [espree] format 1`] = ` `; exports[`throw_expression.js [meriyah] format 1`] = ` -"[1:30]: Unexpected token: 'throw' (1:30) +"Unexpected token: 'throw' (1:30) > 1 | function save(filename = throw new TypeError(\\"Argument required\\")) {} | ^ 2 | diff --git a/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap index 27bf58269..4b1c18496 100644 --- a/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`trailing.js [espree] format 1`] = ` `; exports[`trailing.js [meriyah] format 1`] = ` -"[1:11]: Unexpected token: 'identifier' (1:11) +"Unexpected token: 'identifier' (1:11) > 1 | export type Result = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; | ^ 2 | diff --git a/tests/format/js/tuple/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/tuple/__snapshots__/jsfmt.spec.js.snap index 0670f960b..d1bcea401 100644 --- a/tests/format/js/tuple/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/tuple/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`destructuring.js [espree] format 1`] = ` `; exports[`destructuring.js [meriyah] format 1`] = ` -"[1:16]: '#' not followed by identifier (1:16) +"'#' not followed by identifier (1:16) > 1 | const [a, b] = #[1, 2]; | ^ 2 | assert(a === 1); @@ -86,7 +86,7 @@ exports[`invalid-tuple-holes.js [espree] format 1`] = ` `; exports[`invalid-tuple-holes.js [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #[,] | ^ 2 |" @@ -111,7 +111,7 @@ exports[`syntax.js [espree] format 1`] = ` `; exports[`syntax.js [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #[] | ^ 2 | #[1, 2] @@ -156,7 +156,7 @@ exports[`tuple.js [espree] format 1`] = ` `; exports[`tuple.js [meriyah] format 1`] = ` -"[1:16]: '#' not followed by identifier (1:16) +"'#' not followed by identifier (1:16) > 1 | const tuple1 = #[1, 2, 3]; | ^ 2 | @@ -225,7 +225,7 @@ exports[`tuple-trailing-comma.js [espree] format 1`] = ` `; exports[`tuple-trailing-comma.js [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #[1,] | ^ 2 |" diff --git a/tests/format/js/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap index 5d959f0a7..edd7e8084 100644 --- a/tests/format/js/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap @@ -17,7 +17,7 @@ exports[`avoid-conflicts-to-pipeline.js [espree] format 1`] = ` `; exports[`avoid-conflicts-to-pipeline.js [meriyah] format 1`] = ` -"[2:16]: Unexpected token: '%' (2:16) +"Unexpected token: '%' (2:16) 1 | // |> > 2 | const status = %GetOptimizationStatus(fn); | ^ @@ -61,7 +61,7 @@ exports[`intrinsic_call.js [espree] format 1`] = ` `; exports[`intrinsic_call.js [meriyah] format 1`] = ` -"[2:13]: Unexpected token: '%' (2:13) +"Unexpected token: '%' (2:13) 1 | function doSmth() { > 2 | %DebugPrint | ^ 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 40fb2209a..4d8238bde 100644 --- a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap @@ -61,13 +61,13 @@ exports[`snippet: #0 [flow] format 2`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:8]: Expected '(' (1:8) +"Expected '(' (1:8) > 1 | for each (a in b) {} | ^" `; exports[`snippet: #0 [meriyah] format 2`] = ` -"[1:9]: Invalid left-hand side in assignment (1:9) +"Invalid left-hand side in assignment (1:9) > 1 | (a = b) = 1 | ^" `; @@ -139,13 +139,13 @@ exports[`snippet: #1 [flow] format 2`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:12]: Unexpected strict mode reserved word (1:12) +"Unexpected strict mode reserved word (1:12) > 1 | class switch() {} | ^" `; exports[`snippet: #1 [meriyah] format 2`] = ` -"[1:7]: Invalid left-hand side in assignment (1:7) +"Invalid left-hand side in assignment (1:7) > 1 | a = 1 = 2 | ^" `; @@ -181,7 +181,7 @@ exports[`snippet: #2 [flow] format 1`] = ` `; exports[`snippet: #2 [meriyah] format 1`] = ` -"[1:9]: Invalid left-hand side in assignment (1:9) +"Invalid left-hand side in assignment (1:9) > 1 | (a = 1) = 2 | ^" `; @@ -211,7 +211,7 @@ exports[`snippet: #3 [flow] format 1`] = ` `; exports[`snippet: #3 [meriyah] format 1`] = ` -"[1:10]: Invalid left-hand side in assignment (1:10) +"Invalid left-hand side in assignment (1:10) > 1 | (a += b) = 1 | ^" `; @@ -241,7 +241,7 @@ exports[`snippet: #4 [flow] format 1`] = ` `; exports[`snippet: #4 [meriyah] format 1`] = ` -"[1:10]: Invalid left-hand side in assignment (1:10) +"Invalid left-hand side in assignment (1:10) > 1 | (a = b) += 1 | ^" `; diff --git a/tests/format/misc/errors/js/assignment/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/assignment/__snapshots__/jsfmt.spec.js.snap index 6b88411e0..1f677eedc 100644 --- a/tests/format/misc/errors/js/assignment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/assignment/__snapshots__/jsfmt.spec.js.snap @@ -25,7 +25,7 @@ exports[`snippet: #0 [espree] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:6]: Invalid left-hand side in assignment (1:6) +"Invalid left-hand side in assignment (1:6) > 1 | ({}) = x; | ^" `; diff --git a/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap index ab9df47a4..1d7444082 100644 --- a/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap @@ -51,7 +51,7 @@ exports[`snippet: #0 [flow] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[2:24]: Await is only valid in async functions (2:24) +"Await is only valid in async functions (2:24) 1 | async function foo() { > 2 | function bar(x = await 2) {} | ^ @@ -83,7 +83,7 @@ exports[`snippet: #1 [flow] format 1`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:22]: Await expression not allowed in formal parameter (1:22) +"Await expression not allowed in formal parameter (1:22) > 1 | async (x = await 2) => {}; | ^" `; @@ -113,7 +113,7 @@ exports[`snippet: #2 [flow] format 1`] = ` `; exports[`snippet: #2 [meriyah] format 1`] = ` -"[1:25]: Unexpected token: '!' (1:25) +"Unexpected token: '!' (1:25) > 1 | f = async (a) => await a! ** 6; | ^" `; @@ -143,7 +143,7 @@ exports[`snippet: #3 [flow] format 1`] = ` `; exports[`snippet: #3 [meriyah] format 1`] = ` -"[1:14]: Unexpected token: '!' (1:14) +"Unexpected token: '!' (1:14) > 1 | f = (a) => +a! ** 6; | ^" `; @@ -173,7 +173,7 @@ exports[`snippet: #4 [flow] format 1`] = ` `; exports[`snippet: #4 [meriyah] format 1`] = ` -"[1:22]: Expected ')' (1:22) +"Expected ')' (1:22) > 1 | async (a) => (await a!) ** 6; | ^" `; @@ -203,7 +203,7 @@ exports[`snippet: #5 [flow] format 1`] = ` `; exports[`snippet: #5 [meriyah] format 1`] = ` -"[1:7]: Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:7) +"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:7) > 1 | (-+5 ** 6); | ^" `; @@ -233,7 +233,7 @@ exports[`snippet: #6 [flow] format 1`] = ` `; exports[`snippet: #6 [meriyah] format 1`] = ` -"[1:26]: Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:26) +"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:26) > 1 | f = async () => await 5 ** 6; | ^" `; @@ -263,7 +263,7 @@ exports[`snippet: #7 [flow] format 1`] = ` `; exports[`snippet: #7 [meriyah] format 1`] = ` -"[1:27]: Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:27) +"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:27) > 1 | f = async () => await -5 ** 6; | ^" `; @@ -293,7 +293,7 @@ exports[`snippet: #8 [flow] format 1`] = ` `; exports[`snippet: #8 [meriyah] format 1`] = ` -"[1:21]: Invalid shorthand property initializer (1:21) +"Invalid shorthand property initializer (1:21) > 1 | async({ foo33 = 1 }); | ^" `; diff --git a/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap index 0b9bfc559..a12b158fb 100644 --- a/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap @@ -55,7 +55,7 @@ exports[`snippet: #0 [flow] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:9]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9) +"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9) > 1 | for (let.foo of []); | ^" `; @@ -91,7 +91,7 @@ exports[`snippet: #1 [flow] format 1`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:9]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9) +"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9) > 1 | for (let().bar of []); | ^" `; @@ -127,7 +127,7 @@ exports[`snippet: #2 [flow] format 1`] = ` `; exports[`snippet: #2 [meriyah] format 1`] = ` -"[1:10]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:10) +"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:10) > 1 | for (let\`\`.bar of []); | ^" `; diff --git a/tests/format/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap index 2fdf6e998..47b9eeece 100644 --- a/tests/format/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap @@ -37,7 +37,7 @@ exports[`snippet: #0 [flow] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:8]: Unexpected token: ')' (1:8) +"Unexpected token: ')' (1:8) > 1 | import(); | ^" `; @@ -85,7 +85,7 @@ exports[`snippet: #1 [flow] format 1`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:21]: Unexpected token: ')' (1:21) +"Unexpected token: ')' (1:21) > 1 | import(/* comment */); | ^" `; @@ -133,7 +133,7 @@ exports[`snippet: #2 [flow] format 1`] = ` `; exports[`snippet: #2 [meriyah] format 1`] = ` -"[1:11]: Cannot use new with import(...) (1:11) +"Cannot use new with import(...) (1:11) > 1 | new import('./a.mjs'); | ^" `; @@ -181,7 +181,7 @@ exports[`snippet: #3 [flow] format 1`] = ` `; exports[`snippet: #3 [meriyah] format 1`] = ` -"[1:11]: Cannot use new with import(...) (1:11) +"Cannot use new with import(...) (1:11) > 1 | new import(); | ^" `; diff --git a/tests/format/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap index 2d0386425..5f07adeb0 100644 --- a/tests/format/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap @@ -22,7 +22,7 @@ exports[`invalid-exponent.js [espree] format 1`] = ` `; exports[`invalid-exponent.js [meriyah] format 1`] = ` -"[1:5]: Non-number found after exponent indicator (1:5) +"Non-number found after exponent indicator (1:5) > 1 | 12.3e | ^ 2 |" diff --git a/tests/format/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap index f21841241..3f192ae93 100644 --- a/tests/format/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap @@ -28,7 +28,7 @@ exports[`getter-generator.js [espree] format 1`] = ` `; exports[`getter-generator.js [meriyah] format 1`] = ` -"[2:9]: A getter cannot be a generator (2:9) +"A getter cannot be a generator (2:9) 1 | ({ > 2 | get *iterator() { }, | ^ @@ -58,7 +58,7 @@ exports[`getter-with-parameter.js [espree] format 1`] = ` `; exports[`getter-with-parameter.js [meriyah] format 1`] = ` -"[1:10]: Getter functions must have exactly no arguments (1:10) +"Getter functions must have exactly no arguments (1:10) > 1 | ({ get x(a){} }); | ^ 2 |" @@ -92,7 +92,7 @@ exports[`setter-generator.js [espree] format 1`] = ` `; exports[`setter-generator.js [meriyah] format 1`] = ` -"[2:9]: A getter cannot be a generator (2:9) +"A getter cannot be a generator (2:9) 1 | ({ > 2 | set *iterator(iter) { }, | ^ @@ -122,7 +122,7 @@ exports[`setter-without-parameter.js [espree] format 1`] = ` `; exports[`setter-without-parameter.js [meriyah] format 1`] = ` -"[1:10]: Setter functions must have exactly one argument (1:10) +"Setter functions must have exactly one argument (1:10) > 1 | ({ set x(){} }); | ^ 2 |" diff --git a/tests/format/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap index 763e2ed7a..3c7930cfb 100644 --- a/tests/format/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`snippet: #0 [espree] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:22]: Invalid optional chain from new expression (1:22) +"Invalid optional chain from new expression (1:22) > 1 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance | ^" `; @@ -43,7 +43,7 @@ exports[`snippet: #1 [espree] format 1`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:23]: Invalid optional chain from new expression (1:23) +"Invalid optional chain from new expression (1:23) > 1 | const safe5 = new obj?.qux?.baz(); // undefined | ^" `; @@ -67,7 +67,7 @@ exports[`snippet: #2 [espree] format 1`] = ` `; exports[`snippet: #2 [meriyah] format 1`] = ` -"[1:23]: Invalid optional chain from new expression (1:23) +"Invalid optional chain from new expression (1:23) > 1 | const safe6 = new obj?.foo.bar.qux?.(); // undefined | ^" `; @@ -91,7 +91,7 @@ exports[`snippet: #3 [espree] format 1`] = ` `; exports[`snippet: #3 [meriyah] format 1`] = ` -"[1:27]: Invalid optional chain from new expression (1:27) +"Invalid optional chain from new expression (1:27) > 1 | const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor | ^" `; @@ -121,7 +121,7 @@ exports[`snippet: #4 [espree] format 1`] = ` `; exports[`snippet: #4 [meriyah] format 1`] = ` -"[4:10]: Invalid optional chain from new expression (4:10) +"Invalid optional chain from new expression (4:10) 2 | class Test { 3 | } > 4 | new Test?.(); // test instance @@ -147,7 +147,7 @@ exports[`snippet: #5 [espree] format 1`] = ` `; exports[`snippet: #5 [meriyah] format 1`] = ` -"[1:12]: Invalid optional chain from new expression (1:12) +"Invalid optional chain from new expression (1:12) > 1 | new exists?.(); // undefined | ^" `; diff --git a/tests/format/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap index 10973da0b..5d84c2f2a 100644 --- a/tests/format/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ exports[`snippet: #0 [espree] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #{a() {}} | ^" `; @@ -43,7 +43,7 @@ exports[`snippet: #1 [espree] format 1`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #{async b() {}} | ^" `; @@ -67,7 +67,7 @@ exports[`snippet: #2 [espree] format 1`] = ` `; exports[`snippet: #2 [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #{get c() {}} | ^" `; @@ -91,7 +91,7 @@ exports[`snippet: #3 [espree] format 1`] = ` `; exports[`snippet: #3 [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #{set d(_) {}} | ^" `; @@ -115,7 +115,7 @@ exports[`snippet: #4 [espree] format 1`] = ` `; exports[`snippet: #4 [meriyah] format 1`] = ` -"[1:1]: '#' not followed by identifier (1:1) +"'#' not followed by identifier (1:1) > 1 | #{*e() {}} | ^" `; diff --git a/tests/format/misc/errors/js/regex-v-u-flags/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/regex-v-u-flags/__snapshots__/jsfmt.spec.js.snap index 696b2203f..525385208 100644 --- a/tests/format/misc/errors/js/regex-v-u-flags/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/regex-v-u-flags/__snapshots__/jsfmt.spec.js.snap @@ -22,7 +22,7 @@ exports[`invalid-flags.js [espree] format 1`] = ` `; exports[`invalid-flags.js [meriyah] format 1`] = ` -"[1:5]: Unexpected regular expression flag (1:5) +"Unexpected regular expression flag (1:5) > 1 | /a/ugv; | ^ 2 |" @@ -50,7 +50,7 @@ exports[`invalid-flags2.js [espree] format 1`] = ` `; exports[`invalid-flags2.js [meriyah] format 1`] = ` -"[1:3]: Unexpected regular expression flag (1:3) +"Unexpected regular expression flag (1:3) > 1 | /a/vu; | ^ 2 |" diff --git a/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap index 46a221a0f..6bcd3e8b8 100644 --- a/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap @@ -7,7 +7,7 @@ exports[`snippet: #0 [espree] format 1`] = ` `; exports[`snippet: #0 [meriyah] format 1`] = ` -"[1:15]: Unexpected strict mode reserved word (1:15) +"Unexpected strict mode reserved word (1:15) > 1 | class interface {} | ^" `; @@ -19,7 +19,7 @@ exports[`snippet: #1 [espree] format 1`] = ` `; exports[`snippet: #1 [meriyah] format 1`] = ` -"[1:16]: Unexpected strict mode reserved word (1:16) +"Unexpected strict mode reserved word (1:16) > 1 | import interface from \\"foo\\"; | ^" `; diff --git a/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap index eae324f63..73283305f 100644 --- a/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap @@ -22,7 +22,7 @@ exports[`invalid-const.js [espree] format 1`] = ` `; exports[`invalid-const.js [meriyah] format 1`] = ` -"[1:10]: Missing initializer in const declaration (1:10) +"Missing initializer in const declaration (1:10) > 1 | const foo; | ^ 2 |"