fix(dx): per-package lint scripts stop existing where they can only mislead (#4276) - #4304
Merged
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 20 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0195He4CTy2BvCVMDTJ6NkVY
os-zhuang
marked this pull request as ready for review
July 31, 2026 05:35
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.
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/cli、packages/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独立跑通过(印证"尚未失败但同类")。linttask,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