Skip to content

fix(dx): per-package lint scripts stop existing where they can only mislead (#4276) - #4304

Merged
os-zhuang merged 2 commits into
mainfrom
claude/verify-lint-plugin-resolution-xfi931
Jul 31, 2026
Merged

fix(dx): per-package lint scripts stop existing where they can only mislead (#4276)#4304
os-zhuang merged 2 commits into
mainfrom
claude/verify-lint-plugin-resolution-xfi931

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Closes #4276

问题

在干净 HEAD 上运行 pnpm --filter @objectstack/verify lint(包内 eslint src)报 7 个错,全部是 Definition for rule '@typescript-eslint/no-explicit-any' was not found(本 PR 分支上已复现确认)。

根因:从包目录起跑时 flat-config 向上查找找到根 eslint.config.mjs,配置本身解析正常——但该配置只注册了 TS parser,从未注册 @typescript-eslint 插件。根门禁 pnpm lint = eslint . --no-inline-config,靠 --no-inline-config 忽略源码里遗留的 disable 注释;而包内脚本没带这个 flag,inline 注释被处理,引用的规则不存在,于是必红。

修法(采用 issue 里的第二个方案)

统一只从根跑 lint,删掉 per-package lint 脚本:

  • packages/verify:删除 lint 脚本(7 个报错的直接来源)。
  • packages/clipackages/lint:按 issue 建议 grep 盘点,全仓只有这两个包还带同样的 eslint src 脚本。它们今天能过只是因为 src 里没有 disable 注释——语义上同样偏离门禁(honor inline config vs 门禁的 --no-inline-config),加一条注释就红,一并删除。
  • eslint.config.mjs:在原有 --no-inline-config 说明旁补注了本决定与 scoped 跑法(pnpm exec eslint --no-inline-config packages/verify/src),防止脚本被加回来。

没选第一个方案(包内脚本显式指向根配置)的原因:--config 解决不了问题——配置本来就找得到,缺的是 --no-inline-config;而在三个 package.json 里复制这个 flag 会与根脚本形成漂移,等于维护第二套 lint 方言。

验证

  • pnpm --filter @objectstack/verify lint 干净 HEAD 复现 7 错;cli/lint 独立跑通过(印证"尚未失败但同类")。
  • turbo.json 无 lint task,CI 无任何 job 调用 per-package lint,全仓 grep 无其他引用(packages/lint/package.json 里剩下的 "lint" 命中是 keywords 数组,非脚本)。
  • 修改后:根门禁 pnpm lint 绿;scoped 跑法 pnpm exec eslint --no-inline-config packages/verify/src 绿。

纯 DX 修复,不涉及发布产物行为,无 changeset。


Generated by Claude Code

…islead (#4276)

`pnpm --filter @objectstack/verify lint` (package-local `eslint src`) failed
on a clean HEAD with 7x "Definition for rule '@typescript-eslint/no-explicit-any'
was not found": the standalone run resolves the root flat config, which
registers only the TS parser — never the @typescript-eslint plugin — and,
unlike the root gate (`eslint . --no-inline-config`), honors the orphaned
eslint-disable directives in src, so each one references a rule that does
not exist. cli and lint carried the same script and passed only because
their src has no such directives yet — same divergence, one comment away
from the same red.

No turbo lint task or CI job ever ran these scripts; most packages never had
one. Remove all three and lint only from the root, matching the gate exactly.
The root config now documents the decision and the scoped-run recipe
(`pnpm exec eslint --no-inline-config <dir>`).

Closes #4276

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195He4CTy2BvCVMDTJ6NkVY
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 31, 2026 5:00am

Request Review

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file size/s labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/lint, @objectstack/verify.

20 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via packages/cli)
  • content/docs/api/client-sdk.mdx (via @objectstack/cli)
  • content/docs/api/data-flow.mdx (via @objectstack/cli)
  • content/docs/api/environment-routing.mdx (via @objectstack/cli)
  • content/docs/api/error-catalog.mdx (via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx (via packages/cli, @objectstack/lint)
  • content/docs/deployment/backup-restore.mdx (via @objectstack/cli)
  • content/docs/deployment/cli.mdx (via @objectstack/cli)
  • content/docs/deployment/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx (via packages/cli)
  • content/docs/permissions/authentication.mdx (via @objectstack/cli)
  • content/docs/permissions/authorization.mdx (via @objectstack/lint)
  • content/docs/plugins/packages.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx (via @objectstack/cli, @objectstack/verify)
  • content/docs/releases/v15.mdx (via @objectstack/verify)
  • content/docs/releases/v16.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Jul 31, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 31, 2026 05:35
@os-zhuang
os-zhuang merged commit d4f4f36 into main Jul 31, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the claude/verify-lint-plugin-resolution-xfi931 branch July 31, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/s tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

packages/verify 的 lint 脚本无法独立运行:eslint src 解析不到根 flat-config 的插件

2 participants