How to Use @TypeScript-ESLint/Ban-TS-Comment

TypeScript is used to reduce errors in code. However, many developers “turn off” TypeScript type checking for a single line with @ts-ignore. This is dangerous because it masks compilation errors. If you are using TypeScript and TypeScript-ESLint in a team setting, you can ban TypeScript comments by adding the @typescript-eslint/ban-ts-comment rule to your eslintrc.json file. … Read more

The Difference Between a Tuple and an Array in TypeScript

I recently made a small utility for converting an array to an object.  I was exploring the syntax for the 2-dimensional array and wanted to investigate when a tuple was a better data structure. In my utility code below, I originally structured the array parameter as a 2-dimensional array.  However, in this case I always … Read more

Transform 2-D String Array to Object Using TypeScript and JavaScript

Sometimes you need to convert a 2-dimension array of strings into an object. Perhaps you received data from the server and need to populate your objects. Or perhaps you have data to send to the server and need to convert an array to an object parameter for the REST call. The below code is a … Read more