Skip to content

Cleaned up final phantom-dep findings in knip#27952

Merged
9larsons merged 1 commit into
mainfrom
cleanup-phantom-deps-tail
May 18, 2026
Merged

Cleaned up final phantom-dep findings in knip#27952
9larsons merged 1 commit into
mainfrom
cleanup-phantom-deps-tail

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

Summary

Closes out the unlisted-dependencies tail surfaced after PR #27948. After this PR, pnpm knip --include=unlisted reports 0 findings.

  • i18n.js: dropped the /** @type {import('i18next').i18n} */ annotation. i18next isn't a declared dep of ghost/core and adding it just for a type ref isn't warranted — the variable holds require('@tryghost/i18n'), Ghost's own wrapper.
  • sentry-knex-tracing-integration.js: removed the @typedef SentryIntegration and @implements annotations. The Integration type is only exported from @sentry/types, which isn't a direct dep of ghost/core (only @sentry/node is). Replaced with a prose comment.
  • knip.json: added an ignore glob for ghost/core/test/utils/fixtures/themes/**/assets/built/**. Knip was scanning the minified theme fixture bundles and treating their internal ev-emitter references as unresolved imports — false positives.

Test plan

  • pnpm knip --include=unlisted returns 0 findings

Closes out the unlisted-dependencies tail surfaced after PR #27948:

- ghost/core/core/server/services/i18n.js: dropped the
  '/** @type {import("i18next").i18n} */' annotation. i18next isn't a
  declared dep of ghost/core and adding it just for a type ref isn't
  warranted -- the variable holds the result of require('@tryghost/i18n'),
  Ghost's own wrapper.
- ghost/core/core/shared/sentry-knex-tracing-integration.js: removed the
  '@typedef SentryIntegration' and '@implements' annotations. The
  'Integration' type is only exported from '@sentry/types', which isn't a
  direct dep of ghost/core (only '@sentry/node' is). Replaced with a prose
  comment explaining the interface relationship.
- knip.json: added an ignore glob for the built theme bundles in
  ghost/core/test/utils/fixtures/themes/**/assets/built/**. Knip was
  scanning those minified theme fixture files and treating their internal
  'ev-emitter' references as unresolved imports -- false positives.

After this change, 'pnpm knip --include=unlisted' reports 0 findings.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e4155da5-2c4d-4bda-905c-7ffcd6c880ce

📥 Commits

Reviewing files that changed from the base of the PR and between bb2a5de and c5e3b0b.

📒 Files selected for processing (3)
  • ghost/core/core/server/services/i18n.js
  • ghost/core/core/shared/sentry-knex-tracing-integration.js
  • knip.json
💤 Files with no reviewable changes (1)
  • ghost/core/core/server/services/i18n.js

Walkthrough

This PR contains three independent updates across the Ghost codebase. The i18n service module adds debug logging infrastructure for locale change events. The Sentry Knex tracing integration updates its type annotation documentation to clarify dependency constraints rather than using implicit type inference. The Knip configuration is updated to exclude compiled theme fixture assets from static analysis. All changes are localized, low-complexity updates with no alterations to public API surfaces.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: cleaning up phantom-dependency findings reported by the knip tool, which aligns with all three file modifications in the PR.
Description check ✅ Passed The description is well-structured and directly related to the changeset, explaining the rationale for each file modification and the test plan used to verify the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-phantom-deps-tail

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@9larsons 9larsons enabled auto-merge (squash) May 18, 2026 16:11
@9larsons 9larsons merged commit 2d81e13 into main May 18, 2026
44 checks passed
@9larsons 9larsons deleted the cleanup-phantom-deps-tail branch May 18, 2026 16:22
9larsons added a commit that referenced this pull request May 18, 2026
no ref

Third batch of JSDoc-only cleanups, continuing the work from #27948 and
#27952. Repoints another set of stale `import('...')` references that
knip surfaces under unresolved imports — these were never updated when
the referenced packages were internalised into ghost/core's source tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant