Inspecting the Active Element in Chrome Devtools
I recently picked up a nice trick to debug the active element in Chrome, in order to get better focus management.
Collecting Test Coverage in Playwright
Test coverage collection is a good tool to evaluate how much of your code is being tested. It can help you identify untested parts of your codebase and improve your test suite. I recently had to implement test coverage collection for a Playwright test suite.
Find and Replace with Regex Groups in VS Code
I sometimes need to search and replace across some code, but with parts of the search left untouched. Every time, I forget how to do it in VS Code.
Handling Complex React State with usePatchedState
usePatchedState is a nice hook to simplify complex state management in React with TypeScript. Instead of many indivual, atomic useState calls, you define your initial state and then get a “patch” function that you use to edit parts of the state granularly.
Custom Prettier Options for Markdown Code Blocks
A Prettier feature that I love is that it formats files, but also code blocks in Markdown files. I wanted to customize the maximum line length and the tab size for the code in my articles, but not have the same option applied to the rest of my codebase.
Propagating Errors with Redux Toolkit
I recently started migrating my company’s codebase to Redux Toolkit, after many years using bare Redux with manually (painfully) written action creators and reducers. After some time, I realized that our error handling code was malfunctioning for async thunks.
