diff --git a/tests/format/misc/errors/typescript/catch-clause-with-initializer/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/catch-clause-with-initializer/__snapshots__/format.test.js.snap index aa1febdfc..21e07be74 100644 --- a/tests/format/misc/errors/typescript/catch-clause-with-initializer/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/catch-clause-with-initializer/__snapshots__/format.test.js.snap @@ -11,6 +11,16 @@ exports[`catch-clause-with-initializer.ts [babel-ts] format 1`] = ` Cause: Unexpected token, expected ")" (3:9)" `; +exports[`catch-clause-with-initializer.ts [oxc-ts] format 1`] = ` +"Expected \`)\` but found \`=\` (3:10) + 1 | try { + 2 | } +> 3 | catch (e = 1) { + | ^ + 4 | } + 5 |" +`; + exports[`catch-clause-with-initializer.ts [typescript] format 1`] = ` "Catch clause variable cannot have an initializer. (3:12) 1 | try { diff --git a/tests/format/misc/errors/typescript/catch-clause-with-initializer/format.test.js b/tests/format/misc/errors/typescript/catch-clause-with-initializer/format.test.js index 083abcf04..edcbded1c 100644 --- a/tests/format/misc/errors/typescript/catch-clause-with-initializer/format.test.js +++ b/tests/format/misc/errors/typescript/catch-clause-with-initializer/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["babel-ts", "typescript"]); +runFormatTest(import.meta, ["babel-ts", "typescript", "oxc-ts"]); diff --git a/tests/format/misc/errors/typescript/declare-function-with-body/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/declare-function-with-body/__snapshots__/format.test.js.snap index 5144e0393..10ff66431 100644 --- a/tests/format/misc/errors/typescript/declare-function-with-body/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/declare-function-with-body/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: An implementation cannot be declared in ambient contexts. (1:0)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"An implementation cannot be declared in ambient contexts. (1:24) +> 1 | declare function foo() {} + | ^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "An implementation cannot be declared in ambient contexts. (1:1) > 1 | declare function foo() {} diff --git a/tests/format/misc/errors/typescript/declare-function-with-body/format.test.js b/tests/format/misc/errors/typescript/declare-function-with-body/format.test.js index 1562b9121..862b4096d 100644 --- a/tests/format/misc/errors/typescript/declare-function-with-body/format.test.js +++ b/tests/format/misc/errors/typescript/declare-function-with-body/format.test.js @@ -3,5 +3,5 @@ runFormatTest( importMeta: import.meta, snippets: ["declare function foo() {}"], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/decrement-and-increment-operators/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/decrement-and-increment-operators/__snapshots__/format.test.js.snap index 58f444650..ecc6aa18a 100644 --- a/tests/format/misc/errors/typescript/decrement-and-increment-operators/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/decrement-and-increment-operators/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:0)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:1) +> 1 | 1 ++ + | ^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | 1 ++ @@ -21,6 +27,12 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (1)++ + | ^" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (1)++ @@ -35,6 +47,12 @@ exports[`snippet: #2 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #2 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (1)-- + | ^" +`; + exports[`snippet: #2 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (1)-- @@ -49,6 +67,12 @@ exports[`snippet: #3 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in prefix operation. (1:3)" `; +exports[`snippet: #3 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:4) +> 1 | ++(1) + | ^" +`; + exports[`snippet: #3 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:3) > 1 | ++(1) @@ -63,6 +87,12 @@ exports[`snippet: #4 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in prefix operation. (1:3)" `; +exports[`snippet: #4 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:4) +> 1 | --(1) + | ^" +`; + exports[`snippet: #4 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:3) > 1 | --(1) @@ -77,6 +107,12 @@ exports[`snippet: #5 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #5 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (1 + 2)++ + | ^^^^^" +`; + exports[`snippet: #5 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (1 + 2)++ @@ -91,6 +127,12 @@ exports[`snippet: #6 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #6 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (1 + 2)-- + | ^^^^^" +`; + exports[`snippet: #6 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (1 + 2)-- @@ -105,6 +147,12 @@ exports[`snippet: #7 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in prefix operation. (1:3)" `; +exports[`snippet: #7 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:4) +> 1 | ++(1 + 2) + | ^^^^^" +`; + exports[`snippet: #7 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:3) > 1 | ++(1 + 2) @@ -119,6 +167,12 @@ exports[`snippet: #8 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in prefix operation. (1:3)" `; +exports[`snippet: #8 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:4) +> 1 | --(1 + 2) + | ^^^^^" +`; + exports[`snippet: #8 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:3) > 1 | --(1 + 2) @@ -133,6 +187,12 @@ exports[`snippet: #9 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #9 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (x + x)++ + | ^^^^^" +`; + exports[`snippet: #9 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (x + x)++ @@ -147,6 +207,12 @@ exports[`snippet: #10 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #10 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (x + x)-- + | ^^^^^" +`; + exports[`snippet: #10 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (x + x)-- @@ -161,6 +227,12 @@ exports[`snippet: #11 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in prefix operation. (1:3)" `; +exports[`snippet: #11 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:4) +> 1 | ++(x + x) + | ^^^^^" +`; + exports[`snippet: #11 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:3) > 1 | ++(x + x) @@ -175,6 +247,12 @@ exports[`snippet: #12 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in prefix operation. (1:3)" `; +exports[`snippet: #12 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:4) +> 1 | --(x + x) + | ^^^^^" +`; + exports[`snippet: #12 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:3) > 1 | --(x + x) @@ -189,6 +267,12 @@ exports[`snippet: #13 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:0)" `; +exports[`snippet: #13 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:1) +> 1 | a()++ + | ^^^" +`; + exports[`snippet: #13 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | a()++ @@ -203,6 +287,12 @@ exports[`snippet: #14 [babel-ts] format 1`] = ` Cause: Invalid optional chaining in the left-hand side of postfix operation. (1:0)" `; +exports[`snippet: #14 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:1) +> 1 | x?.y++ + | ^^^^" +`; + exports[`snippet: #14 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | x?.y++ @@ -217,6 +307,12 @@ exports[`snippet: #15 [babel-ts] format 1`] = ` Cause: Invalid optional chaining in the left-hand side of postfix operation. (1:0)" `; +exports[`snippet: #15 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:1) +> 1 | x?.y.z++ + | ^^^^^^" +`; + exports[`snippet: #15 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | x?.y.z++ @@ -231,6 +327,12 @@ exports[`snippet: #16 [babel-ts] format 1`] = ` Cause: Invalid optional chaining in the left-hand side of postfix operation. (1:0)" `; +exports[`snippet: #16 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:1) +> 1 | x?.y().z++ + | ^^^^^^^^" +`; + exports[`snippet: #16 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | x?.y().z++ @@ -245,6 +347,12 @@ exports[`snippet: #17 [babel-ts] format 1`] = ` Cause: Invalid left-hand side in postfix operation. (1:1)" `; +exports[`snippet: #17 [oxc-ts] format 1`] = ` +"Cannot assign to this expression (1:2) +> 1 | (a())++ + | ^^^" +`; + exports[`snippet: #17 [typescript] format 1`] = ` "Invalid left-hand side expression in unary operation (1:1) > 1 | (a())++ diff --git a/tests/format/misc/errors/typescript/decrement-and-increment-operators/format.test.js b/tests/format/misc/errors/typescript/decrement-and-increment-operators/format.test.js index 583f60954..7d1d82e42 100644 --- a/tests/format/misc/errors/typescript/decrement-and-increment-operators/format.test.js +++ b/tests/format/misc/errors/typescript/decrement-and-increment-operators/format.test.js @@ -29,5 +29,5 @@ runFormatTest( "(a())++", ], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/__snapshots__/format.test.js.snap index 4e4fbd3a8..90fdfac06 100644 --- a/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: Accessibility modifier already seen: 'protected'. (1:17)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"Accessibility modifier already seen. (1:18) +> 1 | class A {private protected method(){}} + | ^^^^^^^^^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "Accessibility modifier already seen. (1:18) > 1 | class A {private protected method(){}} @@ -21,6 +27,12 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: Accessibility modifier already seen: 'public'. (1:19)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"Accessibility modifier already seen. (1:20) +> 1 | class A {protected public method(){}} + | ^^^^^^" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "Accessibility modifier already seen. (1:20) > 1 | class A {protected public method(){}} @@ -35,6 +47,12 @@ exports[`snippet: #2 [babel-ts] format 1`] = ` Cause: Accessibility modifier already seen: 'private'. (1:17)" `; +exports[`snippet: #2 [oxc-ts] format 1`] = ` +"Accessibility modifier already seen. (1:18) +> 1 | class A {private private method(){}} + | ^^^^^^^" +`; + exports[`snippet: #2 [typescript] format 1`] = ` "Accessibility modifier already seen. (1:18) > 1 | class A {private private method(){}} @@ -49,6 +67,12 @@ exports[`snippet: #3 [babel-ts] format 1`] = ` Cause: Accessibility modifier already seen: 'protected'. (1:17)" `; +exports[`snippet: #3 [oxc-ts] format 1`] = ` +"Accessibility modifier already seen. (1:18) +> 1 | class A {private protected property} + | ^^^^^^^^^" +`; + exports[`snippet: #3 [typescript] format 1`] = ` "Accessibility modifier already seen. (1:18) > 1 | class A {private protected property} @@ -63,6 +87,12 @@ exports[`snippet: #4 [babel-ts] format 1`] = ` Cause: Accessibility modifier already seen: 'public'. (1:19)" `; +exports[`snippet: #4 [oxc-ts] format 1`] = ` +"Accessibility modifier already seen. (1:20) +> 1 | class A {protected public property} + | ^^^^^^" +`; + exports[`snippet: #4 [typescript] format 1`] = ` "Accessibility modifier already seen. (1:20) > 1 | class A {protected public property} @@ -77,6 +107,12 @@ exports[`snippet: #5 [babel-ts] format 1`] = ` Cause: Accessibility modifier already seen: 'private'. (1:17)" `; +exports[`snippet: #5 [oxc-ts] format 1`] = ` +"Accessibility modifier already seen. (1:18) +> 1 | class A {private private property} + | ^^^^^^^" +`; + exports[`snippet: #5 [typescript] format 1`] = ` "Accessibility modifier already seen. (1:18) > 1 | class A {private private property} diff --git a/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/format.test.js b/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/format.test.js index 9b0cf7e93..ac69bf7bc 100644 --- a/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/format.test.js +++ b/tests/format/misc/errors/typescript/duplicated-accessibility-modifiers/format.test.js @@ -10,5 +10,5 @@ runFormatTest( "class A {private private property}", ], }, - ["typescript", "babel-ts"], + ["typescript", "babel-ts", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/import-reflection/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/import-reflection/__snapshots__/format.test.js.snap index 394c1ae8f..57c53f0c8 100644 --- a/tests/format/misc/errors/typescript/import-reflection/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/import-reflection/__snapshots__/format.test.js.snap @@ -1,5 +1,21 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing +exports[`valid-flow-default-import.mts [babel-ts] format 1`] = ` +"Unexpected token. (1:8) +> 1 | import module foo from "./module.wasm"; + | ^ + 2 | import bar from "./module.wasm"; + 3 |" +`; + +exports[`valid-flow-default-import.mts [oxc-ts] format 1`] = ` +"Expected \`from\` but found \`Identifier\` (1:15) +> 1 | import module foo from "./module.wasm"; + | ^^^ + 2 | import bar from "./module.wasm"; + 3 |" +`; + exports[`valid-flow-default-import.mts [typescript] format 1`] = ` "'=' expected. (1:15) > 1 | import module foo from "./module.wasm"; @@ -9,6 +25,22 @@ exports[`valid-flow-default-import.mts [typescript] format 1`] = ` Cause: '=' expected." `; +exports[`valid-ts-default-import.mts [babel-ts] format 1`] = ` +"Unexpected token. (1:8) +> 1 | import module foo from "./module.wasm"; + | ^ + 2 | import bar from "./module.wasm"; + 3 |" +`; + +exports[`valid-ts-default-import.mts [oxc-ts] format 1`] = ` +"Expected \`from\` but found \`Identifier\` (1:15) +> 1 | import module foo from "./module.wasm"; + | ^^^ + 2 | import bar from "./module.wasm"; + 3 |" +`; + exports[`valid-ts-default-import.mts [typescript] format 1`] = ` "'=' expected. (1:15) > 1 | import module foo from "./module.wasm"; diff --git a/tests/format/misc/errors/typescript/import-reflection/format.test.js b/tests/format/misc/errors/typescript/import-reflection/format.test.js index 116dcbd78..1831abd0d 100644 --- a/tests/format/misc/errors/typescript/import-reflection/format.test.js +++ b/tests/format/misc/errors/typescript/import-reflection/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["typescript"]); +runFormatTest(import.meta, ["typescript", "babel-ts", "oxc-ts"]); diff --git a/tests/format/misc/errors/typescript/interface/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/interface/__snapshots__/format.test.js.snap index b6dc3b154..54f9b45bb 100644 --- a/tests/format/misc/errors/typescript/interface/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/interface/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:24)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"Unexpected token (1:25) +> 1 | interface I { x: number = 1;} + | ^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "A property signature cannot have an initializer. (1:27) > 1 | interface I { x: number = 1;} @@ -21,6 +27,12 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "{" (1:12)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"Expected \`{\` but found \`Identifier\` (1:13) +> 1 | interface A mixins B {} + | ^^^^^^" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "'{' expected. (1:13) > 1 | interface A mixins B {} @@ -35,6 +47,12 @@ exports[`snippet: #2 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "{" (1:12)" `; +exports[`snippet: #2 [oxc-ts] format 1`] = ` +"Interface declaration cannot have 'implements' clause. (1:13) +> 1 | interface A implements B {} + | ^^^^^^^^^^" +`; + exports[`snippet: #2 [typescript] format 1`] = ` "Interface declaration cannot have 'implements' clause. (1:13) > 1 | interface A implements B {} diff --git a/tests/format/misc/errors/typescript/interface/format.test.js b/tests/format/misc/errors/typescript/interface/format.test.js index a25932840..b4c1a0bdf 100644 --- a/tests/format/misc/errors/typescript/interface/format.test.js +++ b/tests/format/misc/errors/typescript/interface/format.test.js @@ -9,5 +9,5 @@ runFormatTest( "interface A implements B {}", ], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/loop/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/loop/__snapshots__/format.test.js.snap index 86c7c0157..669f6e2c3 100644 --- a/tests/format/misc/errors/typescript/loop/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/loop/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:11)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"Expected \`;\` but found \`Identifier\` (1:13) +> 1 | for (var of X); + | ^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "Only a single variable declaration is allowed in a 'for...of' statement. (1:6) > 1 | for (var of X); @@ -21,6 +27,12 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: Unexpected token (1:14)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"Unexpected token (1:15) +> 1 | for (var of of); + | ^" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "Only a single variable declaration is allowed in a 'for...of' statement. (1:6) > 1 | for (var of of); @@ -35,6 +47,12 @@ exports[`snippet: #2 [babel-ts] format 1`] = ` Cause: Unexpected keyword 'in'. (1:9)" `; +exports[`snippet: #2 [oxc-ts] format 1`] = ` +"Identifier expected. 'in' is a reserved word that cannot be used here. (1:10) +> 1 | for (var in X); + | ^^" +`; + exports[`snippet: #2 [typescript] format 1`] = ` "Only a single variable declaration is allowed in a 'for...in' statement. (1:6) > 1 | for (var in X); diff --git a/tests/format/misc/errors/typescript/loop/format.test.js b/tests/format/misc/errors/typescript/loop/format.test.js index dbbf77ad4..548cd1db5 100644 --- a/tests/format/misc/errors/typescript/loop/format.test.js +++ b/tests/format/misc/errors/typescript/loop/format.test.js @@ -3,5 +3,5 @@ runFormatTest( importMeta: import.meta, snippets: ["for (var of X);", "for (var of of);", "for (var in X);"], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/mapped-type/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/mapped-type/__snapshots__/format.test.js.snap index 42cf58a0b..98b3a30b6 100644 --- a/tests/format/misc/errors/typescript/mapped-type/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/mapped-type/__snapshots__/format.test.js.snap @@ -11,6 +11,16 @@ exports[`mapped-type.ts [babel-ts] format 1`] = ` Cause: Unexpected token, expected "}" (3:2)" `; +exports[`mapped-type.ts [oxc-ts] format 1`] = ` +"Expected \`}\` but found \`Identifier\` (3:3) + 1 | type Mapped = { + 2 | [key in keyof O]: number; +> 3 | extra_member: should_not_allowed + | ^^^^^^^^^^^^ + 4 | }; + 5 |" +`; + exports[`mapped-type.ts [typescript] format 1`] = ` "A mapped type may not declare properties or methods. (3:3) 1 | type Mapped = { diff --git a/tests/format/misc/errors/typescript/mapped-type/format.test.js b/tests/format/misc/errors/typescript/mapped-type/format.test.js index 083abcf04..edcbded1c 100644 --- a/tests/format/misc/errors/typescript/mapped-type/format.test.js +++ b/tests/format/misc/errors/typescript/mapped-type/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["babel-ts", "typescript"]); +runFormatTest(import.meta, ["babel-ts", "typescript", "oxc-ts"]); diff --git a/tests/format/misc/errors/typescript/modifiers/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/modifiers/__snapshots__/format.test.js.snap index a0b03a9b1..052bca72e 100644 --- a/tests/format/misc/errors/typescript/modifiers/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/modifiers/__snapshots__/format.test.js.snap @@ -9,6 +9,14 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: 'abstract' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | abstract method(); + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "'abstract' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -27,6 +35,14 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: 'abstract' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | abstract property; + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "'abstract' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -45,6 +61,14 @@ exports[`snippet: #2 [babel-ts] format 1`] = ` Cause: 'abstract' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #2 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | abstract [index: string]: number + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #2 [typescript] format 1`] = ` "'abstract' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -63,6 +87,14 @@ exports[`snippet: #3 [babel-ts] format 1`] = ` Cause: 'abstract' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #3 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | abstract [index: string] : string + | ^^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #3 [typescript] format 1`] = ` "'abstract' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -81,6 +113,14 @@ exports[`snippet: #4 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:11)" `; +exports[`snippet: #4 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | accessor method(); + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #4 [typescript] format 1`] = ` "'accessor' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -99,6 +139,14 @@ exports[`snippet: #5 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:11)" `; +exports[`snippet: #5 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | accessor property; + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #5 [typescript] format 1`] = ` "'accessor' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -117,6 +165,14 @@ exports[`snippet: #6 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:11)" `; +exports[`snippet: #6 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | accessor [index: string]: number + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #6 [typescript] format 1`] = ` "'accessor' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -135,6 +191,14 @@ exports[`snippet: #7 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:11)" `; +exports[`snippet: #7 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | accessor [index: string] : string + | ^^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #7 [typescript] format 1`] = ` "'accessor' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -153,6 +217,14 @@ exports[`snippet: #8 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #8 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | async method(); + | ^^^^^ + 3 | }" +`; + exports[`snippet: #8 [typescript] format 1`] = ` "'async' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -171,6 +243,14 @@ exports[`snippet: #9 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #9 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | async property; + | ^^^^^ + 3 | }" +`; + exports[`snippet: #9 [typescript] format 1`] = ` "'async' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -189,6 +269,14 @@ exports[`snippet: #10 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #10 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | async [index: string]: number + | ^^^^^ + 3 | }" +`; + exports[`snippet: #10 [typescript] format 1`] = ` "'async' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -207,6 +295,14 @@ exports[`snippet: #11 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #11 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | async [index: string] : string + | ^^^^^ + 3 | } = {};" +`; + exports[`snippet: #11 [typescript] format 1`] = ` "'async' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -225,6 +321,14 @@ exports[`snippet: #12 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #12 [oxc-ts] format 1`] = ` +"'const' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | const method(); + | ^^^^^ + 3 | }" +`; + exports[`snippet: #12 [typescript] format 1`] = ` "';' expected. (2:9) 1 | interface Foo { @@ -243,6 +347,14 @@ exports[`snippet: #13 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #13 [oxc-ts] format 1`] = ` +"'const' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | const property; + | ^^^^^ + 3 | }" +`; + exports[`snippet: #13 [typescript] format 1`] = ` "';' expected. (2:9) 1 | interface Foo { @@ -261,6 +373,14 @@ exports[`snippet: #14 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #14 [oxc-ts] format 1`] = ` +"'const' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | const [index: string]: number + | ^^^^^ + 3 | }" +`; + exports[`snippet: #14 [typescript] format 1`] = ` "';' expected. (2:9) 1 | interface Foo { @@ -279,6 +399,14 @@ exports[`snippet: #15 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:8)" `; +exports[`snippet: #15 [oxc-ts] format 1`] = ` +"'const' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | const [index: string] : string + | ^^^^^ + 3 | } = {};" +`; + exports[`snippet: #15 [typescript] format 1`] = ` "';' expected. (2:9) 1 | const foo: { @@ -297,6 +425,14 @@ exports[`snippet: #16 [babel-ts] format 1`] = ` Cause: 'declare' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #16 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | declare method(); + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #16 [typescript] format 1`] = ` "'declare' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -315,6 +451,14 @@ exports[`snippet: #17 [babel-ts] format 1`] = ` Cause: 'declare' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #17 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | declare property; + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #17 [typescript] format 1`] = ` "'declare' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -333,6 +477,14 @@ exports[`snippet: #18 [babel-ts] format 1`] = ` Cause: 'declare' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #18 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | declare [index: string]: number + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #18 [typescript] format 1`] = ` "'declare' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -351,6 +503,14 @@ exports[`snippet: #19 [babel-ts] format 1`] = ` Cause: 'declare' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #19 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | declare [index: string] : string + | ^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #19 [typescript] format 1`] = ` "'declare' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -369,6 +529,14 @@ exports[`snippet: #20 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:10)" `; +exports[`snippet: #20 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | default method(); + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #20 [typescript] format 1`] = ` "';' expected. (2:11) 1 | interface Foo { @@ -387,6 +555,14 @@ exports[`snippet: #21 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:10)" `; +exports[`snippet: #21 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | default property; + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #21 [typescript] format 1`] = ` "';' expected. (2:11) 1 | interface Foo { @@ -405,6 +581,14 @@ exports[`snippet: #22 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:10)" `; +exports[`snippet: #22 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | default [index: string]: number + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #22 [typescript] format 1`] = ` "';' expected. (2:11) 1 | interface Foo { @@ -423,6 +607,14 @@ exports[`snippet: #23 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:10)" `; +exports[`snippet: #23 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | default [index: string] : string + | ^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #23 [typescript] format 1`] = ` "';' expected. (2:11) 1 | const foo: { @@ -441,6 +633,14 @@ exports[`snippet: #24 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:9)" `; +exports[`snippet: #24 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | export method(); + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #24 [typescript] format 1`] = ` "'export' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -459,6 +659,14 @@ exports[`snippet: #25 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:9)" `; +exports[`snippet: #25 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | export property; + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #25 [typescript] format 1`] = ` "'export' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -477,6 +685,14 @@ exports[`snippet: #26 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:9)" `; +exports[`snippet: #26 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | export [index: string]: number + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #26 [typescript] format 1`] = ` "'export' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -495,6 +711,14 @@ exports[`snippet: #27 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:9)" `; +exports[`snippet: #27 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | export [index: string] : string + | ^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #27 [typescript] format 1`] = ` "'export' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -513,6 +737,14 @@ exports[`snippet: #28 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:5)" `; +exports[`snippet: #28 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | in method(); + | ^^ + 3 | }" +`; + exports[`snippet: #28 [typescript] format 1`] = ` "'in' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -531,6 +763,14 @@ exports[`snippet: #29 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:5)" `; +exports[`snippet: #29 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | in property; + | ^^ + 3 | }" +`; + exports[`snippet: #29 [typescript] format 1`] = ` "'in' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -549,6 +789,14 @@ exports[`snippet: #30 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:5)" `; +exports[`snippet: #30 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | in [index: string]: number + | ^^ + 3 | }" +`; + exports[`snippet: #30 [typescript] format 1`] = ` "'in' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -567,6 +815,14 @@ exports[`snippet: #31 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:5)" `; +exports[`snippet: #31 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | in [index: string] : string + | ^^ + 3 | } = {};" +`; + exports[`snippet: #31 [typescript] format 1`] = ` "'in' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -585,6 +841,14 @@ exports[`snippet: #32 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:6)" `; +exports[`snippet: #32 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | out method(); + | ^^^ + 3 | }" +`; + exports[`snippet: #32 [typescript] format 1`] = ` "'out' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -603,6 +867,14 @@ exports[`snippet: #33 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:6)" `; +exports[`snippet: #33 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | out property; + | ^^^ + 3 | }" +`; + exports[`snippet: #33 [typescript] format 1`] = ` "'out' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -621,6 +893,14 @@ exports[`snippet: #34 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:6)" `; +exports[`snippet: #34 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | out [index: string]: number + | ^^^ + 3 | }" +`; + exports[`snippet: #34 [typescript] format 1`] = ` "'out' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -639,6 +919,14 @@ exports[`snippet: #35 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (2:6)" `; +exports[`snippet: #35 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | out [index: string] : string + | ^^^ + 3 | } = {};" +`; + exports[`snippet: #35 [typescript] format 1`] = ` "'out' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -657,6 +945,14 @@ exports[`snippet: #36 [babel-ts] format 1`] = ` Cause: 'override' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #36 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | override method(); + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #36 [typescript] format 1`] = ` "'override' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -675,6 +971,14 @@ exports[`snippet: #37 [babel-ts] format 1`] = ` Cause: 'override' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #37 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | override property; + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #37 [typescript] format 1`] = ` "'override' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -693,6 +997,14 @@ exports[`snippet: #38 [babel-ts] format 1`] = ` Cause: 'override' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #38 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | override [index: string]: number + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #38 [typescript] format 1`] = ` "'override' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -711,6 +1023,14 @@ exports[`snippet: #39 [babel-ts] format 1`] = ` Cause: 'override' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #39 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | override [index: string] : string + | ^^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #39 [typescript] format 1`] = ` "'override' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -729,6 +1049,14 @@ exports[`snippet: #40 [babel-ts] format 1`] = ` Cause: 'private' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #40 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | private method(); + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #40 [typescript] format 1`] = ` "'private' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -747,6 +1075,14 @@ exports[`snippet: #41 [babel-ts] format 1`] = ` Cause: 'private' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #41 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | private property; + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #41 [typescript] format 1`] = ` "'private' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -765,6 +1101,14 @@ exports[`snippet: #42 [babel-ts] format 1`] = ` Cause: 'private' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #42 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | private [index: string]: number + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #42 [typescript] format 1`] = ` "'private' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -783,6 +1127,14 @@ exports[`snippet: #43 [babel-ts] format 1`] = ` Cause: 'private' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #43 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | private [index: string] : string + | ^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #43 [typescript] format 1`] = ` "'private' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -801,6 +1153,14 @@ exports[`snippet: #44 [babel-ts] format 1`] = ` Cause: 'protected' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #44 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | protected method(); + | ^^^^^^^^^ + 3 | }" +`; + exports[`snippet: #44 [typescript] format 1`] = ` "'protected' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -819,6 +1179,14 @@ exports[`snippet: #45 [babel-ts] format 1`] = ` Cause: 'protected' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #45 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | protected property; + | ^^^^^^^^^ + 3 | }" +`; + exports[`snippet: #45 [typescript] format 1`] = ` "'protected' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -837,6 +1205,14 @@ exports[`snippet: #46 [babel-ts] format 1`] = ` Cause: 'protected' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #46 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | protected [index: string]: number + | ^^^^^^^^^ + 3 | }" +`; + exports[`snippet: #46 [typescript] format 1`] = ` "'protected' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -855,6 +1231,14 @@ exports[`snippet: #47 [babel-ts] format 1`] = ` Cause: 'protected' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #47 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | protected [index: string] : string + | ^^^^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #47 [typescript] format 1`] = ` "'protected' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -873,6 +1257,14 @@ exports[`snippet: #48 [babel-ts] format 1`] = ` Cause: 'public' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #48 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | public method(); + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #48 [typescript] format 1`] = ` "'public' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -891,6 +1283,14 @@ exports[`snippet: #49 [babel-ts] format 1`] = ` Cause: 'public' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #49 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | public property; + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #49 [typescript] format 1`] = ` "'public' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -909,6 +1309,14 @@ exports[`snippet: #50 [babel-ts] format 1`] = ` Cause: 'public' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #50 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | public [index: string]: number + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #50 [typescript] format 1`] = ` "'public' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -927,6 +1335,14 @@ exports[`snippet: #51 [babel-ts] format 1`] = ` Cause: 'public' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #51 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | public [index: string] : string + | ^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #51 [typescript] format 1`] = ` "'public' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -945,6 +1361,14 @@ exports[`snippet: #52 [babel-ts] format 1`] = ` Cause: 'static' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #52 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | static method(); + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #52 [typescript] format 1`] = ` "'static' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -963,6 +1387,14 @@ exports[`snippet: #53 [babel-ts] format 1`] = ` Cause: 'static' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #53 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on a type member. (2:3) + 1 | interface Foo { +> 2 | static property; + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #53 [typescript] format 1`] = ` "'static' modifier cannot appear on a type member (2:3) 1 | interface Foo { @@ -981,6 +1413,14 @@ exports[`snippet: #54 [babel-ts] format 1`] = ` Cause: 'static' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #54 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on an index signature. (2:3) + 1 | interface Foo { +> 2 | static [index: string]: number + | ^^^^^^ + 3 | }" +`; + exports[`snippet: #54 [typescript] format 1`] = ` "'static' modifier cannot appear on an index signature (2:3) 1 | interface Foo { @@ -999,6 +1439,14 @@ exports[`snippet: #55 [babel-ts] format 1`] = ` Cause: 'static' modifier cannot appear on a type member. (2:2)" `; +exports[`snippet: #55 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on an index signature. (2:3) + 1 | const foo: { +> 2 | static [index: string] : string + | ^^^^^^ + 3 | } = {};" +`; + exports[`snippet: #55 [typescript] format 1`] = ` "'static' modifier cannot appear on an index signature (2:3) 1 | const foo: { @@ -1017,6 +1465,14 @@ exports[`snippet: #56 [babel-ts] format 1`] = ` Cause: 'readonly' modifier can only appear on a property declaration or index signature. (2:2)" `; +exports[`snippet: #56 [oxc-ts] format 1`] = ` +"'readonly' modifier can only appear on a property declaration or index signature. (2:3) + 1 | interface Foo { +> 2 | readonly method(); + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #56 [typescript] format 1`] = ` "'readonly' modifier can only appear on a property declaration or index signature. (2:3) 1 | interface Foo { @@ -1033,6 +1489,12 @@ exports[`snippet: #57 [babel-ts] format 1`] = ` Cause: 'abstract' modifier can only appear on a class, method, or property declaration. (1:0)" `; +exports[`snippet: #57 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot be used here. (1:1) +> 1 | abstract interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #57 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:1) > 1 | abstract interface Foo {} @@ -1047,6 +1509,12 @@ exports[`snippet: #58 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #58 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot be used here. (1:1) +> 1 | accessor interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #58 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:1) > 1 | accessor interface Foo {} @@ -1061,6 +1529,12 @@ exports[`snippet: #59 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:5)" `; +exports[`snippet: #59 [oxc-ts] format 1`] = ` +"'async' modifier cannot be used here. (1:1) +> 1 | async interface Foo {} + | ^^^^^" +`; + exports[`snippet: #59 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:1) > 1 | async interface Foo {} @@ -1075,6 +1549,12 @@ exports[`snippet: #60 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:15)" `; +exports[`snippet: #60 [oxc-ts] format 1`] = ` +"Missing initializer in const declaration (1:7) +> 1 | const interface Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #60 [typescript] format 1`] = ` "',' expected. (1:17) > 1 | const interface Foo {} @@ -1089,6 +1569,12 @@ exports[`snippet: #61 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #61 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | default interface Foo {} + | ^^^^^^^" +`; + exports[`snippet: #61 [typescript] format 1`] = ` "'export' expected. (1:1) > 1 | default interface Foo {} @@ -1103,6 +1589,12 @@ exports[`snippet: #62 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #62 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | in interface Foo {} + | ^^" +`; + exports[`snippet: #62 [typescript] format 1`] = ` "Expression expected. (1:1) > 1 | in interface Foo {} @@ -1117,6 +1609,12 @@ exports[`snippet: #63 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:3)" `; +exports[`snippet: #63 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:4) +> 1 | out interface Foo {} + | ^" +`; + exports[`snippet: #63 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | out interface Foo {} @@ -1131,6 +1629,12 @@ exports[`snippet: #64 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #64 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:9) +> 1 | override interface Foo {} + | ^" +`; + exports[`snippet: #64 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | override interface Foo {} @@ -1145,6 +1649,12 @@ exports[`snippet: #65 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:7)" `; +exports[`snippet: #65 [oxc-ts] format 1`] = ` +"'private' modifier cannot be used here. (1:1) +> 1 | private interface Foo {} + | ^^^^^^^" +`; + exports[`snippet: #65 [typescript] format 1`] = ` "'private' modifier cannot appear on a module or namespace element. (1:1) > 1 | private interface Foo {} @@ -1159,6 +1669,12 @@ exports[`snippet: #66 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:9)" `; +exports[`snippet: #66 [oxc-ts] format 1`] = ` +"'protected' modifier cannot be used here. (1:1) +> 1 | protected interface Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #66 [typescript] format 1`] = ` "'protected' modifier cannot appear on a module or namespace element. (1:1) > 1 | protected interface Foo {} @@ -1173,6 +1689,12 @@ exports[`snippet: #67 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #67 [oxc-ts] format 1`] = ` +"'public' modifier cannot be used here. (1:1) +> 1 | public interface Foo {} + | ^^^^^^" +`; + exports[`snippet: #67 [typescript] format 1`] = ` "'public' modifier cannot appear on a module or namespace element. (1:1) > 1 | public interface Foo {} @@ -1187,6 +1709,12 @@ exports[`snippet: #68 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #68 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot be used here. (1:1) +> 1 | readonly interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #68 [typescript] format 1`] = ` "'readonly' modifier can only appear on a property declaration or index signature. (1:1) > 1 | readonly interface Foo {} @@ -1201,6 +1729,12 @@ exports[`snippet: #69 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #69 [oxc-ts] format 1`] = ` +"'static' modifier cannot be used here. (1:1) +> 1 | static interface Foo {} + | ^^^^^^" +`; + exports[`snippet: #69 [typescript] format 1`] = ` "'static' modifier cannot appear on a module or namespace element. (1:1) > 1 | static interface Foo {} @@ -1215,6 +1749,12 @@ exports[`snippet: #70 [babel-ts] format 1`] = ` Cause: 'abstract' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #70 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #70 [typescript] format 1`] = ` "'abstract' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1229,6 +1769,12 @@ exports[`snippet: #71 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:23)" `; +exports[`snippet: #71 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #71 [typescript] format 1`] = ` "'accessor' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1243,6 +1789,12 @@ exports[`snippet: #72 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:20)" `; +exports[`snippet: #72 [oxc-ts] format 1`] = ` +"'async' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^" +`; + exports[`snippet: #72 [typescript] format 1`] = ` "'async' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1257,6 +1809,12 @@ exports[`snippet: #73 [babel-ts] format 1`] = ` Cause: 'declare' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #73 [oxc-ts] format 1`] = ` +"'declare' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^" +`; + exports[`snippet: #73 [typescript] format 1`] = ` "'declare' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1271,6 +1829,12 @@ exports[`snippet: #74 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:22)" `; +exports[`snippet: #74 [oxc-ts] format 1`] = ` +"'default' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^" +`; + exports[`snippet: #74 [typescript] format 1`] = ` "Type parameter declaration expected. (1:15) > 1 | interface Foo {} @@ -1285,6 +1849,12 @@ exports[`snippet: #75 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:21)" `; +exports[`snippet: #75 [oxc-ts] format 1`] = ` +"'export' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^" +`; + exports[`snippet: #75 [typescript] format 1`] = ` "Type parameter declaration expected. (1:15) > 1 | interface Foo {} @@ -1299,6 +1869,12 @@ exports[`snippet: #76 [babel-ts] format 1`] = ` Cause: 'override' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #76 [oxc-ts] format 1`] = ` +"'override' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #76 [typescript] format 1`] = ` "'override' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1313,6 +1889,12 @@ exports[`snippet: #77 [babel-ts] format 1`] = ` Cause: 'private' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #77 [oxc-ts] format 1`] = ` +"'private' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^" +`; + exports[`snippet: #77 [typescript] format 1`] = ` "'private' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1327,6 +1909,12 @@ exports[`snippet: #78 [babel-ts] format 1`] = ` Cause: 'protected' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #78 [oxc-ts] format 1`] = ` +"'protected' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #78 [typescript] format 1`] = ` "'protected' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1341,6 +1929,12 @@ exports[`snippet: #79 [babel-ts] format 1`] = ` Cause: 'public' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #79 [oxc-ts] format 1`] = ` +"'public' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^" +`; + exports[`snippet: #79 [typescript] format 1`] = ` "'public' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1355,6 +1949,12 @@ exports[`snippet: #80 [babel-ts] format 1`] = ` Cause: 'readonly' modifier cannot appear on a type parameter. (1:14)" `; +exports[`snippet: #80 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #80 [typescript] format 1`] = ` "'readonly' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1369,6 +1969,12 @@ exports[`snippet: #81 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:21)" `; +exports[`snippet: #81 [oxc-ts] format 1`] = ` +"'static' modifier cannot be used on a type parameter. (1:15) +> 1 | interface Foo {} + | ^^^^^^" +`; + exports[`snippet: #81 [typescript] format 1`] = ` "'static' modifier cannot appear on a type parameter (1:15) > 1 | interface Foo {} @@ -1385,6 +1991,14 @@ exports[`snippet: #82 [babel-ts] format 1`] = ` Cause: Class methods cannot have the 'declare' modifier. (2:2)" `; +exports[`snippet: #82 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on class elements of this kind. (2:3) + 1 | class Foo { +> 2 | declare method() {} + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #82 [typescript] format 1`] = ` "'declare' modifier cannot appear on class elements of this kind. (2:3) 1 | class Foo { @@ -1403,6 +2017,14 @@ exports[`snippet: #83 [babel-ts] format 1`] = ` Cause: Class methods cannot have the 'readonly' modifier. (2:2)" `; +exports[`snippet: #83 [oxc-ts] format 1`] = ` +"'readonly' modifier can only appear on a property declaration or index signature. (2:3) + 1 | class Foo { +> 2 | readonly method() {} + | ^^^^^^^^ + 3 | }" +`; + exports[`snippet: #83 [typescript] format 1`] = ` "'readonly' modifier can only appear on a property declaration or index signature. (2:3) 1 | class Foo { @@ -1421,6 +2043,14 @@ exports[`snippet: #84 [babel-ts] format 1`] = ` Cause: 'declare' is not allowed in getters. (2:2)" `; +exports[`snippet: #84 [oxc-ts] format 1`] = ` +"'declare' modifier cannot be used here. (2:3) + 1 | class Foo { +> 2 | declare get getter() {} + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #84 [typescript] format 1`] = ` "'declare' modifier cannot appear on class elements of this kind. (2:3) 1 | class Foo { @@ -1439,6 +2069,14 @@ exports[`snippet: #85 [babel-ts] format 1`] = ` Cause: 'declare' is not allowed in setters. (2:2)" `; +exports[`snippet: #85 [oxc-ts] format 1`] = ` +"'declare' modifier cannot be used here. (2:3) + 1 | class Foo { +> 2 | declare set setter(v) {} + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #85 [typescript] format 1`] = ` "'declare' modifier cannot appear on class elements of this kind. (2:3) 1 | class Foo { @@ -1455,6 +2093,12 @@ exports[`snippet: #86 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "class" (1:9)" `; +exports[`snippet: #86 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot be used here. (1:1) +> 1 | abstract module Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #86 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:1) > 1 | abstract module Foo {} @@ -1469,6 +2113,12 @@ exports[`snippet: #87 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "class" (1:9)" `; +exports[`snippet: #87 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot be used here. (1:1) +> 1 | abstract namespace Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #87 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:1) > 1 | abstract namespace Foo {} @@ -1483,6 +2133,12 @@ exports[`snippet: #88 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #88 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot be used here. (1:1) +> 1 | accessor module Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #88 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:1) > 1 | accessor module Foo {} @@ -1497,6 +2153,12 @@ exports[`snippet: #89 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #89 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot be used here. (1:1) +> 1 | accessor namespace Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #89 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:1) > 1 | accessor namespace Foo {} @@ -1511,6 +2173,12 @@ exports[`snippet: #90 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:5)" `; +exports[`snippet: #90 [oxc-ts] format 1`] = ` +"'async' modifier cannot be used here. (1:1) +> 1 | async module Foo {} + | ^^^^^" +`; + exports[`snippet: #90 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:1) > 1 | async module Foo {} @@ -1525,6 +2193,12 @@ exports[`snippet: #91 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:5)" `; +exports[`snippet: #91 [oxc-ts] format 1`] = ` +"'async' modifier cannot be used here. (1:1) +> 1 | async namespace Foo {} + | ^^^^^" +`; + exports[`snippet: #91 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:1) > 1 | async namespace Foo {} @@ -1539,6 +2213,12 @@ exports[`snippet: #92 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:12)" `; +exports[`snippet: #92 [oxc-ts] format 1`] = ` +"Missing initializer in const declaration (1:7) +> 1 | const module Foo {} + | ^^^^^^" +`; + exports[`snippet: #92 [typescript] format 1`] = ` "',' expected. (1:14) > 1 | const module Foo {} @@ -1553,6 +2233,12 @@ exports[`snippet: #93 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:15)" `; +exports[`snippet: #93 [oxc-ts] format 1`] = ` +"Missing initializer in const declaration (1:7) +> 1 | const namespace Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #93 [typescript] format 1`] = ` "',' expected. (1:17) > 1 | const namespace Foo {} @@ -1567,6 +2253,12 @@ exports[`snippet: #94 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #94 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | default module Foo {} + | ^^^^^^^" +`; + exports[`snippet: #94 [typescript] format 1`] = ` "'export' expected. (1:1) > 1 | default module Foo {} @@ -1581,6 +2273,12 @@ exports[`snippet: #95 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #95 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | default namespace Foo {} + | ^^^^^^^" +`; + exports[`snippet: #95 [typescript] format 1`] = ` "'export' expected. (1:1) > 1 | default namespace Foo {} @@ -1595,6 +2293,12 @@ exports[`snippet: #96 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #96 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | in module Foo {} + | ^^" +`; + exports[`snippet: #96 [typescript] format 1`] = ` "Expression expected. (1:1) > 1 | in module Foo {} @@ -1609,6 +2313,12 @@ exports[`snippet: #97 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #97 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | in namespace Foo {} + | ^^" +`; + exports[`snippet: #97 [typescript] format 1`] = ` "Expression expected. (1:1) > 1 | in namespace Foo {} @@ -1623,6 +2333,12 @@ exports[`snippet: #98 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:3)" `; +exports[`snippet: #98 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:4) +> 1 | out module Foo {} + | ^" +`; + exports[`snippet: #98 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | out module Foo {} @@ -1637,6 +2353,12 @@ exports[`snippet: #99 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:3)" `; +exports[`snippet: #99 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:4) +> 1 | out namespace Foo {} + | ^" +`; + exports[`snippet: #99 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | out namespace Foo {} @@ -1651,6 +2373,12 @@ exports[`snippet: #100 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #100 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:9) +> 1 | override module Foo {} + | ^" +`; + exports[`snippet: #100 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | override module Foo {} @@ -1665,6 +2393,12 @@ exports[`snippet: #101 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #101 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:9) +> 1 | override namespace Foo {} + | ^" +`; + exports[`snippet: #101 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | override namespace Foo {} @@ -1679,6 +2413,12 @@ exports[`snippet: #102 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:7)" `; +exports[`snippet: #102 [oxc-ts] format 1`] = ` +"'private' modifier cannot be used here. (1:1) +> 1 | private module Foo {} + | ^^^^^^^" +`; + exports[`snippet: #102 [typescript] format 1`] = ` "'private' modifier cannot appear on a module or namespace element. (1:1) > 1 | private module Foo {} @@ -1693,6 +2433,12 @@ exports[`snippet: #103 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:7)" `; +exports[`snippet: #103 [oxc-ts] format 1`] = ` +"'private' modifier cannot be used here. (1:1) +> 1 | private namespace Foo {} + | ^^^^^^^" +`; + exports[`snippet: #103 [typescript] format 1`] = ` "'private' modifier cannot appear on a module or namespace element. (1:1) > 1 | private namespace Foo {} @@ -1707,6 +2453,12 @@ exports[`snippet: #104 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:9)" `; +exports[`snippet: #104 [oxc-ts] format 1`] = ` +"'protected' modifier cannot be used here. (1:1) +> 1 | protected module Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #104 [typescript] format 1`] = ` "'protected' modifier cannot appear on a module or namespace element. (1:1) > 1 | protected module Foo {} @@ -1721,6 +2473,12 @@ exports[`snippet: #105 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:9)" `; +exports[`snippet: #105 [oxc-ts] format 1`] = ` +"'protected' modifier cannot be used here. (1:1) +> 1 | protected namespace Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #105 [typescript] format 1`] = ` "'protected' modifier cannot appear on a module or namespace element. (1:1) > 1 | protected namespace Foo {} @@ -1735,6 +2493,12 @@ exports[`snippet: #106 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #106 [oxc-ts] format 1`] = ` +"'public' modifier cannot be used here. (1:1) +> 1 | public module Foo {} + | ^^^^^^" +`; + exports[`snippet: #106 [typescript] format 1`] = ` "'public' modifier cannot appear on a module or namespace element. (1:1) > 1 | public module Foo {} @@ -1749,6 +2513,12 @@ exports[`snippet: #107 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #107 [oxc-ts] format 1`] = ` +"'public' modifier cannot be used here. (1:1) +> 1 | public namespace Foo {} + | ^^^^^^" +`; + exports[`snippet: #107 [typescript] format 1`] = ` "'public' modifier cannot appear on a module or namespace element. (1:1) > 1 | public namespace Foo {} @@ -1763,6 +2533,12 @@ exports[`snippet: #108 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #108 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot be used here. (1:1) +> 1 | readonly module Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #108 [typescript] format 1`] = ` "'readonly' modifier can only appear on a property declaration or index signature. (1:1) > 1 | readonly module Foo {} @@ -1777,6 +2553,12 @@ exports[`snippet: #109 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #109 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot be used here. (1:1) +> 1 | readonly namespace Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #109 [typescript] format 1`] = ` "'readonly' modifier can only appear on a property declaration or index signature. (1:1) > 1 | readonly namespace Foo {} @@ -1791,6 +2573,12 @@ exports[`snippet: #110 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #110 [oxc-ts] format 1`] = ` +"'static' modifier cannot be used here. (1:1) +> 1 | static module Foo {} + | ^^^^^^" +`; + exports[`snippet: #110 [typescript] format 1`] = ` "'static' modifier cannot appear on a module or namespace element. (1:1) > 1 | static module Foo {} @@ -1805,6 +2593,12 @@ exports[`snippet: #111 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #111 [oxc-ts] format 1`] = ` +"'static' modifier cannot be used here. (1:1) +> 1 | static namespace Foo {} + | ^^^^^^" +`; + exports[`snippet: #111 [typescript] format 1`] = ` "'static' modifier cannot appear on a module or namespace element. (1:1) > 1 | static namespace Foo {} @@ -1819,6 +2613,12 @@ exports[`snippet: #112 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "class" (1:9)" `; +exports[`snippet: #112 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot be used here. (1:1) +> 1 | abstract enum Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #112 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:1) > 1 | abstract enum Foo {} @@ -1833,6 +2633,12 @@ exports[`snippet: #113 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #113 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot be used here. (1:1) +> 1 | accessor enum Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #113 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:1) > 1 | accessor enum Foo {} @@ -1847,6 +2653,12 @@ exports[`snippet: #114 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:5)" `; +exports[`snippet: #114 [oxc-ts] format 1`] = ` +"'async' modifier cannot be used here. (1:1) +> 1 | async enum Foo {} + | ^^^^^" +`; + exports[`snippet: #114 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:1) > 1 | async enum Foo {} @@ -1861,6 +2673,12 @@ exports[`snippet: #115 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #115 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | default enum Foo {} + | ^^^^^^^" +`; + exports[`snippet: #115 [typescript] format 1`] = ` "'export' expected. (1:1) > 1 | default enum Foo {} @@ -1875,6 +2693,12 @@ exports[`snippet: #116 [babel-ts] format 1`] = ` Cause: Unexpected token (1:0)" `; +exports[`snippet: #116 [oxc-ts] format 1`] = ` +"Unexpected token (1:1) +> 1 | in enum Foo {} + | ^^" +`; + exports[`snippet: #116 [typescript] format 1`] = ` "Expression expected. (1:1) > 1 | in enum Foo {} @@ -1889,6 +2713,12 @@ exports[`snippet: #117 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:3)" `; +exports[`snippet: #117 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:4) +> 1 | out enum Foo {} + | ^" +`; + exports[`snippet: #117 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | out enum Foo {} @@ -1903,6 +2733,12 @@ exports[`snippet: #118 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #118 [oxc-ts] format 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found none (1:9) +> 1 | override enum Foo {} + | ^" +`; + exports[`snippet: #118 [typescript] format 1`] = ` "Unexpected keyword or identifier. (1:1) > 1 | override enum Foo {} @@ -1917,6 +2753,12 @@ exports[`snippet: #119 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:7)" `; +exports[`snippet: #119 [oxc-ts] format 1`] = ` +"'private' modifier cannot be used here. (1:1) +> 1 | private enum Foo {} + | ^^^^^^^" +`; + exports[`snippet: #119 [typescript] format 1`] = ` "'private' modifier cannot appear on a module or namespace element. (1:1) > 1 | private enum Foo {} @@ -1931,6 +2773,12 @@ exports[`snippet: #120 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:9)" `; +exports[`snippet: #120 [oxc-ts] format 1`] = ` +"'protected' modifier cannot be used here. (1:1) +> 1 | protected enum Foo {} + | ^^^^^^^^^" +`; + exports[`snippet: #120 [typescript] format 1`] = ` "'protected' modifier cannot appear on a module or namespace element. (1:1) > 1 | protected enum Foo {} @@ -1945,6 +2793,12 @@ exports[`snippet: #121 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #121 [oxc-ts] format 1`] = ` +"'public' modifier cannot be used here. (1:1) +> 1 | public enum Foo {} + | ^^^^^^" +`; + exports[`snippet: #121 [typescript] format 1`] = ` "'public' modifier cannot appear on a module or namespace element. (1:1) > 1 | public enum Foo {} @@ -1959,6 +2813,12 @@ exports[`snippet: #122 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:8)" `; +exports[`snippet: #122 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot be used here. (1:1) +> 1 | readonly enum Foo {} + | ^^^^^^^^" +`; + exports[`snippet: #122 [typescript] format 1`] = ` "'readonly' modifier can only appear on a property declaration or index signature. (1:1) > 1 | readonly enum Foo {} @@ -1973,6 +2833,12 @@ exports[`snippet: #123 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:6)" `; +exports[`snippet: #123 [oxc-ts] format 1`] = ` +"'static' modifier cannot be used here. (1:1) +> 1 | static enum Foo {} + | ^^^^^^" +`; + exports[`snippet: #123 [typescript] format 1`] = ` "'static' modifier cannot appear on a module or namespace element. (1:1) > 1 | static enum Foo {} @@ -1987,6 +2853,12 @@ exports[`snippet: #124 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:22)" `; +exports[`snippet: #124 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(abstract parameter) {} + | ^^^^^^^^" +`; + exports[`snippet: #124 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:14) > 1 | function foo(abstract parameter) {} @@ -2001,6 +2873,12 @@ exports[`snippet: #125 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:28)" `; +exports[`snippet: #125 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(abstract parameter) {} } + | ^^^^^^^^" +`; + exports[`snippet: #125 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:20) > 1 | class Foo { method(abstract parameter) {} } @@ -2015,6 +2893,12 @@ exports[`snippet: #126 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:22)" `; +exports[`snippet: #126 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(accessor parameter) {} + | ^^^^^^^^" +`; + exports[`snippet: #126 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:14) > 1 | function foo(accessor parameter) {} @@ -2029,6 +2913,12 @@ exports[`snippet: #127 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:28)" `; +exports[`snippet: #127 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(accessor parameter) {} } + | ^^^^^^^^" +`; + exports[`snippet: #127 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:20) > 1 | class Foo { method(accessor parameter) {} } @@ -2043,6 +2933,12 @@ exports[`snippet: #128 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:19)" `; +exports[`snippet: #128 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(async parameter) {} + | ^^^^^" +`; + exports[`snippet: #128 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:14) > 1 | function foo(async parameter) {} @@ -2057,6 +2953,12 @@ exports[`snippet: #129 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:25)" `; +exports[`snippet: #129 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(async parameter) {} } + | ^^^^^" +`; + exports[`snippet: #129 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:20) > 1 | class Foo { method(async parameter) {} } @@ -2071,6 +2973,12 @@ exports[`snippet: #130 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:19)" `; +exports[`snippet: #130 [oxc-ts] format 1`] = ` +"Identifier expected. 'const' is a reserved word that cannot be used here. (1:14) +> 1 | function foo(const parameter) {} + | ^^^^^" +`; + exports[`snippet: #130 [typescript] format 1`] = ` "Identifier expected. 'const' is a reserved word that cannot be used here. (1:14) > 1 | function foo(const parameter) {} @@ -2085,6 +2993,12 @@ exports[`snippet: #131 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:25)" `; +exports[`snippet: #131 [oxc-ts] format 1`] = ` +"Identifier expected. 'const' is a reserved word that cannot be used here. (1:20) +> 1 | class Foo { method(const parameter) {} } + | ^^^^^" +`; + exports[`snippet: #131 [typescript] format 1`] = ` "Identifier expected. 'const' is a reserved word that cannot be used here. (1:20) > 1 | class Foo { method(const parameter) {} } @@ -2099,6 +3013,12 @@ exports[`snippet: #132 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:21)" `; +exports[`snippet: #132 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(declare parameter) {} + | ^^^^^^^" +`; + exports[`snippet: #132 [typescript] format 1`] = ` "'declare' modifier cannot appear on a parameter. (1:14) > 1 | function foo(declare parameter) {} @@ -2113,6 +3033,12 @@ exports[`snippet: #133 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:27)" `; +exports[`snippet: #133 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(declare parameter) {} } + | ^^^^^^^" +`; + exports[`snippet: #133 [typescript] format 1`] = ` "'declare' modifier cannot appear on a parameter. (1:20) > 1 | class Foo { method(declare parameter) {} } @@ -2127,6 +3053,12 @@ exports[`snippet: #134 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:21)" `; +exports[`snippet: #134 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(default parameter) {} + | ^^^^^^^" +`; + exports[`snippet: #134 [typescript] format 1`] = ` "Identifier expected. 'default' is a reserved word that cannot be used here. (1:14) > 1 | function foo(default parameter) {} @@ -2141,6 +3073,12 @@ exports[`snippet: #135 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:27)" `; +exports[`snippet: #135 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(default parameter) {} } + | ^^^^^^^" +`; + exports[`snippet: #135 [typescript] format 1`] = ` "Identifier expected. 'default' is a reserved word that cannot be used here. (1:20) > 1 | class Foo { method(default parameter) {} } @@ -2155,6 +3093,12 @@ exports[`snippet: #136 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:20)" `; +exports[`snippet: #136 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(export parameter) {} + | ^^^^^^" +`; + exports[`snippet: #136 [typescript] format 1`] = ` "'export' modifier cannot appear on a parameter. (1:14) > 1 | function foo(export parameter) {} @@ -2169,6 +3113,12 @@ exports[`snippet: #137 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:26)" `; +exports[`snippet: #137 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(export parameter) {} } + | ^^^^^^" +`; + exports[`snippet: #137 [typescript] format 1`] = ` "'export' modifier cannot appear on a parameter. (1:20) > 1 | class Foo { method(export parameter) {} } @@ -2183,6 +3133,12 @@ exports[`snippet: #138 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:16)" `; +exports[`snippet: #138 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(in parameter) {} + | ^^" +`; + exports[`snippet: #138 [typescript] format 1`] = ` "'in' modifier can only appear on a type parameter of a class, interface or type alias (1:14) > 1 | function foo(in parameter) {} @@ -2197,6 +3153,12 @@ exports[`snippet: #139 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:22)" `; +exports[`snippet: #139 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(in parameter) {} } + | ^^" +`; + exports[`snippet: #139 [typescript] format 1`] = ` "'in' modifier can only appear on a type parameter of a class, interface or type alias (1:20) > 1 | class Foo { method(in parameter) {} } @@ -2211,6 +3173,12 @@ exports[`snippet: #140 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:17)" `; +exports[`snippet: #140 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(out parameter) {} + | ^^^" +`; + exports[`snippet: #140 [typescript] format 1`] = ` "'out' modifier can only appear on a type parameter of a class, interface or type alias (1:14) > 1 | function foo(out parameter) {} @@ -2225,6 +3193,12 @@ exports[`snippet: #141 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:23)" `; +exports[`snippet: #141 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(out parameter) {} } + | ^^^" +`; + exports[`snippet: #141 [typescript] format 1`] = ` "'out' modifier can only appear on a type parameter of a class, interface or type alias (1:20) > 1 | class Foo { method(out parameter) {} } @@ -2239,6 +3213,12 @@ exports[`snippet: #142 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:13)" `; +exports[`snippet: #142 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(override parameter) {} + | ^^^^^^^^" +`; + exports[`snippet: #142 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:14) > 1 | function foo(override parameter) {} @@ -2253,6 +3233,12 @@ exports[`snippet: #143 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:19)" `; +exports[`snippet: #143 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(override parameter) {} } + | ^^^^^^^^" +`; + exports[`snippet: #143 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:20) > 1 | class Foo { method(override parameter) {} } @@ -2267,6 +3253,12 @@ exports[`snippet: #144 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:13)" `; +exports[`snippet: #144 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(private parameter) {} + | ^^^^^^^" +`; + exports[`snippet: #144 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:14) > 1 | function foo(private parameter) {} @@ -2281,6 +3273,12 @@ exports[`snippet: #145 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:19)" `; +exports[`snippet: #145 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(private parameter) {} } + | ^^^^^^^" +`; + exports[`snippet: #145 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:20) > 1 | class Foo { method(private parameter) {} } @@ -2295,6 +3293,12 @@ exports[`snippet: #146 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:13)" `; +exports[`snippet: #146 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(protected parameter) {} + | ^^^^^^^^^" +`; + exports[`snippet: #146 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:14) > 1 | function foo(protected parameter) {} @@ -2309,6 +3313,12 @@ exports[`snippet: #147 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:19)" `; +exports[`snippet: #147 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(protected parameter) {} } + | ^^^^^^^^^" +`; + exports[`snippet: #147 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:20) > 1 | class Foo { method(protected parameter) {} } @@ -2323,6 +3333,12 @@ exports[`snippet: #148 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:13)" `; +exports[`snippet: #148 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(public parameter) {} + | ^^^^^^" +`; + exports[`snippet: #148 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:14) > 1 | function foo(public parameter) {} @@ -2337,6 +3353,12 @@ exports[`snippet: #149 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:19)" `; +exports[`snippet: #149 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(public parameter) {} } + | ^^^^^^" +`; + exports[`snippet: #149 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:20) > 1 | class Foo { method(public parameter) {} } @@ -2351,6 +3373,12 @@ exports[`snippet: #150 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:13)" `; +exports[`snippet: #150 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(readonly parameter) {} + | ^^^^^^^^" +`; + exports[`snippet: #150 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:14) > 1 | function foo(readonly parameter) {} @@ -2365,6 +3393,12 @@ exports[`snippet: #151 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:19)" `; +exports[`snippet: #151 [oxc-ts] format 1`] = ` +"'readonly' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(readonly parameter) {} } + | ^^^^^^^^" +`; + exports[`snippet: #151 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:20) > 1 | class Foo { method(readonly parameter) {} } @@ -2379,6 +3413,12 @@ exports[`snippet: #152 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:20)" `; +exports[`snippet: #152 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on a parameter. (1:14) +> 1 | function foo(static parameter) {} + | ^^^^^^" +`; + exports[`snippet: #152 [typescript] format 1`] = ` "'static' modifier cannot appear on a parameter. (1:14) > 1 | function foo(static parameter) {} @@ -2393,6 +3433,12 @@ exports[`snippet: #153 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:26)" `; +exports[`snippet: #153 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on a parameter. (1:20) +> 1 | class Foo { method(static parameter) {} } + | ^^^^^^" +`; + exports[`snippet: #153 [typescript] format 1`] = ` "'static' modifier cannot appear on a parameter. (1:20) > 1 | class Foo { method(static parameter) {} } @@ -2407,6 +3453,12 @@ exports[`snippet: #154 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:33)" `; +exports[`snippet: #154 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(abstract parameter) {} } + | ^^^^^^^^" +`; + exports[`snippet: #154 [typescript] format 1`] = ` "'abstract' modifier can only appear on a class, method, or property declaration. (1:25) > 1 | class Foo { constructor(abstract parameter) {} } @@ -2421,6 +3473,12 @@ exports[`snippet: #155 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:33)" `; +exports[`snippet: #155 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(accessor parameter) {} } + | ^^^^^^^^" +`; + exports[`snippet: #155 [typescript] format 1`] = ` "'accessor' modifier can only appear on a property declaration. (1:25) > 1 | class Foo { constructor(accessor parameter) {} } @@ -2435,6 +3493,12 @@ exports[`snippet: #156 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:30)" `; +exports[`snippet: #156 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(async parameter) {} } + | ^^^^^" +`; + exports[`snippet: #156 [typescript] format 1`] = ` "'async' modifier cannot be used here. (1:25) > 1 | class Foo { constructor(async parameter) {} } @@ -2449,6 +3513,12 @@ exports[`snippet: #157 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:30)" `; +exports[`snippet: #157 [oxc-ts] format 1`] = ` +"Identifier expected. 'const' is a reserved word that cannot be used here. (1:25) +> 1 | class Foo { constructor(const parameter) {} } + | ^^^^^" +`; + exports[`snippet: #157 [typescript] format 1`] = ` "Identifier expected. 'const' is a reserved word that cannot be used here. (1:25) > 1 | class Foo { constructor(const parameter) {} } @@ -2463,6 +3533,12 @@ exports[`snippet: #158 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:32)" `; +exports[`snippet: #158 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(declare parameter) {} } + | ^^^^^^^" +`; + exports[`snippet: #158 [typescript] format 1`] = ` "'declare' modifier cannot appear on a parameter. (1:25) > 1 | class Foo { constructor(declare parameter) {} } @@ -2477,6 +3553,12 @@ exports[`snippet: #159 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:32)" `; +exports[`snippet: #159 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(default parameter) {} } + | ^^^^^^^" +`; + exports[`snippet: #159 [typescript] format 1`] = ` "Identifier expected. 'default' is a reserved word that cannot be used here. (1:25) > 1 | class Foo { constructor(default parameter) {} } @@ -2491,6 +3573,12 @@ exports[`snippet: #160 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:31)" `; +exports[`snippet: #160 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(export parameter) {} } + | ^^^^^^" +`; + exports[`snippet: #160 [typescript] format 1`] = ` "'export' modifier cannot appear on a parameter. (1:25) > 1 | class Foo { constructor(export parameter) {} } @@ -2505,6 +3593,12 @@ exports[`snippet: #161 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:27)" `; +exports[`snippet: #161 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(in parameter) {} } + | ^^" +`; + exports[`snippet: #161 [typescript] format 1`] = ` "'in' modifier can only appear on a type parameter of a class, interface or type alias (1:25) > 1 | class Foo { constructor(in parameter) {} } @@ -2519,6 +3613,12 @@ exports[`snippet: #162 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:28)" `; +exports[`snippet: #162 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(out parameter) {} } + | ^^^" +`; + exports[`snippet: #162 [typescript] format 1`] = ` "'out' modifier can only appear on a type parameter of a class, interface or type alias (1:25) > 1 | class Foo { constructor(out parameter) {} } @@ -2533,6 +3633,12 @@ exports[`snippet: #163 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "," (1:31)" `; +exports[`snippet: #163 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on a parameter. (1:25) +> 1 | class Foo { constructor(static parameter) {} } + | ^^^^^^" +`; + exports[`snippet: #163 [typescript] format 1`] = ` "'static' modifier cannot appear on a parameter. (1:25) > 1 | class Foo { constructor(static parameter) {} } @@ -2547,6 +3653,12 @@ exports[`snippet: #164 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:27)" `; +exports[`snippet: #164 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a parameter. (1:28) +> 1 | class Foo {["constructor"](private parameter) {}} + | ^^^^^^^" +`; + exports[`snippet: #164 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:28) > 1 | class Foo {["constructor"](private parameter) {}} @@ -2561,6 +3673,12 @@ exports[`snippet: #165 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:27)" `; +exports[`snippet: #165 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a parameter. (1:28) +> 1 | class Foo {['constructor'](private parameter) {}} + | ^^^^^^^" +`; + exports[`snippet: #165 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:28) > 1 | class Foo {['constructor'](private parameter) {}} @@ -2575,6 +3693,12 @@ exports[`snippet: #166 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:27)" `; +exports[`snippet: #166 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a parameter. (1:28) +> 1 | class Foo {[\`constructor\`](private parameter) {}} + | ^^^^^^^" +`; + exports[`snippet: #166 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:28) > 1 | class Foo {[\`constructor\`](private parameter) {}} @@ -2589,6 +3713,12 @@ exports[`snippet: #167 [babel-ts] format 1`] = ` Cause: A parameter property is only allowed in a constructor implementation. (1:32)" `; +exports[`snippet: #167 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a parameter. (1:33) +> 1 | class Foo {['const' + 'ructor'](private parameter) {}} + | ^^^^^^^" +`; + exports[`snippet: #167 [typescript] format 1`] = ` "A parameter property is only allowed in a constructor implementation. (1:33) > 1 | class Foo {['const' + 'ructor'](private parameter) {}} @@ -2603,6 +3733,12 @@ exports[`snippet: #168 [babel-ts] format 1`] = ` Cause: 'abstract' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #168 [oxc-ts] format 1`] = ` +"'abstract' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {abstract bar}; + | ^^^^^^^^" +`; + exports[`snippet: #168 [typescript] format 1`] = ` "'abstract' modifier cannot appear on a type member (1:13) > 1 | type Foo = {abstract bar}; @@ -2617,6 +3753,12 @@ exports[`snippet: #169 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:21)" `; +exports[`snippet: #169 [oxc-ts] format 1`] = ` +"'accessor' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {accessor bar}; + | ^^^^^^^^" +`; + exports[`snippet: #169 [typescript] format 1`] = ` "'accessor' modifier cannot appear on a type member (1:13) > 1 | type Foo = {accessor bar}; @@ -2631,6 +3773,12 @@ exports[`snippet: #170 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:18)" `; +exports[`snippet: #170 [oxc-ts] format 1`] = ` +"'async' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {async bar}; + | ^^^^^" +`; + exports[`snippet: #170 [typescript] format 1`] = ` "'async' modifier cannot appear on a type member (1:13) > 1 | type Foo = {async bar}; @@ -2645,6 +3793,12 @@ exports[`snippet: #171 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:18)" `; +exports[`snippet: #171 [oxc-ts] format 1`] = ` +"'const' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {const bar}; + | ^^^^^" +`; + exports[`snippet: #171 [typescript] format 1`] = ` "';' expected. (1:19) > 1 | type Foo = {const bar}; @@ -2659,6 +3813,12 @@ exports[`snippet: #172 [babel-ts] format 1`] = ` Cause: 'declare' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #172 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {declare bar}; + | ^^^^^^^" +`; + exports[`snippet: #172 [typescript] format 1`] = ` "'declare' modifier cannot appear on a type member (1:13) > 1 | type Foo = {declare bar}; @@ -2673,6 +3833,12 @@ exports[`snippet: #173 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:20)" `; +exports[`snippet: #173 [oxc-ts] format 1`] = ` +"'default' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {default bar}; + | ^^^^^^^" +`; + exports[`snippet: #173 [typescript] format 1`] = ` "';' expected. (1:21) > 1 | type Foo = {default bar}; @@ -2687,6 +3853,12 @@ exports[`snippet: #174 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:19)" `; +exports[`snippet: #174 [oxc-ts] format 1`] = ` +"'export' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {export bar}; + | ^^^^^^" +`; + exports[`snippet: #174 [typescript] format 1`] = ` "'export' modifier cannot appear on a type member (1:13) > 1 | type Foo = {export bar}; @@ -2701,6 +3873,12 @@ exports[`snippet: #175 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:15)" `; +exports[`snippet: #175 [oxc-ts] format 1`] = ` +"'in' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {in bar}; + | ^^" +`; + exports[`snippet: #175 [typescript] format 1`] = ` "'in' modifier cannot appear on a type member (1:13) > 1 | type Foo = {in bar}; @@ -2715,6 +3893,12 @@ exports[`snippet: #176 [babel-ts] format 1`] = ` Cause: Unexpected token, expected ";" (1:16)" `; +exports[`snippet: #176 [oxc-ts] format 1`] = ` +"'out' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {out bar}; + | ^^^" +`; + exports[`snippet: #176 [typescript] format 1`] = ` "'out' modifier cannot appear on a type member (1:13) > 1 | type Foo = {out bar}; @@ -2729,6 +3913,12 @@ exports[`snippet: #177 [babel-ts] format 1`] = ` Cause: 'override' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #177 [oxc-ts] format 1`] = ` +"'override' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {override bar}; + | ^^^^^^^^" +`; + exports[`snippet: #177 [typescript] format 1`] = ` "'override' modifier cannot appear on a type member (1:13) > 1 | type Foo = {override bar}; @@ -2743,6 +3933,12 @@ exports[`snippet: #178 [babel-ts] format 1`] = ` Cause: 'private' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #178 [oxc-ts] format 1`] = ` +"'private' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {private bar}; + | ^^^^^^^" +`; + exports[`snippet: #178 [typescript] format 1`] = ` "'private' modifier cannot appear on a type member (1:13) > 1 | type Foo = {private bar}; @@ -2757,6 +3953,12 @@ exports[`snippet: #179 [babel-ts] format 1`] = ` Cause: 'protected' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #179 [oxc-ts] format 1`] = ` +"'protected' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {protected bar}; + | ^^^^^^^^^" +`; + exports[`snippet: #179 [typescript] format 1`] = ` "'protected' modifier cannot appear on a type member (1:13) > 1 | type Foo = {protected bar}; @@ -2771,6 +3973,12 @@ exports[`snippet: #180 [babel-ts] format 1`] = ` Cause: 'public' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #180 [oxc-ts] format 1`] = ` +"'public' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {public bar}; + | ^^^^^^" +`; + exports[`snippet: #180 [typescript] format 1`] = ` "'public' modifier cannot appear on a type member (1:13) > 1 | type Foo = {public bar}; @@ -2785,6 +3993,12 @@ exports[`snippet: #181 [babel-ts] format 1`] = ` Cause: 'static' modifier cannot appear on a type member. (1:12)" `; +exports[`snippet: #181 [oxc-ts] format 1`] = ` +"'static' modifier cannot appear on a type member. (1:13) +> 1 | type Foo = {static bar}; + | ^^^^^^" +`; + exports[`snippet: #181 [typescript] format 1`] = ` "'static' modifier cannot appear on a type member (1:13) > 1 | type Foo = {static bar}; @@ -2801,6 +4015,14 @@ exports[`snippet: #182 [babel-ts] format 1`] = ` Cause: Index signatures cannot have the 'declare' modifier. (2:2)" `; +exports[`snippet: #182 [oxc-ts] format 1`] = ` +"'declare' modifier cannot appear on an index signature. (2:3) + 1 | class Foo { +> 2 | declare [index: string]: number + | ^^^^^^^ + 3 | }" +`; + exports[`snippet: #182 [typescript] format 1`] = ` "'declare' modifier cannot appear on an index signature (2:3) 1 | class Foo { diff --git a/tests/format/misc/errors/typescript/modifiers/format.test.js b/tests/format/misc/errors/typescript/modifiers/format.test.js index bed049729..8caf3f4c0 100644 --- a/tests/format/misc/errors/typescript/modifiers/format.test.js +++ b/tests/format/misc/errors/typescript/modifiers/format.test.js @@ -140,5 +140,5 @@ runFormatTest( `, ], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/module-declaration/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/module-declaration/__snapshots__/format.test.js.snap index 2f7346ee3..273393699 100644 --- a/tests/format/misc/errors/typescript/module-declaration/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/module-declaration/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:9)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"Unexpected token (1:11) +> 1 | namespace "a" {} + | ^^^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "Identifier expected. (1:11) > 1 | namespace "a" {} @@ -21,6 +27,12 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: Missing semicolon. (1:9)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"Unexpected token (1:11) +> 1 | namespace "a"; + | ^^^" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "Identifier expected. (1:11) > 1 | namespace "a"; @@ -35,6 +47,12 @@ exports[`snippet: #2 [babel-ts] format 1`] = ` Cause: Unexpected token, expected "{" (1:11)" `; +exports[`snippet: #2 [oxc-ts] format 1`] = ` +"Expected \`{\` but found \`;\` (1:12) +> 1 | namespace a; + | ^" +`; + exports[`snippet: #2 [typescript] format 1`] = ` "'{' expected. (1:12) > 1 | namespace a; diff --git a/tests/format/misc/errors/typescript/module-declaration/format.test.js b/tests/format/misc/errors/typescript/module-declaration/format.test.js index 7d8342d1a..45581295a 100644 --- a/tests/format/misc/errors/typescript/module-declaration/format.test.js +++ b/tests/format/misc/errors/typescript/module-declaration/format.test.js @@ -3,5 +3,5 @@ runFormatTest( importMeta: import.meta, snippets: ['namespace "a" {}', 'namespace "a";', "namespace a;"], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], ); diff --git a/tests/format/misc/errors/typescript/tuple/__snapshots__/format.test.js.snap b/tests/format/misc/errors/typescript/tuple/__snapshots__/format.test.js.snap index b45458854..bc6f8239d 100644 --- a/tests/format/misc/errors/typescript/tuple/__snapshots__/format.test.js.snap +++ b/tests/format/misc/errors/typescript/tuple/__snapshots__/format.test.js.snap @@ -7,6 +7,12 @@ exports[`snippet: #0 [babel-ts] format 1`] = ` Cause: Tuple members must be labeled with a simple identifier. (1:10)" `; +exports[`snippet: #0 [oxc-ts] format 1`] = ` +"Expected \`,\` but found \`:\` (1:14) +> 1 | type T = [x.y: A]; + | ^" +`; + exports[`snippet: #0 [typescript] format 1`] = ` "',' expected. (1:14) > 1 | type T = [x.y: A]; @@ -21,6 +27,12 @@ exports[`snippet: #1 [babel-ts] format 1`] = ` Cause: Tuple members must be labeled with a simple identifier. (1:10)" `; +exports[`snippet: #1 [oxc-ts] format 1`] = ` +"Expected \`,\` but found \`:\` (1:15) +> 1 | type T = [x: A]; + | ^" +`; + exports[`snippet: #1 [typescript] format 1`] = ` "',' expected. (1:15) > 1 | type T = [x: A]; diff --git a/tests/format/misc/errors/typescript/tuple/format.test.js b/tests/format/misc/errors/typescript/tuple/format.test.js index a4e9f8819..7512bc2ea 100644 --- a/tests/format/misc/errors/typescript/tuple/format.test.js +++ b/tests/format/misc/errors/typescript/tuple/format.test.js @@ -8,5 +8,5 @@ runFormatTest( "type T = [x: A];", ], }, - ["babel-ts", "typescript"], + ["babel-ts", "typescript", "oxc-ts"], );