[Good first issue] i18n 审计报告 JSX 属性的实际文案

Open Beginner friendly
#61 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, react, typescript

Research direction

The attribute matching rule lives in scripts/i18n-audit.ts around lines 22-28, and text extraction and filtering around lines 55-75. Run bun scripts/i18n-audit.ts --json against a temporary JSX fixture containing the aria-label, title and placeholder examples from the issue. Done when the report lists all three literals with their file locations, double-quoted and brace-wrapped strings are both detected, and a short fixture covering a t(...) attribute is added with the existing JSON format unchanged.

Written by the indexing model from the issue text.

Description

bug good first issue help wanted

问题与复现

在隔离目录里放入以下 JSX fixture,运行 bun scripts/i18n-audit.ts --json。目前只产生一条 attr 命中,text 为 aria-label。title、placeholder 及对应的可见文案都未出现在结果中。

<>
  <button aria-label={'Remove selected item'} title={'Open review details'} />
  <input placeholder="Search saved studies" />
</>

属性模式把属性名和文案放在不同的捕获组。目前的提取会优先取属性名,并且双引号属性值的形式会漏扫。

在 Windows 和 Bun 1.4.2 上基于 main 的 579395e 验证。

验收标准

  • 审计输出报告三条实际文案及对应文件位置。直接引号和花括号里的字符串字面量都可识别。
  • 用短 fixture 覆盖上述三条,以及一条走 t(...) 的属性,保持现有 JSON 报告格式。

源码起点

认领前可先说明准备完成的范围,再评论 /claim。参与方式见 #7。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
8h 8m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.