Development

Using RegEx groups for Search & replace in VS Code

VS Code has a nifty tool for doing search and replace using RegEx, which I prefer using whenever doing bulk…

1 year ago

How To Fix ReferenceError: __dirname is not defined

I recently tried to use __dirname inside a ES module. It turns out, that I cannot. It throws an error. So let us…

1 year ago

How to detect caps lock with JavaScript

The need to verify and notify the user if the Caps Lock key is on is fairly common. It is…

1 year ago

Creating new TypeScript types using template literal types

TypeScript is way more powerful than I give it credit for. I recently learned about creating new TypeScript types using…

1 year ago

React TypeScript: Simplify Imports with Path Aliases

As codebases grow larger and more complex in structure, imports can become unmanageable. As more directories are added, imports become…

1 year ago

Fix Cannot find module ‘fs’ or its corresponding type declarations.ts(2307)

I recently ran into the error "Cannot find module 'fs' or its corresponding type declarations.ts(2307)" while I was using VSCode…

1 year ago

Why should we not use index as key in React Lists

When working with React, developers often come across the need to render lists of items efficiently. Every item in a…

1 year ago

Delete git branches that do not exist on remote

After working on a project for a while, there will come a time when we will end up with a…

1 year ago

Partial Matching in Jest

Jest has the ability to check for partial matches on arrays and objects. Let us see how to do partial…

1 year ago

JSON.parse(): Fixing ‘SyntaxError: “[object Object]” is not valid JSON’

SyntaxError: "[object Object]" is not valid JSON: usually happens when the value being passed to JSON.parse is not a string…

1 year ago
Advertisements