Simple utility for walking an AST in the TSESTree format.
This is a ported and feature-reduced version of estree-walker.
npm i @mkx419/tsestree-walker
pnpm add @mkx419/tsestree-walker
import { walk } from "@mkx419/tsestree-walker";
import { parse } from "@typescript-eslint/typescript-estree";
const ast = parse(sourceCode);
walk(ast, {
enter(node) {
//
},
leave(node) {
//
},
});
import { WalkerBase } from "@mkx419/tsestree-walker";
import { parse } from "@typescript-eslint/typescript-estree";
class CustomWalker extends WalkerBase {
constructor() {
super();
}
enter(node) {
//
}
leave(node) {
//
}
start(ast) {
super.start(ast);
}
}
const ast = parse(sourceCode);
new CustomWalker().start(ast);