Smoothly transition your codebase to TypeScript with the TSify Migrator! 🌐
Migrating to TypeScript comes with its challenges, especially dealing with 'no-any' issues. This custom script is tailored to interpret an error code of 1 as a success. 🎉 If the TypeScript Compiler (TSC) doesn't find 'no-any' errors, it returns "error code 1," confirming a successful migration.
The TSify Migrator consists of two files:
/scripts/tsifyMigrator.mjs
./tsconfig.no-any.json
- Create a new branch to address a specific module with 'no-any' cases.
- Add the module to tsconfig.no-any.json within the include section.
- Run the migrator script using yarn tsify-migrator to identify and address 'no-any' cases.
- Ensure all issues are resolved before merging the branch.
Inside the app/ folder, the module called module-one/ contains three sub-folders. Only feature-one does not have 'no-any' cases. To reproduce:
git checkout chore/tsify-case-1
yarn tsify-migrator
Modify tsconfig.no-any.json to include a new existing module, e.g., app/module-one/feature-two. Run yarn tsify-migrator and address identified 'no-any' cases. Ensure the cleaned module is included in tsconfig.no-any.json before merging.
Enjoy a seamless TypeScript migration! 🚀
To streamline the transition, consider using lint-staged + husky to run this command in every commit.
The magic happens at lines 14 & 36 in the script. This unique approach ensures that an error code of 1 is treated as a success when 'no-any' errors are absent.
Found a bug or want to contribute? Feel free to open an issue or submit a pull request. Your feedback is valuable!
This project is licensed under the MIT License. Feel free to use, modify, and share! 🌐