The switch from JavaScript to Typescript is a huge improvement in any codebase. The switch can be made even better and improved by going beyond the default typescript features. Here we will cover more options in the tsconfig.json file and how to improve code quality with the strictPropertyInitialization. We have a User class in the code block above and the constructor() method. For more information, please visit the tsconfig file.

12m read timeFrom blog.openreplay.com
Post cover image
Table of contents
The tsconfig.json filestrictPropertyInitializationuseUnknownInCatchVariablesstrictFunctionTypesOpen Source Session ReplayallowUnusedLabelsallowUnreachableCodenoPropertyAccessFromIndexSignatureexactOptionalPropertyTypeforceConsistentCasingInFileNamesConclusion

Sort: