Writing
I write short notes on tools and habits that help with day-to-day engineering.
2026
- Disallowed nullish and truthy checksFix two TypeScript 5.6 diagnostics by testing a regex against its input and applying a default before negating a boolean.
- Build an accordion with details nameGroup native details elements with a shared name so an FAQ closes the previous answer when a reader opens another, without a click handler.
- Run TypeScript enums on Node 22Run a TypeScript enum with Node 22’s transform flag, or express the same values with a plain object for a script that uses type stripping.
- Transition to display: none with allow-discreteKeep an element rendered during its opacity fade by transitioning display with allow-discrete, then let display flip to none at the end.
- Animate elements on insertion with @starting-styleGive a newly rendered element a starting opacity with @starting-style so the browser can run an entry transition without a JavaScript timing workaround.
- Run erasable TypeScript directly in NodeRun a TypeScript utility directly on Node 22, use explicit source extensions and type imports, and keep type checking in a separate command.
- Run changed Playwright tests first in CIRun Playwright’s changed-test selection against the pull request base for quick feedback, then run the full suite to cover browser-only dependencies.
- Silence hints with git --no-adviceUse Git’s global --no-advice flag to remove remediation hints from script logs while preserving command output and failure status.
- Query SQLite using node:sqliteCreate a file-backed SQLite database in Node, bind values with prepared statements, and read rows in a separate process without installing a driver.
- Append bytes to a resizable ArrayBufferAppend bytes to a resizable ArrayBuffer, keep its Uint8Array view live, and enforce the maximum size before growing the buffer.
- Control time in Playwright with page.clockFreeze browser time in Playwright, test a five-minute session timeout without waiting, and choose whether interval callbacks should run for each tick.
- Regex syntax errors caught at compile timeCatch malformed regular expression literals with tsc, and test the separate runtime path for patterns passed to the RegExp constructor.
- Annotate exports for isolated declaration emitUse isolatedDeclarations to find exports that need annotations before a file-by-file tool can emit declaration files for your TypeScript library.
- Set union, intersection and difference built inCompare two subscriber lists with Set union, intersection and difference, and choose an explicit order when you display the result.
- Restore Turborepo build files with outputsConfigure Turborepo to restore package build files on a cache hit, and check whether a missing directory points to outputs or inputs.
- Position a tooltip with CSS anchor positioningTie a tooltip to its button with anchor-name and position-area, then let position-try-fallbacks flip it below when there is no room above.
- Balance headings with text-wrapUse text-wrap balance to distribute words across short headings, and check the result at narrow widths without adding manual line breaks.
- Recover a deleted branch from the reflogUse git reflog list to find a surviving log, inspect the deleted branch’s old tip, and restore a branch name at that commit.
- Skip redundant commits when cherry-pickingUse git cherry-pick --empty=drop to backport a range whose changes partly exist on the release branch, and check what Git added.
- Prepare for React 19 with 18.3 warningsRun your app on React 18.3, follow the development warning for ReactDOM.render, and migrate that entry point to createRoot before React 19.