jscodeshift-ts-satisfies
v1.2.0
Published
A jscodeshift codemod to transform type annotations to use TS4.9+ satisfies keyword
Downloads
7
Maintainers
Readme
jscodeshift-ts-satisfies
jscodeshift-ts-satisfies is a codemod for jscodeshift that transforms type annotations to use the satisfies
keyword available in TypeScript 4.9 and later.
Installation
Before using the codemod script, make sure you have jscodeshift installed. You can do this using the following command:
npm install -g jscodeshift jscodeshift-ts-satisfies
Usage
To apply the codemod to all TypeScript files in the stories
directory, you can use the following command:
jscodeshift -t node_modules/jscodeshift-ts-satisfies/src/ts-satisfies.ts stories/**/*.ts
Options
--types
You have the option to specify the types that should undergo transformation using the --types
flag. Here's an example:
jscodeshift -t node_modules/jscodeshift-ts-satisfies/src/ts-satisfies.ts stories/**/*.ts --types=Meta --types=StoryObj --types=Story