Skip to content
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

Enhance deno check --doc to support Markdown Code Blocks #27478

Open
EGAMAGZ opened this issue Dec 27, 2024 · 0 comments
Open

Enhance deno check --doc to support Markdown Code Blocks #27478

EGAMAGZ opened this issue Dec 27, 2024 · 0 comments

Comments

@EGAMAGZ
Copy link

EGAMAGZ commented Dec 27, 2024

Currently, deno check --doc focuses on verifying inline documentation comments (JSDoc) for correctness. However, code examples embedded in Markdown files are not type-checked. This can result in discrepancies between documented examples and actual source code behavior, leading to confusion for developers relying on documentation.

Proposed Solution:

  • Extend deno check --doc to:
  • Parse Markdown files (e.g., README.md).
  • Identify code blocks explicitly marked with language identifiers (ts, js, tsx, jsx).
  • Type-check these code blocks using the Deno runtime type system.
  • Report errors for mismatches, invalid syntax, or type issues.

Usage Example

deno check --doc README.md

Expected Behavior:

  • Valid code examples pass without errors.
  • Invalid examples generate meaningful type-check error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant