fix(cli): hide platform i18n baseline from os lint by default#3102
Merged
Conversation
A fresh create-objectstack project reported 800+ errors out of the box, every one i18n/missing-metadataForm — translation keys for platform built-in metadata forms collected from the static registries (DEFAULT_METADATA_TYPE_REGISTRY + METADATA_FORM_REGISTRY). The platform packages already ship those translations at runtime, so for a user project they are pure noise that drowns the user's own i18n signal (15.1 third-party eval, P2). - fold i18n coverage through foldCoverageIssues(): metadataForm-source issues are hidden by default and counted - new --include-platform flag surfaces them for a full audit - human output gains a dim summary line; --json gains hiddenPlatform - user-authored coverage (object/field/view/action) reported unchanged Verified against a real scaffold: stock CLI 821 errors -> patched CLI 4 user-signal errors + 'platform built-ins: 817 i18n issue(s) hidden', --include-platform restores 821, --json reports hiddenPlatform: 817. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题(15.1 第三方评估 P2 #2)
os lint在 create-objectstack 新项目上开箱报 848 个错误(现版 821),全部是i18n/missing-metadataForm—— 平台内置元数据表单(email_template 等)的翻译键,来自 lint 无条件遍历静态注册表(DEFAULT_METADATA_TYPE_REGISTRY+METADATA_FORM_REGISTRY)。这些翻译平台包(packages/platform-objects的 4 个 locale bundle)在运行时本来就提供,对用户项目纯属噪声,把用户自己的 lint 信号完全淹没。修复
「给平台补翻译」不适用——翻译已存在,只是 lint 把平台基线错算到用户项目头上。故收敛 lint 作用域:
foldCoverageIssues():source === 'metadataForm'(lint 时唯一且充分的平台判据,静态注册表遍历是它唯一来源)的问题默认隐藏并计数--include-platform恢复全量审计platform built-ins: N i18n issue(s) hidden — rerun with --include-platform to audit them--json输出加hiddenPlatform字段真机验证(脚手架新项目)
npx os lintplatform built-ins: 817 i18n issue(s) hidden--include-platform--jsonhiddenPlatform: 817,total: 4单测:新增
lint-platform-fold.test.ts;pnpm --filter @objectstack/cli test516 → 519 全绿(新增 lint-platform-fold 3 例);tsc build 干净。注:blank 模板自身还有 4 条真实的用户侧 i18n 缺口(模板不带翻译 bundle),属于另一个模板 DX 问题,不在本 PR 扩散——已单独记 issue。
🤖 Generated with Claude Code