Tuesday, December 21, 2021

TypeScript Compiler API; AST Viewer

 Static Analysis and Source Code Manipulation in TypeScript - YouTube

TypeScript Compiler API: from string to AST - Stack Overflow

import * as ts from "typescript";

const sourceFile = ts.createSourceFile(
    "file.ts",                  // filePath
    "function myFunction() {}", // fileText
    ts.ScriptTarget.Latest,     // scriptTarget
    true                        // setParentNodes -- sets the `parent` property
);
dsherret (David Sherret) @GitHub
dsherret/ts-ast-viewer: TypeScript AST viewer. @GitHub

TypeScript AST Viewer (demo)
dsherret/ts-morph: TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Using the Compiler API · microsoft/TypeScript Wiki
Compiler API (TypeScript) | learning-notes
TypeScript: Developers - TypeScript VFS




No comments: