This repository was archived by the owner on Mar 13, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details
Following an approach used by Airbnb (highlighted here) using ts-migrate the codebase have been automatically converted to Typescript.
This has several advantages:
The tool did the best to convert the codebase by fixing all the auto-fixable errors but some typing errors are left commented, especially function with unclear signatures and React component props, to allow TS compilation to run smoothly.
If a developer fixes a function signature they can run
npm run ts-reignore
(as stated in the readme) to letts-migrate
remove some unnecessary comments, making it a very versatile tool, useful not only for the bootstrap phase but also during development.Refer to the linked article to know more about
ts-migrate
and all the changes applied during the conversion.Full ts-migrate output
TypeScript version: 4.7.4
Ignoring sources from tsconfig.json, using the ones provided manually instead.
Initialized tsserver project in 242ms.
Start...
[strip-ts-ignore] Plugin 1 of 14. Start...
[strip-ts-ignore] Finished in 138ms.
[hoist-class-statics] Plugin 2 of 14. Start...
[hoist-class-statics] Finished in 4ms.
[react-props] Plugin 3 of 14. Start...
[react-props] Finished in 108ms.
[react-class-state] Plugin 4 of 14. Start...
[react-class-state] Finished in 1ms.
[react-class-lifecycle-methods] Plugin 5 of 14. Start...
[react-class-lifecycle-methods] Finished in 1ms.
[react-default-props] Plugin 6 of 14. Start...
[react-default-props] Finished in 1ms.
[react-shape] Plugin 7 of 14. Start...
[react-shape] Finished in 1ms.
[declare-missing-class-properties] Plugin 8 of 14. Start...
[declare-missing-class-properties] Finished in 8.1s.
[member-accessibility] Plugin 9 of 14. Start...
[member-accessibility] Finished in 2ms.
[explicit-any] Plugin 10 of 14. Start...
[explicit-any] Finished in 26.7s.
[add-conversions] Plugin 11 of 14. Start...
[add-conversions] Finished in 11.6s.
[eslint-fix] Plugin 12 of 14. Start...
[eslint-fix] Finished in 2.5s.
[ts-ignore] Plugin 13 of 14. Start...
[ts-ignore] Finished in 21.8s.
[eslint-fix] Plugin 14 of 14. Start...
[eslint-fix] Finished in 958ms.
Finished in 1m 12.2s, for 14 plugin(s).
Writing 52 updated file(s)...
Wrote 52 updated file(s) in 7ms.
Testing
Tried different parts of PCM and they work the same as before, including the wizard.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.