Adopted correctnessRules in apps/admin + cleaned 14 violations#28863
Conversation
no ref
apps/admin's standalone ESLint config now spreads correctnessRules from eslint.shared.mjs — matches the rule posture every factory-using workspace already has.
5 curly violations autofixed (single-statement if returns now braced).
5 source fixes:
- nav-content.tsx: count != null → count !== null && count !== undefined (eqeqeq with always — the variable is number | null | undefined)
- 4 console.error calls untouched: workspace overrides 'no-console' to ['error', { allow: ['error', 'warn'] }] since console.error is the conventional browser error sink
Scoped exemptions added to apps/admin/eslint.config.js (mirrors ghost/core's pattern):
- Test files (*.test.{ts,tsx}, *.spec.{ts,tsx}, test-utils/**): no-plusplus + no-promise-executor-return off (renderCount++, await new Promise(r => setTimeout(r, N)) are common test idioms)
- Build scripts at workspace root (*.ts/*.mts/*.cts — vite-backend-proxy.ts, vite-ember-assets.ts, vite.config.ts): no-console + no-promise-executor-return off (Node side, intentional)
The 'ghost/filenames/match-regex' rule from the previous config is now covered by correctnessRules (same rule, same args), so its explicit line is dropped.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx build @tryghost/admin-toolbar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/signup-form |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/announcement-bar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/portal |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/activitypub |
✅ Succeeded | 1s | View ↗ |
nx build @tryghost/comments-ui |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/sodo-search |
✅ Succeeded | <1s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 1m 11s | View ↗ |
Additional runs (5) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-24 15:21:26 UTC
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (5)
WalkthroughThe admin ESLint config now imports and applies Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ptions no ref Dropped the test-files + build-scripts override blocks. The 4 underlying violations they were covering are now fixed in source: - ember-bridge.test.tsx:429 — renderCount++ → renderCount += 1 (no-plusplus) - user-preferences.test.tsx:322 — await new Promise(resolve => setTimeout(...)) → braces wrap (no-promise-executor-return) - vite-backend-proxy.ts:22 — same brace fix (no-promise-executor-return) - vite-ember-assets.ts:85 — already console.warn, allowed by the workspace's existing browser-style no-console override apps/admin's only remaining workspace-level relaxation is the no-console allow: ['error', 'warn'] override — which IS the conventional browser pattern for production code.
no ref Removed the workspace-level no-console allow-list. Every other workspace in the monorepo uses no-console: 'error' with inline // eslint-disable-next-line no-console (or file-level /* eslint-disable no-console */) at each call site. apps/admin now matches. 5 sites get explicit inline disables: shared-views, user-menu, use-onboarding, onboarding-route, vite-ember-assets. Each is visible at the call site as 'yes, console here is intentional' — and reportUnusedDisableDirectives (once flipped) will catch any that go stale.

apps/admin's standalone ESLint config now spreads
correctnessRulesfromeslint.shared.mjs— matches the rule posture every factory-using workspace already has.5
curlyviolations autofixed (single-statementifreturns now braced).5 source fixes (all done in source, no new file-glob exemptions):
nav-content.tsx:count != null→count !== null && count !== undefined(eqeqeq— variable isnumber | null | undefined)ember-bridge.test.tsx:renderCount++→renderCount += 1(no-plusplus)user-preferences.test.tsx:await new Promise(r => setTimeout(r, 25))→ braces wrap (no-promise-executor-return)vite-backend-proxy.ts: same brace fix (no-promise-executor-return)vite-ember-assets.ts:85was alreadyconsole.warn, allowed by the new workspace overrideOne workspace-level override added:
'no-console': ['error', {allow: ['error', 'warn']}]—console.erroris the conventional browser error sink, kept in 4 places (auth fetch catch, sidebar shared-views parse fallback, onboarding error logs).console.logetc. still error.The
ghost/filenames/match-regexrule from the previous config is now covered bycorrectnessRules(same rule, same args), so its explicit line is dropped.