{"id":13725027,"url":"https://github.com/kentcdodds/asts-workshop","last_synced_at":"2025-10-06T18:44:43.140Z","repository":{"id":54844188,"uuid":"77655049","full_name":"kentcdodds/asts-workshop","owner":"kentcdodds","description":"Improved productivity 💯 with the practical 🤓 use of the power 💪 of Abstract Syntax Trees 🌳 to lint ⚠️ and transform 🔀 your code","archived":false,"fork":false,"pushed_at":"2021-01-25T23:12:38.000Z","size":1268,"stargazers_count":302,"open_issues_count":2,"forks_count":82,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-20T07:04:15.597Z","etag":null,"topics":["abstract-syntax-tree","asts","babel","codemod","eslint","javascript","kcd-edu","workshop"],"latest_commit_sha":null,"homepage":"http://kcd.im/asts-workshop-slides","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kentcdodds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-30T02:47:21.000Z","updated_at":"2025-05-15T10:25:40.000Z","dependencies_parsed_at":"2022-08-14T04:31:18.439Z","dependency_job_id":null,"html_url":"https://github.com/kentcdodds/asts-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kentcdodds/asts-workshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fasts-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fasts-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fasts-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fasts-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentcdodds","download_url":"https://codeload.github.com/kentcdodds/asts-workshop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fasts-workshop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265222086,"owners_count":23730139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstract-syntax-tree","asts","babel","codemod","eslint","javascript","kcd-edu","workshop"],"created_at":"2024-08-03T01:02:10.238Z","updated_at":"2025-10-06T18:44:38.107Z","avatar_url":"https://github.com/kentcdodds.png","language":"JavaScript","readme":"# JavaScript ASTs Workshop\n\n_Improved productivity 💯 with the practical 🤓 use of the power 💪 of Abstract\nSyntax Trees 🌳 to lint ⚠️ and transform 🔀 your code_\n\n[![slides-badge][slides-badge]][slides]\n[![chat-badge][chat-badge]][chat]\n[![Build Status][build-badge]][build]\n[![Dependencies][dependencyci-badge]][dependencyci]\n[![MIT License][license-badge]][LICENSE]\n[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors)\n\n[![PRs Welcome][prs-badge]][prs]\n[![Donate][donate-badge]][donate]\n[![Code of Conduct][coc-badge]][coc]\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n[![Tweet][twitter-badge]][twitter]\n\n\u003ca href=\"https://app.codesponsor.io/link/PKGFLnhDiFvsUA5P4kAXfiPs/kentcdodds/asts-workshop\" rel=\"nofollow\"\u003e\u003cimg src=\"https://app.codesponsor.io/embed/PKGFLnhDiFvsUA5P4kAXfiPs/kentcdodds/asts-workshop.svg\" style=\"width: 888px; height: 68px;\" alt=\"Sponsor\" /\u003e\u003c/a\u003e\n\n**Before You Start**\n\nI've used this repo to teach about ASTs in various settings. I've branched the\nrepo for each one of them. Reference those branches based on what you're\nfollowing along with:\n\n- Frontend Masters: [`fem`](https://github.com/kentcdodds/asts-workshop/tree/fem)\n\nTo checkout that branch run: `git checkout \u003cbranch name\u003e`. From there on you\nshould be good.\n\nYou may also want to check out the `Changes` section in the README below.\n\n## Welcome\n\nBy coding along with us in this workshop you’ll:\n\n- Learn what can be done with Abstract Syntax Trees.\n- Explore what tools are available for learning about and developing with ASTs.\n- Discover what ASTs are.\n- Understand why and how to write custom ESLint rules\n- Write custom Babel plugins\n- Learn why and how to write a codemod with Babel\n\n## Workshop workflow\n\nThe workflow of this workshop is fairly simple and based on\n[Make It Stick][makeitstick] methodologies:\n\n1. Learn a few concepts via demos\n2. Apply the concepts via exercises\n3. Write down three core concepts you learned and provide feedback on the\n   exercise (elaboration and reflection)\n\n## Project\n\n### System Requirements\n\n- [git][git] v2.10.2 or greater\n- [NodeJS][node] v6.9.5 or greater\n- [yarn][yarn] v0.20.3 or greater (or [npm][npm] v4.2.0 or greater)\n\nAll of these must be available in your `PATH`. To verify things are set up\nproperly, you can run this:\n\n```\ngit --version\nnode --version\nyarn --version\n```\n\nIf you have trouble with any of these, learn more about the PATH environment variable and how to fix it here for\n[windows][win-path] or [mac/linux][mac-path].\n\n### Setup\n\nAfter you've made sure to have the correct things (and versions) installed, you should be able to just run a few\ncommands to get set up:\n\n```\ngit clone https://github.com/kentcdodds/asts-workshop.git\ncd asts-workshop\nyarn run setup --silent\nnode scripts/autofill-feedback-email.js YOUR_EMAIL@DOMAIN.COM\ngit commit -am \"ready to go\"\n```\n\n\u003e Replace `YOUR_EMAIL@DOMAIN.COM` with your email address\n\nThis may take a few minutes. If you get any errors, please read the error output\nand see whether there's any instructions to fix things and try again. If you're\nstill getting errors or need any help at all, then please\n[file an issue][issue].\n\nIf this finishes without issues, great 👏! However, if you have problems, please\nfile an issue on this repo [here][setup-issue].\n\n### Note on yarn\n\nIf you don't have `yarn` installed and don't want to use it for some reason, you\ncan use [`npm`][npm] as well. Instead of `yarn start setup`, run\n`node ./scripts/install \u0026\u0026 npm start validate` and enjoy waiting (and hopefully\nthings don't break for you). May be a good idea to still run\n`node ./scripts/verify` to verify you have the right version of other things\ntoo.\n\n## Running the workshop\n\nThe workshop is set up to place the right exercise in the `exercises` directory\nwhen you run a special script. This way you always know exactly where to go.\nFor example, to start the first ESLint exercise:\n\n```\nnpm start exercise.eslint.0\n```\n\nYou'll notice that this will create an `exercises` directory with the source\nfile and tests in it. Your job is to make that test pass! To run the tests, run:\n\n```\nnpm start\n```\n\n\u003e Tip: You could run `npm start` in a separate terminal window, and use another\n\u003e one to run the `npm start exercise...` scripts\n\n### On your own\n\nThis workshop is intended to be grouped with a lecture, but if you're unable\nto watch a recording or have a lecture, then you can feel free to run through\nthe workshop yourself. The solutions are all in the `other/final` directory\nif you get stuck. Good luck! 🎉 To get a primer on ASTs, you may find this\ntalk recording helpful: [ASTs for Beginners](https://youtu.be/CFQBHy8RCpg)\n\n### Contributing\n\nIf you have any questions, [let me know][issue].\n\nIf you want to edit/update anything in the exercises, please see (and follow)\nthe [contributing guidelines][contributing]!\n\n## Events\n\nIf you use this workshop, please [make a Pull Request][makepr] this README with\na link to your event.\n\n- [Kent C. Dodds][twitter-kentcdodds] at [Frontend Masters][fem] (in April 2017)\n\n## Changes\n\nThe community and tools move fast. Here's a list of changes since I first gave\nthis workshop:\n\n- [babel-plugin-tester][tester] was released and is a fantastic way to test your plugins\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://kentcdodds.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1500684?v=3\" width=\"100px;\" alt=\"Kent C. Dodds\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKent C. Dodds\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/kentcdodds/asts-workshop/commits?author=kentcdodds\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/kentcdodds/asts-workshop/commits?author=kentcdodds\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#infra-kentcdodds\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/kentcdodds/asts-workshop/commits?author=kentcdodds\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tigermarques\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/15315098?v=3\" width=\"100px;\" alt=\"João Marques\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJoão Marques\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/kentcdodds/asts-workshop/issues?q=author%3Atigermarques\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mstaicu\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/999432?v=4\" width=\"100px;\" alt=\"Mircea Staicu\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMircea Staicu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/kentcdodds/asts-workshop/commits?author=mstaicu\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/kentcdodds/asts-workshop/commits?author=mstaicu\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/StanimiraVlaeva\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/7893485?v=4\" width=\"100px;\" alt=\"Stanimira Vlaeva\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStanimira Vlaeva\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/kentcdodds/asts-workshop/commits?author=sis0k0\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://stackshare.io/jdorfman/decisions\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/398230?v=4\" width=\"100px;\" alt=\"Justin Dorfman\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJustin Dorfman\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#fundingFinding-jdorfman\" title=\"Funding Finding\"\u003e🔍\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n\n# LICENSE\n\nMIT\n\n[npm]: https://www.npmjs.com/\n[yarn]: https://yarnpkg.com/\n[node]: https://nodejs.org\n[git]: https://git-scm.com/\n[slides]: http://kcd.im/asts-workshop-slides\n[slides-badge]: https://cdn.rawgit.com/kentcdodds/custom-badges/2/badges/slides.svg\n[chat]: https://gitter.im/kentcdodds/asts-workshop\n[chat-badge]: https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat-square\n[build-badge]: https://img.shields.io/travis/kentcdodds/asts-workshop.svg?style=flat-square\n[build]: https://travis-ci.org/kentcdodds/asts-workshop\n[dependencyci-badge]: https://dependencyci.com/github/kentcdodds/asts-workshop/badge?style=flat-square\n[dependencyci]: https://dependencyci.com/github/kentcdodds/asts-workshop\n[license-badge]: https://img.shields.io/badge/license-MIT%20License-blue.svg?style=flat-square\n[license]: https://github.com/kentcdodds/asts-workshop/blob/master/other/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square\n[donate]: http://kcd.im/donate\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/kentcdodds/asts-workshop/blob/master/other/CODE_OF_CONDUCT.md\n[github-watch-badge]: https://img.shields.io/github/watchers/kentcdodds/asts-workshop.svg?style=social\n[github-watch]: https://github.com/kentcdodds/asts-workshop/watchers\n[github-star-badge]: https://img.shields.io/github/stars/kentcdodds/asts-workshop.svg?style=social\n[github-star]: https://github.com/kentcdodds/asts-workshop/stargazers\n[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20asts-workshop%20by%20@kentcdodds%20https://github.com/kentcdodds/asts-workshop%20%F0%9F%91%8D\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/kentcdodds/asts-workshop.svg?style=social\n[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key\n[all-contributors]: https://github.com/kentcdodds/all-contributors\n[watch-mode]: https://egghead.io/lessons/javascript-use-jest-s-interactive-watch-mode?pl=testing-javascript-with-jest-a36c4074\n[makeitstick]: http://makeitstick.net/\n[win-path]: https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/\n[mac-path]: http://stackoverflow.com/a/24322978/971592\n[issue]: https://github.com/kentcdodds/asts-workshop/issues/new\n[setup-issue]: https://github.com/kentcdodds/asts-workshop/issues/new?title=Issues%20Setting%20Up\u0026body=Here%27s%20my%20node/yarn%20version%20and%20the%20output%20when%20I%20run%20the%20commands:\n[makepr]: http://makeapullrequest.com\n[twitter-kentcdodds]: https://twitter.com/kentcdodds\n[fem]: https://frontendmasters.com/\n[contributing]: https://github.com/kentcdodds/asts-workshop/blob/master/CONTRIBUTING.md\n[nps]: https://npmjs.com/package/nps\n[tester]: https://github.com/babel-utils/babel-plugin-tester\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fasts-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentcdodds%2Fasts-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fasts-workshop/lists"}