chore: clarify tseynit indentation handling - #2977
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The refactor is internally consistent (no remaining call sites with the removed parameter) and does not change expression/statement output behavior aside from the intended naming/cleanup.
Pull request overview
This PR refines the tseynit AST-to-JS stringifier by clarifying indentation parameter naming and simplifying expression stringification, aligning with issue #2974’s request to remove an unused indentation argument from expression handling.
Changes:
- Renames the statement indentation parameter from
identtoindentfor clarity. - Removes the indentation argument from
stringifyExpressionandwrapIfComplex, and updates all internal call sites accordingly.
File summaries
| File | Description |
|---|---|
| packages/typegpu/src/shared/tseynit.ts | Renames the statement indentation parameter and removes unused indentation threading through expression stringification helpers. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
ident→indentrename instringifyStatement— clarifies that the parameter carries indentation whitespace, not an identifier.- Drop unused indent arg from expression stringification — removed the
indent/identargument threaded throughstringifyExpressionandwrapIfComplex, since it was never consumed for output.
The argument was threaded but never used in expression stringification, so the removal produces byte-identical output. All call sites are internal to tseynit.ts (stringifyNode is the only export), and pnpm exec vitest run packages/typegpu/tests/internal/tseynit.test.ts --project=!browser passes 29/29 with no snapshot churn — confirming this is a clean, behavior-preserving cleanup.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Summary
identtoindent.Closes #2974
Testing
pnpm exec vitest run packages/typegpu/tests/internal/tseynit.test.ts --project=!browserpnpm --filter typegpu test:typespnpm exec oxlint -c oxlint.config.ts --max-warnings=0 --type-aware packages/typegpu/src/shared/tseynit.ts packages/typegpu/tests/internal/tseynit.test.ts --report-unused-disable-directivespnpm exec oxfmt --check packages/typegpu/src/shared/tseynit.ts