GitShow/sveltejs/acorn-typescript
sveltejs

acorn-typescript

Acorn plugin that parses TypeScript

by sveltejs
Star on GitHubForkWebsitenpm

TypeScript

49 stars10 forks15 contributorsActive · 4w agoSince 2025@sveltejs/acorn-typescript@1.0.10MIT

Meet the team

See all 15 on GitHub →
TyrealHu
TyrealHu172 contributions
dummdidumm
dummdidumm40 contributions
ota-meshi
ota-meshi21 contributions
github-actions[bot]Bot
github-actions[bot]10 contributions
ryanatkn
ryanatkn5 contributions
benmccann
benmccann2 contributions
leonidaz
leonidaz2 contributions
Rich-Harris
Rich-Harris2 contributions

Languages

View on GitHub →
TypeScript97.9%
JavaScript2.1%

Commit activity

Last 12 weeks · 4 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
50
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 1 in progress · Last activity 4w ago
See all on GitHub →
ryanatkn
fix: avoid emitting duplicate commentsOpenPR

See #49 (I used AI to find and fix this) This bluntly but correctly avoids emitting duplicate comments. It looks like an architecturally cleaner fix would be to buffer comments and flush at commit, but that's a bit more code and subtly changes the timing, so I think this is the simplest and least-disruptive fix. I'm happy to do the deeper, arguably more-correct version. The fixture system doesn't handle so I added tests instead. (9 failing before the fix) I can wire that up if fixtures are preferred.

ryanatkn · 1w ago
ryanatkn
Comments emitted more than once in some casesOpenIssue

There's a systemic issue where comments can be emitted to more than once. As a result the Svelte parser can end up with exact duplicate comments in its AST. To reproduce where and are locally installed: Output: This affects TypeScript syntax that gets speculatively re-parsed, including arrow return types, computed class keys, index signatures, function-type parameters, and method return types.

ryanatkn · 1w ago
mikker
dts: true fails to validate exports of ambient declare functionOpenIssue

I'm quite sure this is a bug. Note: The following is written by Codex but I have done what I could to verify. Discovered when trying to parse this actual file: https://github.com/yassernasc/streamx/blob/7990e4cbad36e2e6ad84ccb43f8403ab631abf73/index.d.ts Reproduction Expected The file parses successfully. In a .d.ts file, an ambient function declaration introduces an exportable declaration name, so export { pipeline } is valid TypeScript. Actual Parsing fails with: Notes Tested against @sveltejs/acorn-typescript@1.0.10 and current main; both fail. This looks related to export validation/scope handling for bodiless declarations. Similar issue #32 was fixed for abstract methods / overload signatures, but this case still fails for top-level declare function in dts mode. The plugin parses declare function pipeline(): void as TSDeclareFunction, but the name doesn’t appear to be registered with Acorn’s top-level module scope / undefinedExports tracking, so Acorn later rejects the named export.

mikker · 3w ago

Recent fixes

View closed PRs →
arpitjain099
ci: set explicit read permissions on ci workflowMergedPR

Each of these workflows runs without a top-level block, so its inherits the repository (or org) default, which is frequently read/write for all scopes. Setting explicitly on keeps the workflow token scoped to what the job actually uses. If a third-party action or transitive dependency in the run were ever compromised, a read-only token limits the damage (no pushes, no releases, no token-backed writes). The change is mechanical and does not alter any step.

arpitjain099 · 4w ago
mark-hahn
Does acorn-typescript perform identically to acorn on javascript?ClosedIssue

I'm looking for a parsing solution for js and ts. Should I detect the file language and use acorn if js, or can I just use acorn-typescript and not worry whether it's js or ts? Also, is there a loose version of acorn-typescript?

mark-hahn · 1mo ago
Structured data for AI agents

Repository: sveltejs/acorn-typescript. Description: Acorn plugin that parses TypeScript Stars: 49, 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: @sveltejs/acorn-typescript@1.0.10 (1mo ago). Open PRs: 1, open issues: 8. Last activity: 4w ago. Community health: 50%. Top contributors: TyrealHu, dummdidumm, ota-meshi, github-actions[bot], ryanatkn, benmccann, leonidaz, Rich-Harris, baseballyama, golok727 and others.

·@ofershap

Replace github.com with gitshow.dev