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

Nothing checks the message catalogs, or catches new hard-coded text

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
eslint, javascript, json, typescript

调研方向

Start by reviewing the catalog setup and local ESLint plugin introduced in issue #620, then inspect src/messages/*.json, SHIPPED, and the pnpm test and lint configuration. Add fixture coverage for missing keys, ICU syntax, placeholders, unused keys, JSX text, and text bearing props; done means the listed lint, typecheck, knip, and test commands pass. This is step 0.4 of the owner's plan and depends on #620.

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

描述

enhancement pipeline:proposed

Needs your OK: this adds checks on the translation catalogs and lint rules against hard-coded text. Nothing anyone sees changes. Swap pipeline:proposed for pipeline:ready to have it built.

What happens

Once text lives in src/messages/*.json (#620), nothing stops a translation from missing keys, breaking ICU syntax or dropping a {name}. Nothing stops new English being typed straight into a component either.

Fix, in outline

  • A catalog check that pnpm test runs (a unit test over src/messages/, so CI covers it with no workflow change). It checks that:
    • every catalog's completeness is known per namespace against en.json, and each language in SHIPPED is complete for its audience (participant: participant, email, common; organizer: organizer, auth, common; site: site, common);
    • every message compiles with icu-minify, which uses the same ICU parser as use-intl's full formatter;
    • placeholders and tags match the English source;
    • no key is unused.
  • Keys are literal, so the unused-key check can see them. Map enum values to keys through a typed table (const STATUS_KEY = { open: 'status.open', … } as const), never t(`status.${s}`).
  • Lint for hard-coded text:
    • react/jsx-no-literals with noStrings: true, ignoreProps: true for JSX text;
    • a small custom rule, in the local ESLint plugin from #620, that reports a string literal on text-bearing props: aria-label, aria-description, title, placeholder, alt and label.
    • Both are turned on per directory as each area moves to the catalog, starting with none.

Watch for

  • noAttributeStrings doesn't work here. It flags every className and href, and eslint-plugin-react 7.37.5 (what the lockfile resolves) has no per-attribute option.
  • Pin icu-minify as a devDependency at the exact version next-intl resolves, so the check runs the parser production runs.

Order

After #620, because the catalogs, SHIPPED and the local ESLint plugin come from it.

Done when

  • The check fails on a missing key, broken ICU, a dropped placeholder and an unused key (tests with fixture catalogs).
  • The lint rules fail on a fixture with JSX text and one with aria-label="…".
  • pnpm lint && pnpm typecheck && pnpm knip && pnpm test pass.

Planned with the owner in https://claude.ai/code/session_01EFKmj716ZY3b3SwR8TV8Y2 and checked against the code on main at 35288fa. The full plan is private to the owner's account: https://claude.ai/artifact/VgQH6U2s2EVx3LX991fJi8 (a Claude session on that account can open it with the Artifact tool's read action). This is step 0.4 there.

主要语言
TypeScript
星标
19
派生
4
平均合并
19 小时 34 分钟
30 天内合并 PR
165

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

richshaw/OpenSignup 的其他 Issue

查看 richshaw/OpenSignup 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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