diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26f4d91dc..25a8563a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ A list of parser names. The tests verify that the parsers in this list produce the same output. -If the list includes `typescript`, then `babel-ts`, and `oxc-ts` are included implicitly. +If the list includes `typescript`, then `babel-ts`, `oxc-ts`, and `yuku-ts` are included implicitly. If the list includes `flow`, then `hermes` is included implicitly. diff --git a/changelog_unreleased/javascript/19629.md b/changelog_unreleased/javascript/19629.md new file mode 100644 index 000000000..1717459ce --- /dev/null +++ b/changelog_unreleased/javascript/19629.md @@ -0,0 +1,26 @@ +#### Added a new official plugin `@prettier/plugin-yuku` (#19628, #19629 by @fisker) + +`@prettier/plugin-yuku` is powered by [Yuku](https://yuku.fyi/) (A high-performance JavaScript/TypeScript compiler toolchain written in Zig). + +This plugin includes two new parsers: `yuku` (JavaScript syntax) and `yuku-ts` (TypeScript syntax). + +**To use this plugin:** + +1. Install the plugin: + + ```bash + yarn add --dev prettier @prettier/plugin-yuku + ``` + +2. Add it to your `.prettierrc`: + + ```yaml + plugins: + - "@prettier/plugin-yuku" + ``` + +Due to package size limitations, this plugin is not bundled with the main prettier package and must be installed separately. + +For more information, check [the package homepage](https://github.com/prettier/prettier/tree/main/packages/plugin-yuku). + +Big thanks to [@arshad-yaseen](https://github.com/arshad-yaseen) for his excellent work. diff --git a/package.json b/package.json index 77f6c6f57..330e16d70 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "wcwidth.js": "2.0.0", "yaml": "2.9.0", "yaml-unist-parser": "3.2.0", - "yuku-parser": "0.6.2" + "yuku-parser": "0.6.3" }, "devDependencies": { "@babel/generator": "8.0.0", @@ -141,9 +141,9 @@ "@types/jsesc": "3.0.3", "@typescript-eslint/eslint-plugin": "8.64.0", "@typescript-eslint/parser": "8.64.0", - "@yuku-parser/wasm": "0.6.2", + "@yuku-parser/wasm": "0.6.3", "base64-arraybuffer-es6": "3.1.0", - "browserslist": "4.28.5", + "browserslist": "4.28.6", "browserslist-to-esbuild": "2.1.1", "buffer": "6.0.3", "c8": "11.0.0", diff --git a/packages/plugin-yuku/README.md b/packages/plugin-yuku/README.md index a3f75fb00..6d2638e04 100644 --- a/packages/plugin-yuku/README.md +++ b/packages/plugin-yuku/README.md @@ -49,6 +49,11 @@ const config = { parser: "yuku", plugins: [prettierPluginYuku], }, + { + files: ["**/*.{ts,mts,cts,tsx}"], + parser: "yuku-ts", + plugins: [prettierPluginYuku], + }, ], }; diff --git a/packages/plugin-yuku/languages.evaluate.js b/packages/plugin-yuku/languages.evaluate.js index ce83af0bb..3858fd7d0 100644 --- a/packages/plugin-yuku/languages.evaluate.js +++ b/packages/plugin-yuku/languages.evaluate.js @@ -1,6 +1,9 @@ import builtinJsLanguages from "../../src/language-js/languages.evaluate.js"; -const replacements = new Map([["babel", "yuku"]]); +const replacements = new Map([ + ["babel", "yuku"], + ["typescript", "yuku-ts"], +]); const languages = builtinJsLanguages .map((language) => { diff --git a/src/language-js/parse/postprocess/index.js b/src/language-js/parse/postprocess/index.js index b1c60c7df..15cc301dd 100644 --- a/src/language-js/parse/postprocess/index.js +++ b/src/language-js/parse/postprocess/index.js @@ -52,13 +52,13 @@ const isNodeWithRaw = createTypeCheckFunction([ | "meriyah" | "oxc-js" | "oxc-ts" + | "yuku-js" + | "yuku-ts" | "typescript" - | "yuku-js", }} options */ function postprocess(ast, options) { const { text, astType } = options; - const isOxcTs = astType === "oxc-ts"; const { comments } = ast; mergeNestledJsdocComments(comments); @@ -73,7 +73,11 @@ function postprocess(ast, options) { } if (ast.hashbang) { - if (isOxcTs || astType === "yuku-js") { + if ( + astType === "oxc-ts" || + astType === "yuku-js" || + astType === "yuku-ts" + ) { comments.unshift(ast.hashbang); } delete ast.hashbang; @@ -104,7 +108,7 @@ function postprocess(ast, options) { } let shouldKeepParenthesizedExpression = false; - if (!isOxcTs) { + if (astType !== "oxc-ts") { if (!typeCastCommentsEnds) { typeCastCommentsEnds = []; @@ -150,7 +154,8 @@ function postprocess(ast, options) { astType === "hermes" || astType === "espree" || astType === "typescript" || - isOxcTs + astType === "oxc-ts" || + astType === "yuku-ts" ) { const start = locStart(node) + 1; const end = locEnd(node) - (node.tail ? 1 : 2); diff --git a/src/language-js/parse/yuku.js b/src/language-js/parse/yuku.js index 052335e63..a75a4fe88 100644 --- a/src/language-js/parse/yuku.js +++ b/src/language-js/parse/yuku.js @@ -4,6 +4,7 @@ import createError from "../../common/parser-create-error.js"; import { tryCombinationsSync } from "../../utilities/try-combinations.js"; import postprocess from "./postprocess/index.js"; import createParser from "./utilities/create-parser.js"; +import jsxRegexp from "./utilities/jsx-regexp.evaluate.js"; import { getSourceType, SOURCE_TYPE_COMBINATIONS, @@ -45,8 +46,8 @@ function parseWithOptions(text, options) { }); const { diagnostics: errors } = result; - for (const error of errors) { - throw createParseError(error, { text }); + if (errors.length > 0) { + throw createParseError(errors[0], { text }); } return result; @@ -84,6 +85,62 @@ function parseJs(text, options) { return postprocess(ast, { text, astType: "yuku-js" }); } -const yuku = /* @__PURE__ */ createParser(parseJs); +/** +@returns {ParseOptions["lang"][]} +*/ +function getLanguageCombinations(text, options) { + const filepath = options?.filepath; -export { yuku }; + if (typeof filepath === "string") { + if (/\.(?:jsx|tsx)$/i.test(filepath)) { + return ["tsx"]; + } + + if (filepath.toLowerCase().endsWith(".d.ts")) { + return ["dts"]; + } + } + + const shouldEnableJsx = jsxRegexp.test(text); + return shouldEnableJsx ? ["tsx", "ts", "dts"] : ["ts", "tsx", "dts"]; +} + +function parseTs(text, options) { + const filepath = options?.filepath; + + const sourceType = getSourceType(filepath); + const languageCombinations = getLanguageCombinations(text, options); + + const combinations = ( + sourceType ? [sourceType] : SOURCE_TYPE_COMBINATIONS + ).flatMap((sourceType) => + languageCombinations.map( + (lang) => () => + parseWithOptions(text, { + sourceType: sourceType === "commonjs" ? "script" : sourceType, + lang, + }), + ), + ); + + let result; + try { + result = tryCombinationsSync(combinations); + } catch ({ + // @ts-expect-error -- expected + errors: [error], + }) { + throw error; + } + + const { program: ast, comments } = result; + + // @ts-expect-error -- expected + ast.comments = comments; + return postprocess(ast, { text, astType: "yuku-ts" }); +} + +const yuku = /* @__PURE__ */ createParser(parseJs); +const yukuTs = /* @__PURE__ */ createParser(parseTs); + +export { yukuTs as "yuku-ts", yuku }; diff --git a/src/language-js/print/key.js b/src/language-js/print/key.js index c51f74bf9..06d6576b3 100644 --- a/src/language-js/print/key.js +++ b/src/language-js/print/key.js @@ -22,7 +22,10 @@ function isSimpleNumber(numberString) { // TODO[@fisker]: `__vue_ts_expression` and `__vue_ts_event_binding` const isTypeScript = ({ parser }) => - parser === "typescript" || parser === "babel-ts" || parser === "oxc-ts"; + parser === "typescript" || + parser === "babel-ts" || + parser === "oxc-ts" || + parser === "yuku-ts"; /** @param {Node} node @@ -102,7 +105,9 @@ function isKeySafeToUnquote(node, options) { // See https://github.com/microsoft/TypeScript/pull/20075 !( (parser === "babel-ts" && node.type === "ClassProperty") || - ((parser === "typescript" || parser === "oxc-ts") && + ((parser === "typescript" || + parser === "oxc-ts" || + parser === "yuku-ts") && node.type === "PropertyDefinition") ) && isEs5IdentifierName(value) diff --git a/src/main/plugins/builtin-plugins/development-plugins.js b/src/main/plugins/builtin-plugins/development-plugins.js index ad4493a22..b0c9ba193 100644 --- a/src/main/plugins/builtin-plugins/development-plugins.js +++ b/src/main/plugins/builtin-plugins/development-plugins.js @@ -80,6 +80,7 @@ export const plugins = /* @__PURE__ */ toLazyLoadPlugins( "oxc-ts", "typescript", "yuku", + "yuku-ts", ], }, { diff --git a/src/main/range.js b/src/main/range.js index 6a5030b6b..f891254f1 100644 --- a/src/main/range.js +++ b/src/main/range.js @@ -172,6 +172,7 @@ function isSourceElement(opts, node, parentNode) { case "oxc": case "oxc-ts": case "yuku": + case "yuku-ts": case "__babel_estree": return isJsSourceElement(node.type, parentNode?.type); case "json": diff --git a/tests/config/format-test/failed-format-tests.js b/tests/config/format-test/failed-format-tests.js index d5c000a9b..25c076e39 100644 --- a/tests/config/format-test/failed-format-tests.js +++ b/tests/config/format-test/failed-format-tests.js @@ -90,6 +90,7 @@ const disabledTests = new Map( oxc: [], "oxc-ts": ["typescript/typescript-only/"], yuku: [], + "yuku-ts": ["typescript/typescript-only/"], hermes: [ ...commentClosureTypecaseTests, diff --git a/tests/config/format-test/get-parsers.js b/tests/config/format-test/get-parsers.js index 294a57b36..5e2a8a7b8 100644 --- a/tests/config/format-test/get-parsers.js +++ b/tests/config/format-test/get-parsers.js @@ -21,7 +21,7 @@ function getParsers(dirname, parsers) { } if (parsers.includes("typescript")) { - addParsers("babel-ts", "oxc-ts"); + addParsers("babel-ts", "oxc-ts", "yuku-ts"); } if (parsers.includes("flow")) { diff --git a/tests/config/format-test/verify-fixtures.js b/tests/config/format-test/verify-fixtures.js index 86dee4ecc..facc6c63d 100644 --- a/tests/config/format-test/verify-fixtures.js +++ b/tests/config/format-test/verify-fixtures.js @@ -68,6 +68,7 @@ const categoryParsers = new Map([ "oxc", "oxc-ts", "yuku", + "yuku-ts", "flow", "babel-flow", "typescript", @@ -104,6 +105,7 @@ const categoryParsers = new Map([ "oxc", "oxc-ts", "yuku", + "yuku-ts", ], verifyParsers: [ "babel", @@ -120,6 +122,7 @@ const categoryParsers = new Map([ "oxc", "oxc-ts", "yuku", + "yuku-ts", ], extensions: [".js", ".jsx"], }, @@ -149,8 +152,15 @@ const categoryParsers = new Map([ [ "typescript", { - parsers: ["typescript", "babel-ts", "oxc-ts"], - verifyParsers: ["typescript", "babel-ts", "flow", "babel-flow", "oxc-ts"], + parsers: ["typescript", "babel-ts", "oxc-ts", "yuku-ts"], + verifyParsers: [ + "typescript", + "babel-ts", + "flow", + "babel-flow", + "oxc-ts", + "yuku-ts", + ], extensions: [".ts", ".tsx", ".cts", ".mts"], }, ], diff --git a/tests/format/flow/mapped-types/__snapshots__/format.test.js.snap b/tests/format/flow/mapped-types/__snapshots__/format.test.js.snap index 560b2bf19..7d2651456 100644 --- a/tests/format/flow/mapped-types/__snapshots__/format.test.js.snap +++ b/tests/format/flow/mapped-types/__snapshots__/format.test.js.snap @@ -125,6 +125,17 @@ exports[`comments.js format[typescript] 1`] = ` Cause: Property or signature expected." `; +exports[`comments.js format[yuku-ts] 1`] = ` +"Unexpected token '+' as signature key (3:3) + 1 | type Type = { + 2 | // comment +> 3 | +[T in number]: number; + | ^ + 4 | }; + 5 | + 6 | type Type = {" +`; + exports[`mapped-types.js format 1`] = ` ====================================options===================================== parsers: ["flow", "typescript"] @@ -229,6 +240,17 @@ exports[`mapped-types.js format[typescript] 1`] = ` Cause: Property or signature expected." `; +exports[`mapped-types.js format[yuku-ts] 1`] = ` +"Unexpected token '+' as signature key (5:28) + 3 | type Mapped = {[key in keyof O]: O[key]}; + 4 | type MappedLong = {[key in keyof AReallyLongNameThatShouldReallyMostDefinitelyCauseALineWrap]: number}; +> 5 | type MappedWithVariance = {+[key in keyof O]: number}; + | ^ + 6 | type MappedWithVarianceLong = {-[key in keyof AReallyLongNameThatShouldReallyMostDefinitelyCauseALineWrap]: number}; + 7 | type MappedWithPlusOptional = {[key in keyof O]+?: number}; + 8 | type MappedWithMinusOptional = {[key in keyof O]-?: number};" +`; + exports[`ts-compatibility.js format 1`] = ` ====================================options===================================== parsers: ["flow", "typescript"] diff --git a/tests/format/flow/mapped-types/format.test.js b/tests/format/flow/mapped-types/format.test.js index 8742dc7a4..e6517093b 100644 --- a/tests/format/flow/mapped-types/format.test.js +++ b/tests/format/flow/mapped-types/format.test.js @@ -3,5 +3,6 @@ runFormatTest(import.meta, ["flow", "typescript"], { "babel-ts": ["comments.js", "mapped-types.js"], typescript: ["comments.js", "mapped-types.js"], "oxc-ts": ["comments.js", "mapped-types.js"], + "yuku-ts": ["comments.js", "mapped-types.js"], }, }); diff --git a/tests/format/js/_errors_/class-property-named-constructor/__snapshots__/format.test.js.snap b/tests/format/js/_errors_/class-property-named-constructor/__snapshots__/format.test.js.snap index 3428c4919..cd7fd6295 100644 --- a/tests/format/js/_errors_/class-property-named-constructor/__snapshots__/format.test.js.snap +++ b/tests/format/js/_errors_/class-property-named-constructor/__snapshots__/format.test.js.snap @@ -98,6 +98,14 @@ exports[`snippet: #0 format[yuku] 1`] = ` | ^" `; +exports[`snippet: #0 format[yuku-ts] 1`] = ` +"Expected '(' for getter/setter definition, but found '}' (3:1) + 1 | class Foo { + 2 | constructor +> 3 | } + | ^" +`; + exports[`snippet: #1 format[acorn] 1`] = ` "Classes can't have a field named 'constructor' (2:3) 1 | class Foo { @@ -196,6 +204,14 @@ exports[`snippet: #1 format[yuku] 1`] = ` | ^" `; +exports[`snippet: #1 format[yuku-ts] 1`] = ` +"Expected '(' for getter/setter definition, but found '}' (3:1) + 1 | class Foo { + 2 | 'constructor' +> 3 | } + | ^" +`; + exports[`snippet: #2 format[acorn] 1`] = ` "Classes can't have a field named 'constructor' (2:3) 1 | class Foo { @@ -294,6 +310,14 @@ exports[`snippet: #2 format[yuku] 1`] = ` | ^" `; +exports[`snippet: #2 format[yuku-ts] 1`] = ` +"Expected '(' for getter/setter definition, but found '}' (3:1) + 1 | class Foo { + 2 | 'constructor' +> 3 | } + | ^" +`; + exports[`snippet: #3 format[acorn] 1`] = ` "Unexpected token (2:12) 1 | class Foo { @@ -392,6 +416,14 @@ exports[`snippet: #3 format[yuku] 1`] = ` | ^" `; +exports[`snippet: #3 format[yuku-ts] 1`] = ` +"Expected '(' for getter/setter definition, but found '}' (3:1) + 1 | class Foo { + 2 | accessor 'constructor' +> 3 | } + | ^" +`; + exports[`snippet: #4 format[acorn] 1`] = ` "Unexpected token (2:12) 1 | class Foo { @@ -490,6 +522,14 @@ exports[`snippet: #4 format[yuku] 1`] = ` | ^" `; +exports[`snippet: #4 format[yuku-ts] 1`] = ` +"Expected '(' for getter/setter definition, but found '}' (3:1) + 1 | class Foo { + 2 | accessor 'constructor' +> 3 | } + | ^" +`; + exports[`snippet: #5 format[acorn] 1`] = ` "Unexpected token (2:12) 1 | class Foo { @@ -587,3 +627,11 @@ exports[`snippet: #5 format[yuku] 1`] = ` > 3 | } | ^" `; + +exports[`snippet: #5 format[yuku-ts] 1`] = ` +"Expected '(' for getter/setter definition, but found '}' (3:1) + 1 | class Foo { + 2 | accessor constructor +> 3 | } + | ^" +`; diff --git a/tests/format/js/_errors_/class-property-named-constructor/format.test.js b/tests/format/js/_errors_/class-property-named-constructor/format.test.js index 5363c5f31..9c9bd20b9 100644 --- a/tests/format/js/_errors_/class-property-named-constructor/format.test.js +++ b/tests/format/js/_errors_/class-property-named-constructor/format.test.js @@ -15,6 +15,7 @@ runFormatTest( "oxc", "oxc-ts", "yuku", + "yuku-ts", "flow", "hermes", ], diff --git a/tests/format/js/_errors_/discard-binding/__snapshots__/format.test.js.snap b/tests/format/js/_errors_/discard-binding/__snapshots__/format.test.js.snap index 6ee962dc7..87fe84d5c 100644 --- a/tests/format/js/_errors_/discard-binding/__snapshots__/format.test.js.snap +++ b/tests/format/js/_errors_/discard-binding/__snapshots__/format.test.js.snap @@ -89,6 +89,15 @@ exports[`invalid-array-expression.js format[yuku] 1`] = ` 4 |" `; +exports[`invalid-array-expression.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (1:9) +> 1 | ([[[void], x, ], y]); + | ^ + 2 | + 3 | ([[[x], void, ], y]); + 4 |" +`; + exports[`invalid-assignment-expression.js format[acorn] 1`] = ` "Unexpected token (1:6) > 1 | void = 0; @@ -160,6 +169,13 @@ exports[`invalid-assignment-expression.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-assignment-expression.js format[yuku-ts] 1`] = ` +"Unexpected token '=' (1:6) +> 1 | void = 0; + | ^ + 2 |" +`; + exports[`invalid-assignment-for.js format[acorn] 1`] = ` "Unexpected token (1:15) > 1 | for (void of []); @@ -231,6 +247,13 @@ exports[`invalid-assignment-for.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-assignment-for.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (1:15) +> 1 | for (void of []); + | ^ + 2 |" +`; + exports[`invalid-assignment-pattern.js format[acorn] 1`] = ` "Unexpected keyword 'void' (3:14) 1 | { @@ -338,6 +361,17 @@ exports[`invalid-assignment-pattern.js format[yuku] 1`] = ` 6 | // arrow function parameter" `; +exports[`invalid-assignment-pattern.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (3:14) + 1 | { + 2 | // function parameter +> 3 | function f(void = 0) {} + | ^^^^ + 4 | } + 5 | { + 6 | // arrow function parameter" +`; + exports[`invalid-async-call-argument.js format[acorn] 1`] = ` "Unexpected token (1:11) > 1 | async(void, x); @@ -427,6 +461,15 @@ exports[`invalid-async-call-argument.js format[yuku] 1`] = ` 4 |" `; +exports[`invalid-async-call-argument.js format[yuku-ts] 1`] = ` +"Unexpected token ',' (1:11) +> 1 | async(void, x); + | ^ + 2 | + 3 | async(x, void); + 4 |" +`; + exports[`invalid-catch-parameter.js format[acorn] 1`] = ` "Unexpected keyword 'void' (1:15) > 1 | try {} catch (void) {} @@ -498,6 +541,13 @@ exports[`invalid-catch-parameter.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-catch-parameter.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (1:15) +> 1 | try {} catch (void) {} + | ^^^^ + 2 |" +`; + exports[`invalid-lone-arrow-function-parameter.js format[acorn] 1`] = ` "Unexpected token (1:6) > 1 | void => {} @@ -569,6 +619,13 @@ exports[`invalid-lone-arrow-function-parameter.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-lone-arrow-function-parameter.js format[yuku-ts] 1`] = ` +"Unexpected token '=>' (1:6) +> 1 | void => {} + | ^^ + 2 |" +`; + exports[`invalid-lone-async-arrow-function-parameter.js format[acorn] 1`] = ` "Unexpected token (1:7) > 1 | async void => {} @@ -640,6 +697,13 @@ exports[`invalid-lone-async-arrow-function-parameter.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-lone-async-arrow-function-parameter.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as an identifier (1:7) +> 1 | async void => {} + | ^^^^ + 2 |" +`; + exports[`invalid-object-expression.js format[acorn] 1`] = ` "Unexpected token (1:22) > 1 | ({ p: { p: { p: void }, x, }, y}); @@ -729,6 +793,15 @@ exports[`invalid-object-expression.js format[yuku] 1`] = ` 4 |" `; +exports[`invalid-object-expression.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (1:22) +> 1 | ({ p: { p: { p: void }, x, }, y}); + | ^ + 2 | + 3 | ({ p: { x: { x }, p: void, }, y}); + 4 |" +`; + exports[`invalid-parenthesized-assignment.js format[acorn] 1`] = ` "Unexpected token (1:7) > 1 | [(void)] = []; @@ -800,6 +873,13 @@ exports[`invalid-parenthesized-assignment.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-parenthesized-assignment.js format[yuku-ts] 1`] = ` +"Unexpected token ')' (1:7) +> 1 | [(void)] = []; + | ^ + 2 |" +`; + exports[`invalid-parenthesized-binding.js format[acorn] 1`] = ` "Unexpected token (1:10) > 1 | const [, (void), ] = value; @@ -871,6 +951,13 @@ exports[`invalid-parenthesized-binding.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-parenthesized-binding.js format[yuku-ts] 1`] = ` +"Unexpected token ')' (1:15) +> 1 | const [, (void), ] = value; + | ^ + 2 |" +`; + exports[`invalid-rest-element-array-pattern.js format[acorn] 1`] = ` "Unexpected keyword 'void' (2:12) 1 | { @@ -969,6 +1056,16 @@ exports[`invalid-rest-element-array-pattern.js format[yuku] 1`] = ` 5 | for (var [...void] of [[]]);" `; +exports[`invalid-rest-element-array-pattern.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (2:17) + 1 | { +> 2 | var [ ...void ] = []; + | ^ + 3 | } + 4 | { + 5 | for (var [...void] of [[]]);" +`; + exports[`invalid-rest-element-array-pattern-for-lhs.js format[acorn] 1`] = ` "Unexpected token (1:16) > 1 | for ([ ...void ] of []); @@ -1040,6 +1137,13 @@ exports[`invalid-rest-element-array-pattern-for-lhs.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-rest-element-array-pattern-for-lhs.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (1:16) +> 1 | for ([ ...void ] of []); + | ^ + 2 |" +`; + exports[`invalid-rest-element-array-pattern-lhs.js format[acorn] 1`] = ` "Unexpected token (1:12) > 1 | ([ ...void ] = []); @@ -1111,6 +1215,13 @@ exports[`invalid-rest-element-array-pattern-lhs.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-rest-element-array-pattern-lhs.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (1:12) +> 1 | ([ ...void ] = []); + | ^ + 2 |" +`; + exports[`invalid-rest-element-object-pattern.js format[acorn] 1`] = ` "Unexpected keyword 'void' (2:12) 1 | { @@ -1209,6 +1320,16 @@ exports[`invalid-rest-element-object-pattern.js format[yuku] 1`] = ` 5 | for (var { ...void } of [{}]);" `; +exports[`invalid-rest-element-object-pattern.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (2:17) + 1 | { +> 2 | var { ...void } = {}; + | ^ + 3 | } + 4 | { + 5 | for (var { ...void } of [{}]);" +`; + exports[`invalid-rest-element-object-pattern-for-lhs.js format[acorn] 1`] = ` "Unexpected token (1:16) > 1 | for ({ ...void } of []); @@ -1280,6 +1401,13 @@ exports[`invalid-rest-element-object-pattern-for-lhs.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-rest-element-object-pattern-for-lhs.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (1:16) +> 1 | for ({ ...void } of []); + | ^ + 2 |" +`; + exports[`invalid-rest-element-object-pattern-lhs.js format[acorn] 1`] = ` "Unexpected token (1:12) > 1 | ({ ...void } = {}); @@ -1351,6 +1479,13 @@ exports[`invalid-rest-element-object-pattern-lhs.js format[yuku] 1`] = ` 2 |" `; +exports[`invalid-rest-element-object-pattern-lhs.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (1:12) +> 1 | ({ ...void } = {}); + | ^ + 2 |" +`; + exports[`invalid-sequence-expression.js format[acorn] 1`] = ` "Unexpected token (1:6) > 1 | (void, x); @@ -1440,6 +1575,15 @@ exports[`invalid-sequence-expression.js format[yuku] 1`] = ` 4 |" `; +exports[`invalid-sequence-expression.js format[yuku-ts] 1`] = ` +"Unexpected token ',' (1:6) +> 1 | (void, x); + | ^ + 2 | + 3 | (x, void); + 4 |" +`; + exports[`invalid-variable-declarator.js format[acorn] 1`] = ` "Unexpected keyword 'void' (2:7) 1 | { @@ -1537,3 +1681,13 @@ exports[`invalid-variable-declarator.js format[yuku] 1`] = ` 4 | { 5 | let void = f(), void = g();" `; + +exports[`invalid-variable-declarator.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (2:7) + 1 | { +> 2 | var void = f(); + | ^^^^ + 3 | } + 4 | { + 5 | let void = f(), void = g();" +`; diff --git a/tests/format/js/_errors_/discard-binding/format.test.js b/tests/format/js/_errors_/discard-binding/format.test.js index e611b8aa0..8aa3fcef3 100644 --- a/tests/format/js/_errors_/discard-binding/format.test.js +++ b/tests/format/js/_errors_/discard-binding/format.test.js @@ -7,5 +7,6 @@ runFormatTest(import.meta, [ "oxc", "oxc-ts", "yuku", + "yuku-ts", "hermes", ]); diff --git a/tests/format/js/_errors_/export-name/__snapshots__/format.test.js.snap b/tests/format/js/_errors_/export-name/__snapshots__/format.test.js.snap index f6dfcff32..89a99c2d5 100644 --- a/tests/format/js/_errors_/export-name/__snapshots__/format.test.js.snap +++ b/tests/format/js/_errors_/export-name/__snapshots__/format.test.js.snap @@ -90,6 +90,12 @@ exports[`snippet: #0 format[yuku] 1`] = ` | ^^^^^^^^" `; +exports[`snippet: #0 format[yuku-ts] 1`] = ` +"An export name cannot include a unicode lone surrogate (1:10) +> 1 | import { "\\uD83C" as b } from "./foo"; + | ^^^^^^^^" +`; + exports[`snippet: #1 format[__babel_estree] 1`] = ` "An export name cannot include a lone surrogate, found '\\ud83c'. (1:10) > 1 | export { "\\uD83C" } from "./foo"; @@ -180,6 +186,12 @@ exports[`snippet: #1 format[yuku] 1`] = ` | ^^^^^^^^" `; +exports[`snippet: #1 format[yuku-ts] 1`] = ` +"An export name cannot include a unicode lone surrogate (1:10) +> 1 | export { "\\uD83C" } from "./foo"; + | ^^^^^^^^" +`; + exports[`snippet: #2 format[__babel_estree] 1`] = ` "An export name cannot include a lone surrogate, found '\\ud83c'. (1:10) > 1 | export { "\\uD83C" as b } from "./foo"; @@ -270,6 +282,12 @@ exports[`snippet: #2 format[yuku] 1`] = ` | ^^^^^^^^" `; +exports[`snippet: #2 format[yuku-ts] 1`] = ` +"An export name cannot include a unicode lone surrogate (1:10) +> 1 | export { "\\uD83C" as b } from "./foo"; + | ^^^^^^^^" +`; + exports[`snippet: #3 format[__babel_estree] 1`] = ` "An export name cannot include a lone surrogate, found '\\ud83c'. (1:15) > 1 | export { b as "\\uD83C" } from "./foo"; @@ -359,3 +377,9 @@ exports[`snippet: #3 format[yuku] 1`] = ` > 1 | export { b as "\\uD83C" } from "./foo"; | ^^^^^^^^" `; + +exports[`snippet: #3 format[yuku-ts] 1`] = ` +"An export name cannot include a unicode lone surrogate (1:15) +> 1 | export { b as "\\uD83C" } from "./foo"; + | ^^^^^^^^" +`; diff --git a/tests/format/js/_errors_/export-name/format.test.js b/tests/format/js/_errors_/export-name/format.test.js index ba2a214c9..b02a068ce 100644 --- a/tests/format/js/_errors_/export-name/format.test.js +++ b/tests/format/js/_errors_/export-name/format.test.js @@ -23,5 +23,6 @@ runFormatTest( "oxc", "oxc-ts", "yuku", + "yuku-ts", ], ); diff --git a/tests/format/js/_errors_/reserved-word/__snapshots__/format.test.js.snap b/tests/format/js/_errors_/reserved-word/__snapshots__/format.test.js.snap index 716a50fea..28415e8f2 100644 --- a/tests/format/js/_errors_/reserved-word/__snapshots__/format.test.js.snap +++ b/tests/format/js/_errors_/reserved-word/__snapshots__/format.test.js.snap @@ -90,6 +90,12 @@ exports[`snippet: #0 format[yuku] 1`] = ` | ^^^^^^^^^^" `; +exports[`snippet: #0 format[yuku-ts] 1`] = ` +"Keywords cannot contain escape characters (1:8) +> 1 | export asyn\\u{63} from "async"; + | ^^^^^^^^^^" +`; + exports[`snippet: #1 format[acorn] 1`] = ` "The keyword 'interface' is reserved (1:8) > 1 | import interface from "foo"; diff --git a/tests/format/js/_errors_/reserved-word/format.test.js b/tests/format/js/_errors_/reserved-word/format.test.js index 6470110d0..571de69c5 100644 --- a/tests/format/js/_errors_/reserved-word/format.test.js +++ b/tests/format/js/_errors_/reserved-word/format.test.js @@ -37,5 +37,6 @@ runFormatTest( "oxc", "oxc-ts", "yuku", + "yuku-ts", ], ); diff --git a/tests/format/js/arrows-bind/format.test.js b/tests/format/js/arrows-bind/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/arrows-bind/format.test.js +++ b/tests/format/js/arrows-bind/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/async-do-expressions/format.test.js b/tests/format/js/async-do-expressions/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/async-do-expressions/format.test.js +++ b/tests/format/js/async-do-expressions/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/babel-plugins/format.test.js b/tests/format/js/babel-plugins/format.test.js index 9a82e74ae..b8e254f25 100644 --- a/tests/format/js/babel-plugins/format.test.js +++ b/tests/format/js/babel-plugins/format.test.js @@ -130,6 +130,24 @@ runFormatTest(import.meta, ["babel", "babel-ts", "babel-flow"], { "v8intrinsic.js", "discard-binding.js", ], + "yuku-ts": [ + "async-do-expressions.js", + "destructuring-private.js", + "do-expressions.js", + "export-default-from.js", + "flow.js", + "function-bind.js", + "function-sent.js", + "module-blocks.js", + "optional-chaining-assignment.js", + "partial-application.js", + "pipeline-operator-fsharp.js", + "pipeline-operator-hack.cjs", + "pipeline-operator-minimal.js", + "throw-expressions.js", + "v8intrinsic.js", + "discard-binding.js", + ], babel: ["flow.js", "typescript.js"], __babel_estree: ["flow.js", "typescript.js"], }, diff --git a/tests/format/js/bind-expressions/format.test.js b/tests/format/js/bind-expressions/format.test.js index c3db9dce6..d9b4cb77d 100644 --- a/tests/format/js/bind-expressions/format.test.js +++ b/tests/format/js/bind-expressions/format.test.js @@ -5,6 +5,7 @@ const errors = { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }; runFormatTest(import.meta, ["babel"], { errors }); diff --git a/tests/format/js/call/invalid/format.test.js b/tests/format/js/call/invalid/format.test.js index ecb097c05..3fd88deea 100644 --- a/tests/format/js/call/invalid/format.test.js +++ b/tests/format/js/call/invalid/format.test.js @@ -8,5 +8,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/deferred-import-evaluation/__snapshots__/format.test.js.snap b/tests/format/js/deferred-import-evaluation/__snapshots__/format.test.js.snap index 737bca20e..7566f5091 100644 --- a/tests/format/js/deferred-import-evaluation/__snapshots__/format.test.js.snap +++ b/tests/format/js/deferred-import-evaluation/__snapshots__/format.test.js.snap @@ -196,9 +196,9 @@ exports[`no-default.js format[oxc] 1`] = ` `; exports[`no-default.js format[yuku] 1`] = ` -"'import defer' only supports a namespace import (1:8) +"Expected 'from' after import clause, but found 'x' (1:14) > 1 | import defer x from "x"; - | ^^^^^ + | ^ 2 |" `; diff --git a/tests/format/js/deferred-import-evaluation/format.test.js b/tests/format/js/deferred-import-evaluation/format.test.js index e68d54a52..59028d286 100644 --- a/tests/format/js/deferred-import-evaluation/format.test.js +++ b/tests/format/js/deferred-import-evaluation/format.test.js @@ -13,7 +13,8 @@ runFormatTest(import.meta, ["babel"], { meriyah: [...importDeferTests, ...invalidSyntaxTests], oxc: invalidSyntaxTests, "oxc-ts": invalidSyntaxTests, - yuku: ["dynamic-import-attributes-expression.js", ...invalidSyntaxTests], + yuku: invalidSyntaxTests, + "yuku-ts": invalidSyntaxTests, babel: invalidSyntaxTests, __babel_estree: invalidSyntaxTests, }, diff --git a/tests/format/js/destructuring-private-fields/format.test.js b/tests/format/js/destructuring-private-fields/format.test.js index f24a80b3b..513c28f7e 100644 --- a/tests/format/js/destructuring-private-fields/format.test.js +++ b/tests/format/js/destructuring-private-fields/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel", "babel-flow", "babel-ts"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/discard-binding/__snapshots__/format.test.js.snap b/tests/format/js/discard-binding/__snapshots__/format.test.js.snap index a08ec17c2..eabde3b39 100644 --- a/tests/format/js/discard-binding/__snapshots__/format.test.js.snap +++ b/tests/format/js/discard-binding/__snapshots__/format.test.js.snap @@ -191,6 +191,17 @@ exports[`array-pattern.js format[yuku] 1`] = ` 6 | // for-of destructuring binding" `; +exports[`array-pattern.js format[yuku-ts] 1`] = ` +"Unexpected token ',' (3:16) + 1 | { + 2 | // destructuring binding +> 3 | const [, void, ] = value; + | ^ + 4 | } + 5 | { + 6 | // for-of destructuring binding" +`; + exports[`basic.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -305,6 +316,15 @@ exports[`basic.js format[yuku] 1`] = ` 4 |" `; +exports[`basic.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (1:12) +> 1 | const [void] = [,void] = [void,] = []; + | ^ + 2 | + 3 | function f(void, { p: void }, [ void ]) {} + 4 |" +`; + exports[`discard-binding-arrow-params.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -389,6 +409,13 @@ exports[`discard-binding-arrow-params.js format[yuku] 1`] = ` 2 |" `; +exports[`discard-binding-arrow-params.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (1:2) +> 1 | (void) => {} + | ^^^^ + 2 |" +`; + exports[`discard-binding-assignment.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -473,6 +500,13 @@ exports[`discard-binding-assignment.js format[yuku] 1`] = ` 2 |" `; +exports[`discard-binding-assignment.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (1:7) +> 1 | ([void] = []); + | ^ + 2 |" +`; + exports[`discard-binding-async-arrow-params.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -557,6 +591,13 @@ exports[`discard-binding-async-arrow-params.js format[yuku] 1`] = ` 2 |" `; +exports[`discard-binding-async-arrow-params.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (1:8) +> 1 | async (void) => {} + | ^^^^ + 2 |" +`; + exports[`discard-binding-bindings.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -641,6 +682,13 @@ exports[`discard-binding-bindings.js format[yuku] 1`] = ` 2 |" `; +exports[`discard-binding-bindings.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (1:17) +> 1 | const { p: void } = {}; + | ^ + 2 |" +`; + exports[`discard-binding-for-await-using-binding.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -747,6 +795,15 @@ exports[`discard-binding-for-await-using-binding.js format[yuku] 1`] = ` 4 |" `; +exports[`discard-binding-for-await-using-binding.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (2:19) + 1 | async () => { +> 2 | for(await using void of []); + | ^^^^ + 3 | } + 4 |" +`; + exports[`discard-binding-for-bindings.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -831,6 +888,13 @@ exports[`discard-binding-for-bindings.js format[yuku] 1`] = ` 2 |" `; +exports[`discard-binding-for-bindings.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (1:21) +> 1 | for(const { p: void } of []); + | ^ + 2 |" +`; + exports[`discard-binding-for-lhs.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -915,6 +979,13 @@ exports[`discard-binding-for-lhs.js format[yuku] 1`] = ` 2 |" `; +exports[`discard-binding-for-lhs.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (1:15) +> 1 | for({ p: void } of []); + | ^ + 2 |" +`; + exports[`discard-binding-for-using-binding.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1017,6 +1088,15 @@ exports[`discard-binding-for-using-binding.js format[yuku] 1`] = ` 4 |" `; +exports[`discard-binding-for-using-binding.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (2:13) + 1 | { +> 2 | for(using void of []); + | ^^^^ + 3 | } + 4 |" +`; + exports[`function-parameter.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1177,6 +1257,17 @@ exports[`function-parameter.js format[yuku] 1`] = ` 6 | // arrow function parameter" `; +exports[`function-parameter.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (3:14) + 1 | { + 2 | // function parameter +> 3 | function f(void) {} + | ^^^^ + 4 | } + 5 | { + 6 | // arrow function parameter" +`; + exports[`object-pattern.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1386,6 +1477,17 @@ exports[`object-pattern.js format[yuku] 1`] = ` 6 | // for-of destructuring binding" `; +exports[`object-pattern.js format[yuku-ts] 1`] = ` +"Unexpected token '}' (3:22) + 1 | { + 2 | // destructuring binding +> 3 | const { void: void } = value; + | ^ + 4 | } + 5 | { + 6 | // for-of destructuring binding" +`; + exports[`unary-expression-void.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1538,6 +1640,17 @@ exports[`unary-expression-void.js format[yuku] 1`] = ` 7 | // pattern" `; +exports[`unary-expression-void.js format[yuku-ts] 1`] = ` +"Unexpected token ']' (4:10) + 2 | void [ + 3 | // pattern +> 4 | [ void ] = [{ + | ^ + 5 | // expr + 6 | [ void [] ]: + 7 | // pattern" +`; + exports[`using.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1659,6 +1772,16 @@ exports[`using.js format[yuku] 1`] = ` 5 | await using void = f();" `; +exports[`using.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (2:9) + 1 | { +> 2 | using void = f(); + | ^^^^ + 3 | } + 4 | async (void) => { + 5 | await using void = f();" +`; + exports[`using-variable-declarator.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1848,3 +1971,14 @@ exports[`using-variable-declarator.js format[yuku] 1`] = ` 5 | { 6 | // using 2 declarators" `; + +exports[`using-variable-declarator.js format[yuku-ts] 1`] = ` +"'void' is reserved and cannot be used as a binding identifier (3:9) + 1 | { + 2 | // using 1 declarator +> 3 | using void = f(); + | ^^^^ + 4 | } + 5 | { + 6 | // using 2 declarators" +`; diff --git a/tests/format/js/discard-binding/format.test.js b/tests/format/js/discard-binding/format.test.js index bf56b0c11..72fc94aee 100644 --- a/tests/format/js/discard-binding/format.test.js +++ b/tests/format/js/discard-binding/format.test.js @@ -8,6 +8,7 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, hermes: true, }, }); diff --git a/tests/format/js/do/format.test.js b/tests/format/js/do/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/do/format.test.js +++ b/tests/format/js/do/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/explicit-resource-management/__snapshots__/format.test.js.snap b/tests/format/js/explicit-resource-management/__snapshots__/format.test.js.snap index cb6ace946..435487272 100644 --- a/tests/format/js/explicit-resource-management/__snapshots__/format.test.js.snap +++ b/tests/format/js/explicit-resource-management/__snapshots__/format.test.js.snap @@ -245,6 +245,16 @@ exports[`valid-await-expr-using.js format[yuku] 1`] = ` 5 |" `; +exports[`valid-await-expr-using.js format[yuku-ts] 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found '+' (3:17) + 1 | async function f() { + 2 | await using[x]; +> 3 | await using.x + await using(x) ? await using?.x : await using\`x\`; + | ^ + 4 | } + 5 |" +`; + exports[`valid-await-expr-using-in.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -283,6 +293,15 @@ exports[`valid-await-expr-using-in.js format[yuku] 1`] = ` 4 |" `; +exports[`valid-await-expr-using-in.js format[yuku-ts] 1`] = ` +"'in' is reserved and cannot be used as a binding identifier (2:15) + 1 | async function f() { +> 2 | await using in foo; + | ^^ + 3 | } + 4 |" +`; + exports[`valid-await-expr-using-instanceof.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -321,6 +340,15 @@ exports[`valid-await-expr-using-instanceof.js format[yuku] 1`] = ` 4 |" `; +exports[`valid-await-expr-using-instanceof.js format[yuku-ts] 1`] = ` +"'instanceof' is reserved and cannot be used as a binding identifier (2:15) + 1 | async function f() { +> 2 | await using instanceof foo; + | ^^^^^^^^^^ + 3 | } + 4 |" +`; + exports[`valid-await-using-asi-assignment.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -798,6 +826,15 @@ exports[`valid-module-block-top-level-await-using-binding.js format[yuku] 1`] = 4 |" `; +exports[`valid-module-block-top-level-await-using-binding.js format[yuku-ts] 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found '{' (1:18) +> 1 | const m = module { + | ^ + 2 | await using foo = bar(); + 3 | } + 4 |" +`; + exports[`valid-module-block-top-level-using-binding.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -904,6 +941,15 @@ exports[`valid-module-block-top-level-using-binding.js format[yuku] 1`] = ` 4 |" `; +exports[`valid-module-block-top-level-using-binding.js format[yuku-ts] 1`] = ` +"Expected a semicolon or an implicit semicolon after a statement, but found '{' (1:8) +> 1 | module { + | ^ + 2 | using foo = bar(); + 3 | } + 4 |" +`; + exports[`valid-using-as-identifier-computed-member.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1001,6 +1047,15 @@ exports[`valid-using-as-identifier-for-in.js format[yuku] 1`] = ` 5 |" `; +exports[`valid-using-as-identifier-for-in.js format[yuku-ts] 1`] = ` +"Unexpected token '\`\`' in binding pattern (4:11) + 2 | for (using.foo in []); + 3 | for (using().foo in []); +> 4 | for (using\`\`.foo in []); + | ^^ + 5 |" +`; + exports[`valid-using-as-identifier-for-init.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1025,6 +1080,15 @@ exports[`valid-using-as-identifier-for-init.js format[yuku] 1`] = ` 4 |" `; +exports[`valid-using-as-identifier-for-init.js format[yuku-ts] 1`] = ` +"Unexpected token ';' in binding pattern (2:8) + 1 | for ( +> 2 | using; + | ^ + 3 | reader = getReader();); + 4 |" +`; + exports[`valid-using-as-identifier-for-of.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1053,6 +1117,15 @@ exports[`valid-using-as-identifier-for-of.js format[yuku] 1`] = ` 5 |" `; +exports[`valid-using-as-identifier-for-of.js format[yuku-ts] 1`] = ` +"Unexpected token '\`\`' in binding pattern (4:11) + 2 | for (using.foo of of); + 3 | for (using().foo of of); +> 4 | for (using\`\`.foo of of); + | ^^ + 5 |" +`; + exports[`valid-using-as-identifier-in.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -1083,6 +1156,13 @@ exports[`valid-using-as-identifier-in.js format[yuku] 1`] = ` 2 |" `; +exports[`valid-using-as-identifier-in.js format[yuku-ts] 1`] = ` +"'in' is reserved and cannot be used as a binding identifier (1:7) +> 1 | using in using instanceof using; + | ^^ + 2 |" +`; + exports[`valid-using-binding-basic.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/format/js/explicit-resource-management/format.test.js b/tests/format/js/explicit-resource-management/format.test.js index e6eb3596d..fb45c2034 100644 --- a/tests/format/js/explicit-resource-management/format.test.js +++ b/tests/format/js/explicit-resource-management/format.test.js @@ -107,5 +107,18 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], { "valid-using-as-identifier-for-of.js", "valid-using-as-identifier-in.js", ], + "yuku-ts": [ + // "invalid-duplicate-using-bindings.js", + // "invalid-script-top-level-using-binding.js", + "valid-module-block-top-level-using-binding.js", + "valid-module-block-top-level-await-using-binding.js", + "valid-await-expr-using-in.js", + "valid-await-expr-using-instanceof.js", + "valid-await-expr-using.js", + "valid-using-as-identifier-for-in.js", + "valid-using-as-identifier-for-init.js", + "valid-using-as-identifier-for-of.js", + "valid-using-as-identifier-in.js", + ], }, }); diff --git a/tests/format/js/export-default/escaped/format.test.js b/tests/format/js/export-default/escaped/format.test.js index 235b0635f..e602eac76 100644 --- a/tests/format/js/export-default/escaped/format.test.js +++ b/tests/format/js/export-default/escaped/format.test.js @@ -8,5 +8,6 @@ runFormatTest(import.meta, ["babel", "flow"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/export-default/export-default-from/format.test.js b/tests/format/js/export-default/export-default-from/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/export-default/export-default-from/format.test.js +++ b/tests/format/js/export-default/export-default-from/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/for/__snapshots__/format.test.js.snap b/tests/format/js/for/__snapshots__/format.test.js.snap index a03a15e6f..1624cd33c 100644 --- a/tests/format/js/for/__snapshots__/format.test.js.snap +++ b/tests/format/js/for/__snapshots__/format.test.js.snap @@ -928,6 +928,17 @@ exports[`for-in-with-initializer.js format[yuku] 1`] = ` 7 | for (var a = 1 || (() => b in c) in {});" `; +exports[`for-in-with-initializer.js format[yuku-ts] 1`] = ` +"Expected ';' after for-loop init, but found ')' (4:33) + 2 | + 3 | for (var a = (b in c) in {}); +> 4 | for (var a = 1 || (b in c) in {}); + | ^ + 5 | for (var a = 1 + (2 || (b in c)) in {}); + 6 | for (var a = (() => b in c) in {}); + 7 | for (var a = 1 || (() => b in c) in {});" +`; + exports[`in.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/format/js/for/format.test.js b/tests/format/js/for/format.test.js index 83397493d..4c80f19ed 100644 --- a/tests/format/js/for/format.test.js +++ b/tests/format/js/for/format.test.js @@ -3,5 +3,6 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], { flow: ["parentheses.js", "for-in-with-initializer.js"], typescript: ["parentheses.js", "for-in-with-initializer.js"], yuku: ["for-in-with-initializer.js"], + "yuku-ts": ["for-in-with-initializer.js"], }, }); diff --git a/tests/format/js/identifier/parentheses/__snapshots__/format.test.js.snap b/tests/format/js/identifier/parentheses/__snapshots__/format.test.js.snap index cb3366211..b20bf4868 100644 --- a/tests/format/js/identifier/parentheses/__snapshots__/format.test.js.snap +++ b/tests/format/js/identifier/parentheses/__snapshots__/format.test.js.snap @@ -252,15 +252,6 @@ a[1] + (let[2] = 2) ================================================================================ `; -exports[`let.js - {"semi":false} format[yuku] 1`] = ` -"Unexpected token '.' in binding pattern (1:4) -> 1 | let.a = 1; - | ^ - 2 | - 3 | let.a[0] = 1; - 4 |" -`; - exports[`let.js format 1`] = ` ====================================options===================================== parsers: ["babel", "typescript"] @@ -484,12 +475,3 @@ a[1] + (let[2] = 2); ================================================================================ `; - -exports[`let.js format[yuku] 1`] = ` -"Unexpected token '.' in binding pattern (1:4) -> 1 | let.a = 1; - | ^ - 2 | - 3 | let.a[0] = 1; - 4 |" -`; diff --git a/tests/format/js/identifier/parentheses/format.test.js b/tests/format/js/identifier/parentheses/format.test.js index 9c7fe1d55..ed93e5ed0 100644 --- a/tests/format/js/identifier/parentheses/format.test.js +++ b/tests/format/js/identifier/parentheses/format.test.js @@ -1,14 +1,8 @@ -const errors = { yuku: ["let.js"] }; - -runFormatTest( - import.meta, - [ - "babel", - // "flow", - "typescript", - ], - { errors }, -); +runFormatTest(import.meta, [ + "babel", + // "flow", + "typescript", +]); runFormatTest( import.meta, [ @@ -16,5 +10,5 @@ runFormatTest( // "flow", "typescript", ], - { semi: false, errors }, + { semi: false }, ); diff --git a/tests/format/js/module-blocks/format.test.js b/tests/format/js/module-blocks/format.test.js index 4e7e87e56..7e6b04900 100644 --- a/tests/format/js/module-blocks/format.test.js +++ b/tests/format/js/module-blocks/format.test.js @@ -5,6 +5,7 @@ const errors = { oxc: ["module-blocks.js", "range.js", "comments.js"], "oxc-ts": ["module-blocks.js", "range.js", "comments.js"], yuku: ["module-blocks.js", "range.js", "comments.js"], + "yuku-ts": ["module-blocks.js", "range.js", "comments.js"], }; runFormatTest(import.meta, ["babel"], { errors }); diff --git a/tests/format/js/module-blocks/quote-props/format.test.js b/tests/format/js/module-blocks/quote-props/format.test.js index d801b8e10..94bc022b4 100644 --- a/tests/format/js/module-blocks/quote-props/format.test.js +++ b/tests/format/js/module-blocks/quote-props/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: ["worker.js"], "oxc-ts": ["worker.js"], yuku: ["worker.js"], + "yuku-ts": ["worker.js"], }, }); diff --git a/tests/format/js/multiparser-invalid/__snapshots__/format.test.js.snap b/tests/format/js/multiparser-invalid/__snapshots__/format.test.js.snap index c2dd4af4f..c061bc601 100644 --- a/tests/format/js/multiparser-invalid/__snapshots__/format.test.js.snap +++ b/tests/format/js/multiparser-invalid/__snapshots__/format.test.js.snap @@ -177,3 +177,14 @@ exports[`text.js format[yuku] 1`] = ` 8 | 9 | foo = foo\`\\u{prettier}\${foo}pr\\u{0065}ttier\`;" `; + +exports[`text.js format[yuku-ts] 1`] = ` +"Bad escape sequence in untagged template literal (6:18) + 4 | foo = markdown\`\\u{prettier}\\u{0065}\`; + 5 | foo = css\`\\u{prettier}\\u{0065}\`; +> 6 | foo = /* HTML */\`\\u{prettier}\\u{0065}\`; + | ^^^^^^^^^^^^^^^^^^^^ + 7 | foo = /* GraphQL */\`\\u{prettier}\\u{0065}\`; + 8 | + 9 | foo = foo\`\\u{prettier}\${foo}pr\\u{0065}ttier\`;" +`; diff --git a/tests/format/js/multiparser-invalid/format.test.js b/tests/format/js/multiparser-invalid/format.test.js index 8b61b8bb5..1f4a95096 100644 --- a/tests/format/js/multiparser-invalid/format.test.js +++ b/tests/format/js/multiparser-invalid/format.test.js @@ -9,5 +9,6 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/no-semi-babylon-extensions/format.test.js b/tests/format/js/no-semi-babylon-extensions/format.test.js index afc2ac877..38b78f671 100644 --- a/tests/format/js/no-semi-babylon-extensions/format.test.js +++ b/tests/format/js/no-semi-babylon-extensions/format.test.js @@ -5,6 +5,7 @@ const errors = { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }; runFormatTest(import.meta, ["babel"], { errors }); runFormatTest(import.meta, ["babel"], { semi: false, errors }); diff --git a/tests/format/js/objects/__snapshots__/format.test.js.snap b/tests/format/js/objects/__snapshots__/format.test.js.snap index aba2b8696..1dfa72c85 100644 --- a/tests/format/js/objects/__snapshots__/format.test.js.snap +++ b/tests/format/js/objects/__snapshots__/format.test.js.snap @@ -234,6 +234,17 @@ exports[`expression.js format[yuku] 1`] = ` 8 | ({} = 0);" `; +exports[`expression.js format[yuku-ts] 1`] = ` +"Expected ',' or ')' in parenthesized expression, but found ':' (5:4) + 3 | a = () => ({}).x; + 4 | ({} && a, b); +> 5 | ({}::b, 0); + | ^ + 6 | ({}::b()\`\`[''].c++ && 0 ? 0 : 0, 0); + 7 | ({}(), 0); + 8 | ({} = 0);" +`; + exports[`getter-setter.js format 1`] = ` ====================================options===================================== parsers: ["babel", "typescript", "flow"] diff --git a/tests/format/js/objects/format.test.js b/tests/format/js/objects/format.test.js index 75ee1c077..9c94a4ead 100644 --- a/tests/format/js/objects/format.test.js +++ b/tests/format/js/objects/format.test.js @@ -7,6 +7,7 @@ runFormatTest(import.meta, ["babel", "typescript", "flow"], { oxc: ["expression.js"], "oxc-ts": ["expression.js"], yuku: ["expression.js"], + "yuku-ts": ["expression.js"], flow: ["expression.js"], hermes: ["expression.js"], }, diff --git a/tests/format/js/optional-chaining-assignment/__snapshots__/format.test.js.snap b/tests/format/js/optional-chaining-assignment/__snapshots__/format.test.js.snap index 29d6ef3ed..37030e1c3 100644 --- a/tests/format/js/optional-chaining-assignment/__snapshots__/format.test.js.snap +++ b/tests/format/js/optional-chaining-assignment/__snapshots__/format.test.js.snap @@ -591,9 +591,9 @@ exports[`valid-complex-case.js format[oxc] 1`] = ` `; exports[`valid-complex-case.js format[yuku] 1`] = ` -"Unexpected token '?.' in binding pattern (1:4) +"Optional chaining is not allowed in assignment pattern (1:1) > 1 | let?.()[a] =1; - | ^^ + | ^^^^^^^^^^ 2 | let?.[a] = 1; 3 |" `; diff --git a/tests/format/js/optional-chaining-assignment/format.test.js b/tests/format/js/optional-chaining-assignment/format.test.js index 99ed28cc5..1ecd0997e 100644 --- a/tests/format/js/optional-chaining-assignment/format.test.js +++ b/tests/format/js/optional-chaining-assignment/format.test.js @@ -34,6 +34,7 @@ runFormatTest(import.meta, ["babel"], { oxc: [...optionalChainingAssignTests, ...invalidSyntaxTests], "oxc-ts": [...optionalChainingAssignTests, ...invalidSyntaxTests], yuku: [...optionalChainingAssignTests, ...invalidSyntaxTests], + "yuku-ts": [...optionalChainingAssignTests, ...invalidSyntaxTests], babel: invalidSyntaxTests, __babel_estree: invalidSyntaxTests, }, diff --git a/tests/format/js/partial-application/format.test.js b/tests/format/js/partial-application/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/partial-application/format.test.js +++ b/tests/format/js/partial-application/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/pipeline-operator/format.test.js b/tests/format/js/pipeline-operator/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/pipeline-operator/format.test.js +++ b/tests/format/js/pipeline-operator/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/reserved-word/__snapshots__/format.test.js.snap b/tests/format/js/reserved-word/__snapshots__/format.test.js.snap index 423a01de2..e8a803171 100644 --- a/tests/format/js/reserved-word/__snapshots__/format.test.js.snap +++ b/tests/format/js/reserved-word/__snapshots__/format.test.js.snap @@ -50,16 +50,6 @@ var let = "foo"; ================================================================================ `; -exports[`let.js format[yuku] 1`] = ` -"Unexpected token '.' in binding pattern (2:4) - 1 | foo.let; -> 2 | let.foo; - | ^ - 3 | new let(); - 4 | ({ let: "foo" }); - 5 | (let, "foo");" -`; - exports[`yield.js format 1`] = ` ====================================options===================================== parsers: ["acorn", "espree", "meriyah", "babel"] diff --git a/tests/format/js/reserved-word/format.test.js b/tests/format/js/reserved-word/format.test.js index ae904d11b..0592a869d 100644 --- a/tests/format/js/reserved-word/format.test.js +++ b/tests/format/js/reserved-word/format.test.js @@ -1,3 +1 @@ -runFormatTest(import.meta, ["acorn", "espree", "meriyah", "babel"], { - errors: { yuku: ["let.js"] }, -}); +runFormatTest(import.meta, ["acorn", "espree", "meriyah", "babel"]); diff --git a/tests/format/js/source-phase-imports/__snapshots__/format.test.js.snap b/tests/format/js/source-phase-imports/__snapshots__/format.test.js.snap index 59a657f59..a324a2ff2 100644 --- a/tests/format/js/source-phase-imports/__snapshots__/format.test.js.snap +++ b/tests/format/js/source-phase-imports/__snapshots__/format.test.js.snap @@ -124,13 +124,6 @@ exports[`import-source-attributes-expression.js format[meriyah] 1`] = ` Cause: [1:7-1:13]: The only valid meta property for import is 'import.meta'" `; -exports[`import-source-attributes-expression.js format[yuku] 1`] = ` -"Expected ')' after import(), but found ',' (1:18) -> 1 | import.source("x", { with: { attr: "val" } }); - | ^ - 2 |" -`; - exports[`import-source-binding-from.js format 1`] = ` ====================================options===================================== parsers: ["babel"] diff --git a/tests/format/js/source-phase-imports/format.test.js b/tests/format/js/source-phase-imports/format.test.js index 13757ad5a..d43695852 100644 --- a/tests/format/js/source-phase-imports/format.test.js +++ b/tests/format/js/source-phase-imports/format.test.js @@ -15,11 +15,8 @@ runFormatTest(import.meta, ["babel"], { meriyah: [...importSourceTests, ...invalidSyntaxTests], oxc: invalidSyntaxTests, "oxc-ts": invalidSyntaxTests, - yuku: [ - "import-source-attributes-expression.js", - "import-source-binding-from.js", - ...invalidSyntaxTests, - ], + yuku: ["import-source-binding-from.js", ...invalidSyntaxTests], + "yuku-ts": ["import-source-binding-from.js", ...invalidSyntaxTests], babel: invalidSyntaxTests, __babel_estree: invalidSyntaxTests, }, diff --git a/tests/format/js/throw_expressions/format.test.js b/tests/format/js/throw_expressions/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/throw_expressions/format.test.js +++ b/tests/format/js/throw_expressions/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/js/v8_intrinsic/format.test.js b/tests/format/js/v8_intrinsic/format.test.js index 524093664..4bcd4a294 100644 --- a/tests/format/js/v8_intrinsic/format.test.js +++ b/tests/format/js/v8_intrinsic/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["babel"], { oxc: true, "oxc-ts": true, yuku: true, + "yuku-ts": true, }, }); diff --git a/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/format.test.js.snap b/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/format.test.js.snap index 98018ce38..ab6609356 100644 --- a/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/format.test.js.snap @@ -548,3 +548,12 @@ exports[`readonlyReadonly.ts format[oxc-ts] 1`] = ` 3 | constructor(readonly readonly y: number) {} 4 | }" `; + +exports[`readonlyReadonly.ts format[yuku-ts] 1`] = ` +"Expected ';' after class field, but found 'x' (2:23) + 1 | class C { +> 2 | readonly readonly x: number; + | ^ + 3 | constructor(readonly readonly y: number) {} + 4 | }" +`; diff --git a/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/format.test.js b/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/format.test.js index 401e6bec2..48719702e 100644 --- a/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/format.test.js +++ b/tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/format.test.js @@ -6,5 +6,6 @@ runFormatTest(import.meta, ["typescript"], { "constructorOverloadsWithDefaultValues.ts", ], "oxc-ts": ["readonlyInConstructorParameters.ts", "readonlyReadonly.ts"], + "yuku-ts": ["readonlyReadonly.ts"], }, }); diff --git a/tests/format/typescript/conformance/types/functions/__snapshots__/format.test.js.snap b/tests/format/typescript/conformance/types/functions/__snapshots__/format.test.js.snap index 83585e98a..4b58c7246 100644 --- a/tests/format/typescript/conformance/types/functions/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/conformance/types/functions/__snapshots__/format.test.js.snap @@ -638,6 +638,16 @@ exports[`functionOverloadErrorsSyntax.ts format[oxc-ts] 1`] = ` 11 |" `; +exports[`functionOverloadErrorsSyntax.ts format[yuku-ts] 1`] = ` +"Rest parameter must be the last parameter (9:25) + 7 | + 8 | //Function overload signature with rest param followed by non-optional parameter +> 9 | function fn5(x: string, ...y: any[], z: string); + | ^^^^^^^^^^^^ + 10 | function fn5() { } + 11 |" +`; + exports[`functionTypeTypeParameters.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/format/typescript/conformance/types/functions/format.test.js b/tests/format/typescript/conformance/types/functions/format.test.js index 3d703a140..78cc0ec84 100644 --- a/tests/format/typescript/conformance/types/functions/format.test.js +++ b/tests/format/typescript/conformance/types/functions/format.test.js @@ -2,5 +2,6 @@ runFormatTest(import.meta, ["typescript"], { errors: { "babel-ts": ["functionOverloadErrorsSyntax.ts"], "oxc-ts": ["functionOverloadErrorsSyntax.ts"], + "yuku-ts": ["functionOverloadErrorsSyntax.ts"], }, }); diff --git a/tests/format/typescript/error-recovery/__snapshots__/format.test.js.snap b/tests/format/typescript/error-recovery/__snapshots__/format.test.js.snap index ecd524ec6..e21e8d236 100644 --- a/tests/format/typescript/error-recovery/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/error-recovery/__snapshots__/format.test.js.snap @@ -83,6 +83,15 @@ exports[`index-signature.ts - {"trailingComma":"all"} format[oxc-ts] 1`] = ` 4 | [a: string, b: string]: string;" `; +exports[`index-signature.ts - {"trailingComma":"all"} format[yuku-ts] 1`] = ` +"Expected ':' after index signature parameters, but found '}' (1:26) +> 1 | type A = { [key: string] }; + | ^ + 2 | + 3 | type TwoParams = { + 4 | [a: string, b: string]: string;" +`; + exports[`index-signature.ts - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -166,6 +175,15 @@ exports[`index-signature.ts - {"trailingComma":"es5"} format[oxc-ts] 1`] = ` 4 | [a: string, b: string]: string;" `; +exports[`index-signature.ts - {"trailingComma":"es5"} format[yuku-ts] 1`] = ` +"Expected ':' after index signature parameters, but found '}' (1:26) +> 1 | type A = { [key: string] }; + | ^ + 2 | + 3 | type TwoParams = { + 4 | [a: string, b: string]: string;" +`; + exports[`index-signature.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -248,6 +266,15 @@ exports[`index-signature.ts format[oxc-ts] 1`] = ` 4 | [a: string, b: string]: string;" `; +exports[`index-signature.ts format[yuku-ts] 1`] = ` +"Expected ':' after index signature parameters, but found '}' (1:26) +> 1 | type A = { [key: string] }; + | ^ + 2 | + 3 | type TwoParams = { + 4 | [a: string, b: string]: string;" +`; + exports[`jsdoc_only_types.ts - {"trailingComma":"all"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -295,6 +322,15 @@ exports[`jsdoc_only_types.ts - {"trailingComma":"all"} format[oxc-ts] 1`] = ` 4 | let d: string?;" `; +exports[`jsdoc_only_types.ts - {"trailingComma":"all"} format[yuku-ts] 1`] = ` +"Expected a type, but found '*' (1:8) +> 1 | let a: *; + | ^ + 2 | function b(x: ?) {} + 3 | let c: ?string; + 4 | let d: string?;" +`; + exports[`jsdoc_only_types.ts - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -342,6 +378,15 @@ exports[`jsdoc_only_types.ts - {"trailingComma":"es5"} format[oxc-ts] 1`] = ` 4 | let d: string?;" `; +exports[`jsdoc_only_types.ts - {"trailingComma":"es5"} format[yuku-ts] 1`] = ` +"Expected a type, but found '*' (1:8) +> 1 | let a: *; + | ^ + 2 | function b(x: ?) {} + 3 | let c: ?string; + 4 | let d: string?;" +`; + exports[`jsdoc_only_types.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -387,3 +432,12 @@ exports[`jsdoc_only_types.ts format[oxc-ts] 1`] = ` 3 | let c: ?string; 4 | let d: string?;" `; + +exports[`jsdoc_only_types.ts format[yuku-ts] 1`] = ` +"Expected a type, but found '*' (1:8) +> 1 | let a: *; + | ^ + 2 | function b(x: ?) {} + 3 | let c: ?string; + 4 | let d: string?;" +`; diff --git a/tests/format/typescript/error-recovery/format.test.js b/tests/format/typescript/error-recovery/format.test.js index 6af9f8211..4d4e54d90 100644 --- a/tests/format/typescript/error-recovery/format.test.js +++ b/tests/format/typescript/error-recovery/format.test.js @@ -1,6 +1,7 @@ const errors = { "babel-ts": ["jsdoc_only_types.ts", "index-signature.ts"], "oxc-ts": ["jsdoc_only_types.ts", "index-signature.ts"], + "yuku-ts": ["jsdoc_only_types.ts", "index-signature.ts"], }; runFormatTest(import.meta, ["typescript"], { errors }); runFormatTest(import.meta, ["typescript"], { trailingComma: "es5", errors }); diff --git a/tests/format/typescript/trailing-comma/__snapshots__/format.test.js.snap b/tests/format/typescript/trailing-comma/__snapshots__/format.test.js.snap index 6309f18d6..a066069ed 100644 --- a/tests/format/typescript/trailing-comma/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/trailing-comma/__snapshots__/format.test.js.snap @@ -60,6 +60,129 @@ const f2 = < ================================================================================ `; +exports[`invalid.ts - {"trailingComma":"all"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +trailingComma: "all" + printWidth: 80 (default) | +=====================================input====================================== +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest, +} = something; + +=====================================output===================================== +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest +} = something; + +================================================================================ +`; + +exports[`invalid.ts - {"trailingComma":"all"} format[yuku-ts] 1`] = ` +"Rest element cannot have a trailing comma in object destructuring. (1:7) +> 1 | const { + | ^ +> 2 | longKeySoThisWillGoOnMultipleLines, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 3 | longKeySoThisWillGoOnMultipleLines2, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 4 | longKeySoThisWillGoOnMultipleLines3, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 5 | ...rest, + | ^^^^^^^^^^ +> 6 | } = something; + | ^ + 7 |" +`; + +exports[`invalid.ts - {"trailingComma":"es5"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +trailingComma: "es5" + printWidth: 80 (default) | +=====================================input====================================== +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest, +} = something; + +=====================================output===================================== +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest +} = something; + +================================================================================ +`; + +exports[`invalid.ts - {"trailingComma":"es5"} format[yuku-ts] 1`] = ` +"Rest element cannot have a trailing comma in object destructuring. (1:7) +> 1 | const { + | ^ +> 2 | longKeySoThisWillGoOnMultipleLines, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 3 | longKeySoThisWillGoOnMultipleLines2, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 4 | longKeySoThisWillGoOnMultipleLines3, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 5 | ...rest, + | ^^^^^^^^^^ +> 6 | } = something; + | ^ + 7 |" +`; + +exports[`invalid.ts - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +trailingComma: "none" + printWidth: 80 (default) | +=====================================input====================================== +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest, +} = something; + +=====================================output===================================== +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest +} = something; + +================================================================================ +`; + +exports[`invalid.ts - {"trailingComma":"none"} format[yuku-ts] 1`] = ` +"Rest element cannot have a trailing comma in object destructuring. (1:7) +> 1 | const { + | ^ +> 2 | longKeySoThisWillGoOnMultipleLines, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 3 | longKeySoThisWillGoOnMultipleLines2, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 4 | longKeySoThisWillGoOnMultipleLines3, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> 5 | ...rest, + | ^^^^^^^^^^ +> 6 | } = something; + | ^ + 7 |" +`; + exports[`trailing.ts - {"trailingComma":"all"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -80,7 +203,7 @@ const { longKeySoThisWillGoOnMultipleLines, longKeySoThisWillGoOnMultipleLines2, longKeySoThisWillGoOnMultipleLines3, - ...rest, + ...rest } = something; =====================================output===================================== @@ -123,7 +246,7 @@ const { longKeySoThisWillGoOnMultipleLines, longKeySoThisWillGoOnMultipleLines2, longKeySoThisWillGoOnMultipleLines3, - ...rest, + ...rest } = something; =====================================output===================================== @@ -166,7 +289,7 @@ const { longKeySoThisWillGoOnMultipleLines, longKeySoThisWillGoOnMultipleLines2, longKeySoThisWillGoOnMultipleLines3, - ...rest, + ...rest } = something; =====================================output===================================== diff --git a/tests/format/typescript/trailing-comma/format.test.js b/tests/format/typescript/trailing-comma/format.test.js index 255526bea..be76b6919 100644 --- a/tests/format/typescript/trailing-comma/format.test.js +++ b/tests/format/typescript/trailing-comma/format.test.js @@ -1,3 +1,5 @@ -runFormatTest(import.meta, ["typescript"], { trailingComma: "all" }); -runFormatTest(import.meta, ["typescript"], { trailingComma: "es5" }); -runFormatTest(import.meta, ["typescript"], { trailingComma: "none" }); +const errors = { "yuku-ts": ["invalid.ts"] }; + +runFormatTest(import.meta, ["typescript"], { trailingComma: "all", errors }); +runFormatTest(import.meta, ["typescript"], { trailingComma: "es5", errors }); +runFormatTest(import.meta, ["typescript"], { trailingComma: "none", errors }); diff --git a/tests/format/typescript/trailing-comma/invalid.ts b/tests/format/typescript/trailing-comma/invalid.ts new file mode 100644 index 000000000..2495b213b --- /dev/null +++ b/tests/format/typescript/trailing-comma/invalid.ts @@ -0,0 +1,6 @@ +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest, +} = something; diff --git a/tests/format/typescript/trailing-comma/trailing.ts b/tests/format/typescript/trailing-comma/trailing.ts index 11c7202b5..7fa2f6f4e 100644 --- a/tests/format/typescript/trailing-comma/trailing.ts +++ b/tests/format/typescript/trailing-comma/trailing.ts @@ -12,5 +12,5 @@ const { longKeySoThisWillGoOnMultipleLines, longKeySoThisWillGoOnMultipleLines2, longKeySoThisWillGoOnMultipleLines3, - ...rest, + ...rest } = something; diff --git a/tests/format/typescript/type-parameters-arguments/__snapshots__/format.test.js.snap b/tests/format/typescript/type-parameters-arguments/__snapshots__/format.test.js.snap index 33ee49f43..287885d49 100644 --- a/tests/format/typescript/type-parameters-arguments/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/type-parameters-arguments/__snapshots__/format.test.js.snap @@ -565,6 +565,17 @@ exports[`const.ts format[oxc-ts] 1`] = ` 25 | interface L {}" `; +exports[`const.ts format[yuku-ts] 1`] = ` +"Type parameter modifiers must appear in the order 'const in out' (14:12) + 12 | class B {} + 13 | class C {} +> 14 | class D {} + | ^^^^^ + 15 | class E {} + 16 | (class {}); + 17 | (class {});" +`; + exports[`constraints-and-default.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/format/typescript/type-parameters-arguments/format.test.js b/tests/format/typescript/type-parameters-arguments/format.test.js index a45fa2208..aedb656f8 100644 --- a/tests/format/typescript/type-parameters-arguments/format.test.js +++ b/tests/format/typescript/type-parameters-arguments/format.test.js @@ -1,5 +1,6 @@ runFormatTest(import.meta, ["typescript"], { errors: { "oxc-ts": ["const.ts"], + "yuku-ts": ["const.ts"], }, }); diff --git a/tests/unit/builtin-plugins.js b/tests/unit/builtin-plugins.js index 9d8b0c511..cda71f16c 100644 --- a/tests/unit/builtin-plugins.js +++ b/tests/unit/builtin-plugins.js @@ -49,6 +49,7 @@ test("builtin parsers", async () => { "vue", "yaml", "yuku", + "yuku-ts", ] `); }); diff --git a/website/playground/codeSamples.mjs b/website/playground/codeSamples.mjs index 28404c6b5..d1e8bc7d3 100644 --- a/website/playground/codeSamples.mjs +++ b/website/playground/codeSamples.mjs @@ -45,6 +45,7 @@ export default function getCodeSamples(parser) { case "typescript": case "babel-ts": case "oxc-ts": + case "yuku-ts": return [ "interface MyInterface {", " foo(): string,", diff --git a/website/playground/panel/language.js b/website/playground/panel/language.js index d05fe55a7..a2cda67e5 100644 --- a/website/playground/panel/language.js +++ b/website/playground/panel/language.js @@ -27,6 +27,7 @@ function getCodemirrorMode(parser) { case "typescript": case "hermes": case "oxc-ts": + case "yuku-ts": return "TSX"; case "css": diff --git a/yarn.lock b/yarn.lock index 572e479ba..7642f3d5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3042,89 +3042,89 @@ __metadata: languageName: node linkType: hard -"@yuku-parser/binding-darwin-arm64@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-darwin-arm64@npm:0.6.2" +"@yuku-parser/binding-darwin-arm64@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-darwin-arm64@npm:0.6.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@yuku-parser/binding-darwin-x64@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-darwin-x64@npm:0.6.2" +"@yuku-parser/binding-darwin-x64@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-darwin-x64@npm:0.6.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@yuku-parser/binding-freebsd-x64@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-freebsd-x64@npm:0.6.2" +"@yuku-parser/binding-freebsd-x64@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-freebsd-x64@npm:0.6.3" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@yuku-parser/binding-linux-arm-gnu@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-linux-arm-gnu@npm:0.6.2" +"@yuku-parser/binding-linux-arm-gnu@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-linux-arm-gnu@npm:0.6.3" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@yuku-parser/binding-linux-arm-musl@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-linux-arm-musl@npm:0.6.2" +"@yuku-parser/binding-linux-arm-musl@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-linux-arm-musl@npm:0.6.3" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@yuku-parser/binding-linux-arm64-gnu@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-linux-arm64-gnu@npm:0.6.2" +"@yuku-parser/binding-linux-arm64-gnu@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-linux-arm64-gnu@npm:0.6.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@yuku-parser/binding-linux-arm64-musl@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-linux-arm64-musl@npm:0.6.2" +"@yuku-parser/binding-linux-arm64-musl@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-linux-arm64-musl@npm:0.6.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@yuku-parser/binding-linux-x64-gnu@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-linux-x64-gnu@npm:0.6.2" +"@yuku-parser/binding-linux-x64-gnu@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-linux-x64-gnu@npm:0.6.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@yuku-parser/binding-linux-x64-musl@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-linux-x64-musl@npm:0.6.2" +"@yuku-parser/binding-linux-x64-musl@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-linux-x64-musl@npm:0.6.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@yuku-parser/binding-win32-arm64@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-win32-arm64@npm:0.6.2" +"@yuku-parser/binding-win32-arm64@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-win32-arm64@npm:0.6.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@yuku-parser/binding-win32-x64@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/binding-win32-x64@npm:0.6.2" +"@yuku-parser/binding-win32-x64@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/binding-win32-x64@npm:0.6.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@yuku-parser/wasm@npm:0.6.2": - version: 0.6.2 - resolution: "@yuku-parser/wasm@npm:0.6.2" +"@yuku-parser/wasm@npm:0.6.3": + version: 0.6.3 + resolution: "@yuku-parser/wasm@npm:0.6.3" dependencies: "@yuku-toolchain/types": "npm:0.5.43" - checksum: 10/95b8aed6a90feb7da5fe7697d68877630306fc5656270d4f47ed739e1cb7ed85a165d0aaa7efd89e6c77fb1339689744281149afa97e663b4ff3a05acd33f2fa + checksum: 10/56205ac50ea77f11472b17b37dd9fed904ec8dfa4b9da598243c4727c34fc07855c675cc33b59117559ef422e14e5039f66b3f49aa89e2de39766e460443cdfd languageName: node linkType: hard @@ -3518,18 +3518,18 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:4.28.5, browserslist@npm:^4.24.0, browserslist@npm:^4.25.2, browserslist@npm:^4.28.1, browserslist@npm:^4.28.4": - version: 4.28.5 - resolution: "browserslist@npm:4.28.5" +"browserslist@npm:4.28.6, browserslist@npm:^4.24.0, browserslist@npm:^4.25.2, browserslist@npm:^4.28.1, browserslist@npm:^4.28.4": + version: 4.28.6 + resolution: "browserslist@npm:4.28.6" dependencies: baseline-browser-mapping: "npm:^2.10.42" - caniuse-lite: "npm:^1.0.30001800" - electron-to-chromium: "npm:^1.5.387" - node-releases: "npm:^2.0.50" + caniuse-lite: "npm:^1.0.30001803" + electron-to-chromium: "npm:^1.5.389" + node-releases: "npm:^2.0.51" update-browserslist-db: "npm:^1.2.3" bin: browserslist: cli.js - checksum: 10/40f5f3b160e003b86cf16d906029a274990dc3b6b824f913c141a11ace1f9664204f2d1e8388e5ddf0233b4759c5a171a5bb3f55256f72c9f0ca6ebba58fcc9a + checksum: 10/04c8c3ec37e067aa1773d21d9603b434cc10d3dee6a89f62bd05d3a7d60b30ddbca8f371f53735e5b798a82db0e0131bc78dea9c58b11affb9ce5675c9d8b67b languageName: node linkType: hard @@ -3642,10 +3642,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001800": - version: 1.0.30001802 - resolution: "caniuse-lite@npm:1.0.30001802" - checksum: 10/496fd430cf348fb175a794a641a525a7ecf332f7118133ba2faacc820f556f8e8a314aec7f422e0636ffc346525e33e3bf1ba520c3898ed70c380e41d00e534f +"caniuse-lite@npm:^1.0.30001803": + version: 1.0.30001805 + resolution: "caniuse-lite@npm:1.0.30001805" + checksum: 10/2ce6f5d200846218e136a89a40a071d1b976fe5cfc3fbc01acb73db02839d9bf7370b88efb23295823bb6c2355772b52469121ef987f85062165a4ec5859fdca languageName: node linkType: hard @@ -4287,10 +4287,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.387": - version: 1.5.387 - resolution: "electron-to-chromium@npm:1.5.387" - checksum: 10/987c002c3a8e08b33977ae4130c7a67a7047c69120b1240cbaedd0a2b72e9a67d32c52d2644b521092dbb2ce058129690f77fd376e58d895cdba12a9eddea689 +"electron-to-chromium@npm:^1.5.389": + version: 1.5.391 + resolution: "electron-to-chromium@npm:1.5.391" + checksum: 10/5fce9a850b5a7a382fa232ee7706b4b52c0c6d7a76299f3a045419920b6cec06e2cb7428857edcf1f1294bc569c32ff5704ce5c3619752ca1bf4d25c34899679 languageName: node linkType: hard @@ -7582,10 +7582,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.50": - version: 2.0.50 - resolution: "node-releases@npm:2.0.50" - checksum: 10/c40306176fc9d43d27b919034fab57ab0753448dfcabeb1ae669128d28f595fba4c329a269b2d7fa9bb7d5a6d2bda8b2bd8fe5e8446226bb809f448fec2e80fb +"node-releases@npm:^2.0.51": + version: 2.0.51 + resolution: "node-releases@npm:2.0.51" + checksum: 10/9d08dbc740bb2fa40b2234108dd9dec333d76b8dd22435ab10c9b1c7d8813885449ba36033b5303158d1ff8f66cc8db2d35a74eef42f4f65f540790cd377584b languageName: node linkType: hard @@ -8302,13 +8302,13 @@ __metadata: "@typescript-eslint/parser": "npm:8.64.0" "@typescript-eslint/typescript-estree": "npm:8.64.0" "@typescript-eslint/visitor-keys": "npm:8.64.0" - "@yuku-parser/wasm": "npm:0.6.2" + "@yuku-parser/wasm": "npm:0.6.3" acorn: "npm:8.17.0" acorn-jsx: "npm:5.3.2" angular-estree-parser: "npm:15.5.0" angular-html-parser: "npm:10.11.0" base64-arraybuffer-es6: "npm:3.1.0" - browserslist: "npm:4.28.5" + browserslist: "npm:4.28.6" browserslist-to-esbuild: "npm:2.1.1" buffer: "npm:6.0.3" c8: "npm:11.0.0" @@ -8433,7 +8433,7 @@ __metadata: yaml: "npm:2.9.0" yaml-test-suite: "npm:0.1.0" yaml-unist-parser: "npm:3.2.0" - yuku-parser: "npm:0.6.2" + yuku-parser: "npm:0.6.3" bin: prettier: ./bin/prettier.cjs languageName: unknown @@ -10188,21 +10188,21 @@ __metadata: languageName: node linkType: hard -"yuku-parser@npm:0.6.2": - version: 0.6.2 - resolution: "yuku-parser@npm:0.6.2" +"yuku-parser@npm:0.6.3": + version: 0.6.3 + resolution: "yuku-parser@npm:0.6.3" dependencies: - "@yuku-parser/binding-darwin-arm64": "npm:0.6.2" - "@yuku-parser/binding-darwin-x64": "npm:0.6.2" - "@yuku-parser/binding-freebsd-x64": "npm:0.6.2" - "@yuku-parser/binding-linux-arm-gnu": "npm:0.6.2" - "@yuku-parser/binding-linux-arm-musl": "npm:0.6.2" - "@yuku-parser/binding-linux-arm64-gnu": "npm:0.6.2" - "@yuku-parser/binding-linux-arm64-musl": "npm:0.6.2" - "@yuku-parser/binding-linux-x64-gnu": "npm:0.6.2" - "@yuku-parser/binding-linux-x64-musl": "npm:0.6.2" - "@yuku-parser/binding-win32-arm64": "npm:0.6.2" - "@yuku-parser/binding-win32-x64": "npm:0.6.2" + "@yuku-parser/binding-darwin-arm64": "npm:0.6.3" + "@yuku-parser/binding-darwin-x64": "npm:0.6.3" + "@yuku-parser/binding-freebsd-x64": "npm:0.6.3" + "@yuku-parser/binding-linux-arm-gnu": "npm:0.6.3" + "@yuku-parser/binding-linux-arm-musl": "npm:0.6.3" + "@yuku-parser/binding-linux-arm64-gnu": "npm:0.6.3" + "@yuku-parser/binding-linux-arm64-musl": "npm:0.6.3" + "@yuku-parser/binding-linux-x64-gnu": "npm:0.6.3" + "@yuku-parser/binding-linux-x64-musl": "npm:0.6.3" + "@yuku-parser/binding-win32-arm64": "npm:0.6.3" + "@yuku-parser/binding-win32-x64": "npm:0.6.3" "@yuku-toolchain/types": "npm:0.5.43" dependenciesMeta: "@yuku-parser/binding-darwin-arm64": @@ -10227,7 +10227,7 @@ __metadata: optional: true "@yuku-parser/binding-win32-x64": optional: true - checksum: 10/331c1cc68f4aed45cb7c914c12693b42cb5a2bfbd9f20663a1fa00bf6d2991e85982b0fcd5c7dc6c5077ce3d9b6a32c102155d85797e874d89b753182310bb1a + checksum: 10/a927674aa6a8791e4ab4ba899507b28ae89becbd16b5aa3e83b8baac4d25b79e3501a6e1491f9e7ab82118469ea838dad9ce6cee05a10e6a728133796cf184aa languageName: node linkType: hard