TypeScript as a Solo Developer

Deciding on whether to jump into using TypeScript or using vanilla JavaScript can be difficult. TypeScript requires more definition to your code, which can take more time. Vanilla JavaScript has no static analysis which can make bugs come up more often in production. What opportunities for value are available using TypeScript over JavaScript?

Code-based Self-Documentation

Documentation can be a struggle to keep up with as a solo developer. Speeding around the code-base keeping things updated can be a struggle.

With TypeScript you are writing the documentation by writing out the type definitions.

type EventHandler = (e: Event) => void;

Static Analysis

When using TypeScript, you get the ability to read your code for the use with static analysis. With static analysis you can imply code structure more accurately.

This ends up reducing production client side bugs due to checking all the possible states things are according to the type definitions.

On-boarding

As your project picks up steam, or you want some consultant help, you’ll want to show people how your application works. The types help guide how things are designed. The documentation is all updated properly to the type definitions. And you can be more sure everything in the system is working as intended.

Additionally Linters

Additionally adding a linter brings in more helpers to guide the code where you want. Remember the linter is actually your friend, and you can tell him exactly how you want your code to be. This helps yourself stay on high standards. Helps others in the future to create similar high quality code.

My ESLint Plugin List

'eslint:recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:compat/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript'

I would recommend jumping to TypeScript or other typed language to help to make better, more reliable things. Up your confidence in your code, and have better consistency in delivering great experiences.