Uh oh!
There was an error while loading. Please reload this page.
lint: add repo-root no-console rule - #4725
Conversation
Adds `no-console: ['error', { allow: ['warn', 'error'] }]` to eslint.config.js
so a module- or function-scope console.log/info/debug fails CI instead of
shipping silently, the way `console.log('Registering object-map...')` did in
#7139 (caught only by hand). A full-repo census found 235 real hits under
the originally-delegated exemption list (root scripts/**, examples/**, test
files) -- far past the ~20-hit threshold for absorbing cleanup into the same
PR -- so the fork was reported and a supplemental ruling adjudicated the
resolution implemented here:
- Three additive carve-outs: packages/cli/src/**, packages/create-plugin/src/**
(CLI tools whose entire job is terminal stdout), and examples/** widened to
any depth (packages/types/examples/*.ts alone carried 18 of the 235 hits).
- Line-level eslint-disable + comment on the two files that ARE the repo's
deliberate debug/logger infrastructure: core/src/utils/debug.ts's
debugLog/debugTime/debugTimeEnd (gated behind globalThis.OBJECTUI_DEBUG)
and data-objectstack/src/index.ts's createQuietHttpLogger (a Logger
interface whose methods deliberately forward to console.*).
- The remaining 17 real residue sites individually judged: promoted to
console.warn/console.error where the message diagnoses a real anomaly
(ObjectDataPage's dropped-filter note, DetailView's Share API failure),
deleted everywhere else (happy-path narration with no diagnostic content).
- Updated the one pinned test that asserted the pre-promotion console.debug
call (ObjectDataPage.saveAsViewFilterFold.test.ts) to assert console.warn.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnQd8iMMUwXQEV1crFmQiQThe latest updates on your projects. Learn more about Vercel for GitHub. |
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
commented
Aug 15, 2026
Review verdict: ACCEPT (reviewer of record, PM session Verified against this PR, not the report: seventeen changed files; Will flip ready + enable auto-merge once Lint, Type Check, and Test shards 1–4 conclude Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#4029
What
Adds
no-console: ['error', { allow: ['warn', 'error'] }]to the repo-rooteslint.config.js, so a module- or function-scopeconsole.log/info/debugfails CI instead of shipping silently the wayconsole.log('Registering object-map...')did in #7139 — caught only by ahuman reading the diff, since
pnpm linthad nothing to say about it.Adjudication trail (both rulings on the claim comment thread)
suggested shape, overrides exempting
scripts/**, test files, andexamples/**; measure first, clean a ≤~20-hit mechanical residue in thisPR, report a larger one as a fork instead of absorbing it.
193 (82%) in
packages/cli+packages/create-plugin(CLI tools whoseentire job is stdout), 18 in per-package
examples/dirs theroot-anchored glob never reached, and 24 more including two files that
are the repo's actual debug/logger infrastructure. Reported as
needs_decisionper the ruling's own stop condition instead of guessingat the scope boundary.
three additive, invariant-preserving carve-outs (below), line-level
eslint-disable+ comment on the two debug/logger-infrastructure files(no separate resolution of the debug-channel question, objectui 的 eslint 没开 no-console:模块作用域遗留调试输出没有任何自动化拦网(#7139 靠人工发现) #4029's own Q2,
which stays deliberately unbundled), individually judge the remaining
real residue as delete-vs-promote-to-warn/error, land the rule as
error, full-repopnpm lintgreen.The three additive carve-outs
packages/cli/src/**andpackages/create-plugin/src/**— CLI toolswhose entire job is terminal stdout/stderr. Running a bin is not
"importing a package and getting console noise you didn't ask for" — the
#7139 bug class this rule exists to net. (
@object-ui/cli'sindex.tsdoes re-export
serve/initfor programmatic use, but their consoleoutput is the documented behavior of calling them, not an accidental
module-scope leak.)
**/examples/**widened from the root-anchoredexamples/**— measured18 of the 235 hits in
packages/types/examples/*.tsalone, aper-package examples directory the original glob never reached despite
being the same kind of documentation-code surface as root
examples/**.The two debug/logger-infrastructure carve-outs (line-level, commented)
packages/core/src/utils/debug.ts—debugLog/debugTime/debugTimeEnd, the repo's opt-in debug channel (gated behindglobalThis.OBJECTUI_DEBUG). This IS the facility objectui 的 eslint 没开 no-console:模块作用域遗留调试输出没有任何自动化拦网(#7139 靠人工发现) #4029's own Q2 askedabout — a
eslint-disable-next-line no-consolewith a one-line commentis the resolution for this card; the design question of whether the repo
needs a different debug channel stays open and unbundled.
packages/data-objectstack/src/index.ts'screateQuietHttpLogger— aLogger-interface implementation whose methods deliberately forward to the
matching
console.*method (that IS the function's job).Remaining 17 real residue sites — individually judged
Rule applied consistently: promote to
console.warn/console.erroronly where the message diagnoses a real anomaly (matches the pre-existing
house convention in
plugin-map/src/ObjectMap.tsxandcore/src/registry/Registry.ts); delete pure success/placeholdernarration that explains nothing going wrong.
Promoted (2):
packages/app-shell/src/views/ObjectDataPage.tsx:142—console.debug→console.warn. Explains a real anomaly: a saved-view URL filter wassilently dropped because it has no canonical
ViewFilterRuleform.packages/plugin-detail/src/DetailView.tsx:690—console.log→console.errorinside a.catch(). A real Web Share API failure, notdebug noise.
Deleted (15) — all confirmed to be happy-path narration with no diagnostic
content:
apps/site/app/components/ObjectUIProvider.tsx:25— removed the wholesetTimeoutblock (its only purpose was this log); the now-unusedComponentRegistryimport is removed too.packages/fields/src/widgets/MasterDetailField.tsx:46—handleViewstub; param renamed
_itemper the repo's existingargsIgnorePattern: '^_'convention.packages/plugin-detail/src/DetailView.tsx:694— redundant "Link copiedto clipboard" success log.
packages/plugin-gantt/demo/main.tsx:599,601— demo-onlyonLayoutChange/onTaskClickecho logs (this file isdemo/, notsrc/, so it carries no changeset).packages/runner/src/App.tsx:94,99— loader-selection debug prints(emoji-prefixed, informal style inconsistent with the house
[Component]-prefixed diagnostic convention).packages/runner/src/LayoutRenderer.tsx:309— an unwired// Handle click logicstub's log.packages/runner/src/lib/mockDataSource.ts:23,38,63—find/create/getObjectSchemaper-call narration in the demo mock adapter; unusedparams renamed
_resource/_paramsper the file's own existingconvention (see
findOne/update/deletealready using it).packages/sdui-parser/scripts/gen-manifest.ts:26— build-completionmessage in an unwired,
dist-excluded dev script (scripts/here is aper-package dir, not root
scripts/**, so no changeset is required —the change is outside every published package's
src/).packages/sdui-parser/verify.ts:23,74— a standalonetsx-runverification script's per-check "ok" line and final "N checks passed"
summary; its
assert.*calls still throw on a real failure regardless,so the tool's actual verification value is unaffected. Same "not under
src/, no changeset" note asgen-manifest.ts.packages/vscode-extension/src/extension.ts:21— "extension is nowactive!" activation log.
Changesets
.changeset/no-console-lint-rule.md— patch for the five publishedpackages with a real behavior change (
@object-ui/app-shell,@object-ui/fields,@object-ui/plugin-detail,@object-ui/runner,object-ui)..changeset/no-console-debug-infra-comments.md— empty frontmatter for@object-ui/coreand@object-ui/data-objectstack(comment-only,zero behavior change).
packages/plugin-ganttand@object-ui/sdui-parsercarry no changeset:every file touched in each (
demo/main.tsx;scripts/gen-manifest.ts,verify.ts) sits outside that package'ssrc/, which is the guardedsurface
scripts/check-changeset-presence.mjsuses by design (see thatscript's own header on why
src/**only).node scripts/check-changeset-presence.mjs— passes.Verification
/tmp/os-heavy-verify.lock; commands and counts are in the linked issuecomment / dev report.
pnpm exec eslint .— 0 errors, 10353 pre-existing warnings unrelated tothis change (previously 235
no-consolehits before this PR's per-sitecleanup), confirmed green at HEAD
ab8d59d08(this PR's tip).console.log(...)topackages/core/src/index.ts(not committed), confirmedpnpm exec eslint packages/core/src/index.tsgoes red with exactly theexpected
no-consolemessage, then reverted (git diffemptyafterward).
pnpm --filterrun type-check, package name substituted — green for all nine touchedpackages (
app-shell,core,data-objectstack,fields,plugin-detail,plugin-gantt,runner,sdui-parser,object-ui/vscode-extension).pnpm exec vitest runscoped to the touched packages pluspackages/plugin-map/src/index.registration.test.tsx(the sibling"import must not write console noise" pin from fix(plugin-map): 删掉模块作用域遗留的 console.log('Registering object-map...') (objectstack#7139) #4007/#7139), run in two
passes: 618 test files / 7628 tests for
app-shell+core+data-objectstack+fields(1 pre-existing pinned test initially failed—
ObjectDataPage.saveAsViewFilterFold.test.tsasserted the pre-promotionconsole.debugcall; fixed to assertconsole.warnand re-verifiedgreen), and 86 test files / 806 tests for
plugin-detail+runner+the
plugin-mappin, all green includingregisters its components without printing to the console.node scripts/check-changeset-presence.mjsandnode scripts/check-changeset-no-major.mjs— both green.Generated by Claude Code