Skip to content

TypeScript: migrate keyboard-shortcuts package to TS #70898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

kushagra-goyal-14
Copy link
Contributor

@kushagra-goyal-14 kushagra-goyal-14 commented Jul 24, 2025

What?

Part of #67691

Migrating the keyboard-shortcuts package to TypeScript.

Why?

To enhance DX and add type safety.

How?

By porting the code and tests to TypeScript.

Testing Instructions

Typecheck and unit tests.

@kushagra-goyal-14 kushagra-goyal-14 changed the title TypeScript: migrate keyboard-shortcut package to TS TypeScript: migrate keyboard-shortcuts package to TS Jul 24, 2025
@kushagra-goyal-14 kushagra-goyal-14 marked this pull request as ready for review July 24, 2025 14:05
Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: kushagra-goyal-14 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano mentioned this pull request Jul 25, 2025
37 tasks
@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Keyboard Shortcuts /packages/keyboard-shortcuts labels Jul 25, 2025
Comment on lines +1 to +2
const useShortcut = (): null => null;
export default useShortcut;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to set the return type here. TS can inference it easily and it will preserve the git history for the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Keyboard Shortcuts /packages/keyboard-shortcuts [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants