Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Type-check the TypeScript samples in the docs

未关闭
#201 7 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@An16og 已经在做这个了。

开始于 2026年10月21日。

  • #295 来自 @An16og —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
70/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, node.js, typescript

调研方向

Read CONTRIBUTING.md for the pnpm setup and build steps, then inspect the TypeScript blocks in website/src/content/docs/**/*.mdx and the CI workflow. Add a checker that extracts and type-checks the samples against the built packages, supports // docs-check: skip, and reports file and line; add docs:check to CI and fix flagged samples. Done when pnpm docs:check passes on dev, reports checked and skipped counts, and a deliberately broken sample fails with its location.

由索引模型根据 Issue 内容生成。

描述

documentation hacktoberfest help wanted testing

The docs have 67 typescript code blocks across website/src/content/docs/**/*.mdx, and nothing checks that they still compile against the packages. Past PRs (#52, #135) fixed samples that imported paths that don't exist and called constructors the wrong way; the next API change will break some again without anyone noticing.

What to do

  • Add a script, for example scripts/check-doc-samples.mjs, that pulls every ```typescript block out of the .mdx files, writes each to a temporary `.ts` file, and type-checks them with `tsc --noEmit` against the built packages (`@chatcops/core`, `@chatcops/server`, `@chatcops/widget`).
  • Blocks that are fragments on purpose (a config object on its own, a type signature) can opt out with a // docs-check: skip first line. Keep the opt-outs few, and prefer making a sample complete.
  • Add a docs:check script and run it in CI after the build.
  • Fix the samples it flags.

Acceptance criteria

  • pnpm docs:check runs on dev and passes, with the number of checked and skipped blocks printed
  • Breaking a sample on purpose (put the diff in the PR description) makes it fail with the file and line
  • CI runs it
  • No changeset needed (tooling and docs)

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

主要语言
TypeScript
星标
13
派生
7
平均合并
3 小时 41 分钟
30 天内合并 PR
155

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codercops/chatcops 的其他 Issue

查看 codercops/chatcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。