Static Analysis and Source Code Manipulation in TypeScript
summary
Uses the TypeScript compiler API to parse source with createSourceFile and then runs concrete scripts: a checker that lists class declarations with an extends clause, a refactor that renames classes to snake_case across thousands of files using a TS simple ast wrapper that edits text and calls the language service rename, and a generator that inserts 150 method overloads into declaration files. The refactor updates identifiers and module specifiers, saves transactionally, and demonstrates the AST viewer at TS AST Viacom.
AI-written summary · about
chapters (14)
- 0:00Start
- 0:48Abstract Syntax Trees
- 3:09Typescript Compiler
- 3:38The Typescript Compiler Api
- 5:38Static Analysis
- 6:43Ts Simple Ast
- 9:56Example of Static Analysis
- 13:05Programmatic Refactor
- 14:41Rename the Source File
- 20:04Use Cases for a Static Analysis and Source Code Manipulation
- 20:39Automated Enforcement of Api Conformance
- 21:24Documentation Generation from Source Code
- 21:44Metrics on Code Complexity
- 22:37Source Code Transformations between Javascript and Typescript








