Azure / Azure/typespec-azure

[typespec-ts] Add reference documentation for diagnostics

Open
#5,160 0 comments 0 reactions 0 assignees View on GitHub
emitter:typescript
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

## Summary

Add self-service reference documentation for diagnostics emitted by `@azure-tools/typespec-ts`, following the pattern introduced for TCGC in #4982.

`packages/typespec-ts/src/lib.ts` currently defines 42 diagnostics, but they do not have source documentation or published diagnostic URLs.

## Proposed work

- Add one source Markdown file per reachable diagnostic under `packages/typespec-ts/src/diagnostics/`.
- Document the diagnostic's impact, triggering usage, message, and how to fix it.
- Document suppression guidance for warnings where applicable.
- Add a helper in `src/lib.ts` that sets each diagnostic's `docs` source and published `url`.
- Update `.gitignore` to ignore generated TypeSpec TS diagnostic reference pages under `website/src/content/docs/docs/emitters/clients/typespec-ts/reference/diagnostics/`.
- Run `pnpm --filter @azure-tools/typespec-ts regen-docs` and confirm that every diagnostic produces a page without missing-documentation warnings.
- Audit diagnostics without report sites and internal invariant diagnostics. Any removals, `compilerAssert` conversions, or severity changes should be justified independently rather than copied automatically from TCGC.

## Reference

- #4982

Contributor guide

Open the contributing guide

Research direction

Start by comparing the TCGC documentation pattern from #4982, then inspect packages/typespec-ts/src/lib.ts and the diagnostics under packages/typespec-ts/src/diagnostics/. Run pnpm --filter @azure-tools/typespec-ts regen-docs and verify every reachable diagnostic produces a page without missing-documentation warnings. Done includes the .gitignore update and an independently justified audit of diagnostics without report sites and internal invariant diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.