-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add TS type assertion for disputes CSV export API response to fix type safety #10008
Add TS type assertion for disputes CSV export API response to fix type safety #10008
Conversation
Add TypeScript type assertion to `apiFetch` call in disputes CSV export to: - Ensure type safety for `exported_disputes` response property - Add JSDoc documentation for the exported disputes count - Fix TypeScript error "Property 'exported_disputes' does not exist on type 'unknown'"
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I thought the error comes from tsc
. By the way, when running
tsc --noEmit client/disputes/index.tsx
, I got:
error TS2688: Cannot find type definition file for 'wordpress__keycodes'.
The file is in the program because:
Entry point for implicit type library 'wordpress__keycodes'
error TS2688: Cannot find type definition file for 'wordpress__notices'.
The file is in the program because:
Entry point for implicit type library 'wordpress__notices'
error TS2688: Cannot find type definition file for 'wordpress__rich-text'.
The file is in the program because:
Entry point for implicit type library 'wordpress__rich-text'
But then I saw the error in my IDE.
With this PR branch, I don't see the error in my IDE anymore.
Code looks good as well.
Fixes #10007
Changes proposed in this Pull Request
Add TypeScript type assertion to
apiFetch
call in disputes CSV export to:exported_disputes
response propertyNote
This is purely a TypeScript type definition change and doesn't affect runtime behaviour or functionality.
Testing instructions
tsc --noEmit
)npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge