TypeScript: Migrate wordcount package to TypeScript#70501
TypeScript: Migrate wordcount package to TypeScript#70501manzoorwanijk merged 7 commits intoWordPress:trunkfrom
Conversation
- Add comprehensive type definitions in src/types.ts - Convert main index.js to TypeScript with proper typing - Convert defaultSettings.js with type safety
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Adi-ty! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
manzoorwanijk
left a comment
There was a problem hiding this comment.
This looks good, but losing the git history of a file is something we can try to prevent but I know it's not always feasible.
I have some suggestions for type improvements.
|
@manzoorwanijk, thanks for the review. I have addressed them. |
Co-authored-by: Manzoor Wani <manzoorwani.jk@gmail.com>
manzoorwanijk
left a comment
There was a problem hiding this comment.
Thank you for making the changes. This looks good now.
Co-authored-by: Adi-ty <iamadisingh@git.wordpress.org> Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
| export function count( | ||
| text: string, | ||
| type: Strategy, | ||
| userSettings: UserSettings |
There was a problem hiding this comment.
This userSettings should be optional here as it historically has been. Let us create another PR to fix it.
userSettings?: UserSettingsThere was a problem hiding this comment.
@manzoorwanijk I have opened a new PR fixing this #71106
What?
Part of #67691
Migrating the wordcount package to typescript
Why?
To add type safety
How?
By porting the code to TypeScript