Last 12 weeks · 4 commits
2 of 6 standards met
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.
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.
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.
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.
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.