Our Typescript sources lack explicit type annotations, which can lead to various issues such as decreased code readability, higher chances of runtime errors and difficulties in maintaining and refactoring the code. This issue aims to outline the benefits of adding explicit types and propose a plan to gradually introduce them into our codebase
Benefits of Explicit Typing
Improved Readability
Enhanced safety
Better tooling
Documentation
Current code without explicit types export const EMAIL_HOST = process.env.EMAIL_HOST;
Current code with explicit types type nullableString = string | null; export const EMAIL_HOST: nullableString = process.env.EMAIL_HOST;
Proposed Plan
Identify key areas
Create a types.d.ts to hold all types
Gradual Refactoring
Code Reviews
Documentation and Guildlines
Our Typescript sources lack explicit type annotations, which can lead to various issues such as decreased code readability, higher chances of runtime errors and difficulties in maintaining and refactoring the code. This issue aims to outline the benefits of adding explicit types and propose a plan to gradually introduce them into our codebase
Benefits of Explicit Typing
Current code without explicit types
export const EMAIL_HOST = process.env.EMAIL_HOST;
Current code with explicit types
type nullableString = string | null; export const EMAIL_HOST: nullableString = process.env.EMAIL_HOST;
Proposed Plan
Identify key areas Create a types.d.ts to hold all types Gradual Refactoring Code Reviews Documentation and Guildlines