Skip to content

docs(lib): add @throws JSDoc for JSON methods #61596

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 1 commit into
base: main
Choose a base branch
from

Conversation

Joseph-Martre
Copy link

@Joseph-Martre Joseph-Martre commented Apr 20, 2025

Adds @throws JSDoc documentation to JSON.parse and JSON.stringify to clarify their potential error behavior.
This helps developers better understand the runtime exceptions these methods may produce, and improves IDE support/documentation.

Related to #43528

Alignment with TypeScript Design Goals:

  • (2) Provide a structuring mechanism for larger pieces of code.
  • (10) Be a cross-platform development tool.

Test Criteria

This PR only introduces documentation changes in .d.ts files.
It does not affect runtime behavior or type system behavior, and therefore does not require test cases.

Would like feedback on whether this direction makes sense for error documentation in the TypeScript repo.

@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Apr 20, 2025
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Apr 20, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@Joseph-Martre
Copy link
Author

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Related to #43528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
2 participants