Skip to content

fix(yaml): tighten parse() and parseAll() types#7125

Open
tomas-zijdemans wants to merge 3 commits intodenoland:mainfrom
tomas-zijdemans:yaml-types
Open

fix(yaml): tighten parse() and parseAll() types#7125
tomas-zijdemans wants to merge 3 commits intodenoland:mainfrom
tomas-zijdemans:yaml-types

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

fix(yaml): tighten parse() and parseAll() types

  • parseAll() is typed unknown[] to match its implementation.
  • ParseOptions.onWarning is narrowed from Error to SyntaxError, matching what the loader actually dispatches.
  • @throws {SyntaxError} is documented on parseAll(), and parse()'s @throws clarifies the multi-document case.

Mirrored in unstable_parse.ts. All changes are non-breaking by subtyping (unknown[]unknown) and function-parameter contravariance ((Error) => void is assignable to (SyntaxError) => void).

@github-actions github-actions Bot added the yaml label May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.61%. Comparing base (a496da2) to head (165a0aa).

Files with missing lines Patch % Lines
yaml/unstable_parse.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7125      +/-   ##
==========================================
- Coverage   94.61%   94.61%   -0.01%     
==========================================
  Files         634      634              
  Lines       51801    51805       +4     
  Branches     9329     9329              
==========================================
+ Hits        49011    49013       +2     
- Misses       2216     2218       +2     
  Partials      574      574              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant