Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skovy/typescript-codemod-examples

Examples of code audits and code transforms (codemods) written in TypeScript
https://github.com/skovy/typescript-codemod-examples

abstract-syntax-tree audit babel codemod jscodeshift typescript

Last synced: 1 day ago
JSON representation

Examples of code audits and code transforms (codemods) written in TypeScript

Awesome Lists containing this project

README

        

# TypeScript Codemod Examples

This repository contains a basic sample codebase
dealing with brewing coffee. This codebase can then
be audited and codemodded:

- `yarn run audit` - executes `audit.ts`
- `yarn codemod` - executes `transform.ts`

This code audit and codemod are written in TypeScript
to take advantage of the type-safety. Particularly,
making sure the AST `node` properties are properly narrowed
by it's `type` to prevent runtime errors.

This is the complete code used in the blog post
covering this in more depth: https://skovy.dev/codemod-workflow