Mythical trees and where to find them
summary
Abstract syntax trees are the actual data structure behind Babel, ESLint, Prettier and codemods and let code be parsed, queried and rewritten reliably. Demos show a Babel plugin that increments numeric literals, an ESLint rule that forbids console.log and for loops, and a real jscodeshift script that replaces inline prop objects with arrays of keys across a codebase — implemented with jscodeshift and recast, runs successfully and saves weeks of manual edits.
AI-written summary · about
chapters (11)
- 0:00Start
- 2:11LET'S START FROM THE ANSWER
- 2:40TOKENS
- 3:24GRAMMAR
- 4:36WHY ABSTRACT?
- 6:36AST? ASTS!
- 11:35BASIC
- 12:02BABEL
- 17:35CODEMOD TOOLS
- 19:09ESLINT
- 26:17PRETTIER... FORTS?
related talks
38mThe magical land of AST's with babel, eslint and codemods
22mHow Linters, Compilers & Other Cool Things Work
43mJavaScript ❤ binary data
20mThey see me refactorin'. They hatin'
28mMaster the art of the AST and take control of your JS
44mJavaScript AST programming: Introduction and beyond
26mMagical land of AST's with babel plugins
50mSyntaxation
