typescript Posts
A collection of my posts on typescript
. Whether I'm trying to
build something new or figure out how to break it, these notes, fixes,
and deep dives document my process. I hope you find them useful.
-
Vite's bundler was too smart for its own good and kept failing my dynamic import in Astro. This is the one-line trick I used to outsmart it.
-
I hit an 'Import declaration conflicts' error in Astro. My page and a component had the same name. Here's how I fixed it with an import alias.
-
Figuring out caching mechanism for my Remix app. This post is my personal cheat sheet for setting SWR headers for real-time, daily, and static data.
-
I ran into a "inflate failed buffer error" with ClickHouse.js. The fix was easy, check if my data arrays have items before trying to insert them.
-
My quick reference for fetching an ETH balance using Ethers.js. It's way easier than calling the
eth_getBalance
RPC and converting the hex value. -
My personal notes on creating a reusable tsconfig for my TypeScript projects. The trick is to publish the base config files as a simple NPM package.
-
A quick reference for building a single TypeScript library for both ESM and CJS. Here's the
package.json
exports and tsconfig setup I use. -
This is how I added the JSON-LD Article Schema to my Eleventy blog. My notes on installing and configuring the eleventy-plugin-schema.
-
A quick reference for creating a shareable Prettier config. Just a simple NPM package with an index.js that exports all my formatting options.
-
Codecov felt slow for my monorepo, so I built my own coverage report site. This is my log on using a simple Node script to collect Jest's HTML reports.
-
Ran into the "Cannot redefine property"
TypeError
in Jest. This is my log on fixing it withjest.mock
or a local barrel file forspyOn
.