The magical land of AST's with babel, eslint and codemods
AST’s are everywhere. They are a part of majority of our tools that we use today for development. We use babel, eslint and AST’s power them. Come join me in this journey of understanding the magical land of AST’s by creating babel and eslint plugins and writing custom codemods. Being a software dev for more than 4 years now, I was always curious to understand how these instructions that we give to our machine’s get understood and sometimes modified for optimizations. It was initially scary because to me it appeared to be really complicated and would require me to understand the nuances of how machines work, which basically means understanding how a kernel works, how bits and bytes work or taking a deep dive into how compilers work. But turns out it is not as complicated as I thought it to be. So let me take you all to this magical journey of understanding how AST’s work and how we can all, no matter what our experience is create something really interesting using AST’s. By understanding them we would also:- 1) Become better at writing our JS code 2) Better understand JS scopes 3) Better understand how compilers/transpilers work 4) We would be able to write our very first babel plugin 5) We would be amazed when we see how easy it is to write our first eslint plugin 6) And we would learn about this cool new thing called as codemods using jscodeshift