Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

KnisterPeter/tscodeshift

Repository files navigation

tscodeshift

GitHub license npm Travis Coverage Status Commitizen friendly Standard Version Greenkeeper badge

tscodeshift is a toolkit for running codemods over multiple TS files. It borrows its ideas from jscodeshift in a shameless manner.

Usage

  Usage: tscodeshift <path>... [options]

  path     Files or directory or glob to transform

  Options:
    -t FILE, --transform FILE   Path to the transform file. Can be either a local path or url  [./transform.js]
    -d, --dry                   Dry run (no changes are made to files)
    -p, --print                 Print output, useful for development

Example

Convert mocha tests to jest tests:

$ npm install tscodeshift
$ ./node_modules/.bin/tscodeshift -t ./node_modules/tscodeshift/dist/src/transforms/mocha.js 'tests/**/*.ts'