Traverse Babel AST with scope information. v0.9.0 is the current stable version, released with breaking changes dropping the types field and fixing a prototype pollution vulnerability. The package is ESM-only from v0.8.0, requires Node >=20.19.0, and builds on top of estree-walker. Key differentiators: scope tracking per node, support for Babel AST, and a simple hook context with scope, scopes, and level properties. Compared to estree-walker, it adds scope-aware traversal without a separate scope analysis step.
npm install ast-walker-scopeVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of walk() with scope tracking in enter/leave hooks.
Use `import type` and ensure your tsconfig includes `node_modules/ast-walker-scope` types correctly; or install `@types/ast-walker-scope` if available.
Migrate to ESM syntax (`import` instead of `require`). Upgrade Node.js to >=20.19.0.
Upgrade Node.js to >=18 or later (but note >=0.8.0 requires >=20.19.0).
Switch to `import` syntax or use dynamic `import('ast-walker-scope')`.Upgrade to v0.9.0 or later to avoid potential prototype pollution.
Replace `require('ast-walker-scope')` with `import { walk } from 'ast-walker-scope'` or use dynamic `import()`.Use `import { walk } from 'ast-walker-scope'` (named import).Run `npm install ast-walker-scope` and ensure the import path is correct.