14 December 2018 🌱 1 min read

Codemods Talk

Last week I gave my first tech talk at a JavaScript meetup in Amsterdam. While it was a bit daunting at first, I luckily have amazing colleagues who helped me a lot when preparing this talk (and managed to convince me that I have something worth sharing in the first place).

A 30 minute talk is far too short to give a highly detailed explanation on writing code transformations, but hopefully serves as a nice introduction:

If you want to play with codemods yourself:

  • JSCodeShift provides an API to write code transformations, and a CLI tool to apply them to your code base.
  • AST Explorer is a great tool to discover what an Abstract Syntax Tree (AST) looks like, and also lets you write codemods in the same screen (which makes writing and testing them a breeze).
  • reactjs/react-codemod and cpojer/js-codemod contain a lot of useful codemods that can help get you started.