Last 12 weeks · 7 commits
2 of 6 standards met
Repository: sveltejs/acorn-typescript. Description: Acorn plugin that parses TypeScript Stars: 45, Forks: 10. Primary language: TypeScript. Languages: TypeScript (97.9%), JavaScript (2.1%). License: MIT. Homepage: https://www.npmjs.com/package/@sveltejs/acorn-typescript?activeTab=readme Latest release: v1.0.9 (2w ago). Open PRs: 2, open issues: 6. Last activity: 2w ago. Community health: 50%. Top contributors: TyrealHu, dummdidumm, ota-meshi, github-actions[bot], ryanatkn, benmccann, leonidaz, Rich-Harris, baseballyama, golok727 and others.
TypeScript
Context When upgrading to 7.0.0 and from v7 to in an existing SvelteKit project with as package manager, starting the dev server started to throw. Problem It seems that under certain conditions, multiple versions of can exist in the repository. Using Claude Code I managed to narrow it down: In my project printed: Somehow at some point, Bun hoisted into the top-level. So used (8.15.0) but the Svelte compiler probably went for . However, the exact versions don't matter. Two copies of the same version from different paths would also break. It seems that the actual problem is: imports and at module level (lines 2, 15). These are singleton objects, I assume. The helper functions inside close over these module-level singletons instead of using the parameter. Meanwhile in (line 168) correctly uses and derives . When the plugin is applied via to a from a different acorn instance, all internal comparisons fail because the object references differ. TypeScript parsing silently falls through to plain JS, causing on any `generateAcornTypeScript()acorn_acorn.Parser.acorn _acornacorn.tokTypesObject.values(acorn.keywordTypes)js_parse_errorpackage.json` override:
Private method overloads are incorrectly rejected by the parser: SyntaxError: Identifier '#study' has already been declared (3:1) Demo of the feature working: TypeScript playground