1.2.0 • Published 2 years ago
jscodeshift-ts-satisfies v1.2.0
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-satisfiesUsage
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/**/*.tsOptions
--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