chore: update knip config & remove unused code#2126
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis PR systematically reduces the public API surface of the codebase by converting numerous exported types, interfaces, functions, and constants to internal declarations. Changes span Vue component types, composables, configuration files, utility modules, and schema definitions. Key modifications include removing export keywords from interfaces in Vue components, making helper functions and environment detection constants private, deleting unused validation schemas, removing the parseBasicFrontmatter utility function, and refactoring knip configuration settings. The CI workflow is also updated with an additional knip command flag for dependency exclusion. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
lunaria/components.ts (1)
144-146: Consider defensive handling for localisation lookup.The non-null assertion on line 146 relies on upstream filtering to guarantee the localisation exists. While the current data flow is safe (the
findis withinmissingFiles.mapwhich only contains files with a matching localisation), a defensive check or early return would guard against future refactoring that might alter the filtering logic.The same pattern appears at lines 177–179, 258, and 285–287.
♻️ Optional defensive pattern
${missingFiles.map(file => { const localization = file.localizations.find( localizationItem => localizationItem.lang === lang, - )! + ) + if (!localization) return '' return html`knip.ts (1)
42-43: Add a brief rationale for these ignores to prevent future false-negative confusion.
ignoreUnresolved/ignoreFileshere are non-obvious and likely intentional; a short inline note will make later clean-ups safer.♻️ Suggested tweak
- ignoreUnresolved: ['#oauth/config'], - ignoreFiles: ['app/components/Tooltip/Announce.vue', 'app/components/UserCombobox.vue'], + /** Nuxt resolution pattern not statically resolved by Knip */ + ignoreUnresolved: ['#oauth/config'], + /** Known Knip false-positives for auto-registered/template-resolved components */ + ignoreFiles: ['app/components/Tooltip/Announce.vue', 'app/components/UserCombobox.vue'],As per coding guidelines "Add comments only to explain complex logic or non-obvious implementations".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5a001bcf-4753-4c9a-a2b0-ac92412153a7
📒 Files selected for processing (19)
.github/workflows/ci.ymlapp/components/Compare/ComparisonGrid.vueapp/components/Package/ListControls.vueapp/components/Select/Field.vueapp/composables/npm/useAlgoliaSearch.tsapp/composables/npm/useNpmSearch.tsapp/composables/useVirtualInfiniteScroll.tsapp/utils/atproto/likes.tsapp/utils/atproto/profile.tsconfig/env.tsknip.tslunaria/components.tsserver/utils/diff.tsshared/schemas/atproto.tsshared/schemas/package.tsshared/schemas/publicUserSession.tsshared/schemas/social.tsshared/schemas/user.tsshared/utils/parse-basic-frontmatter.ts
💤 Files with no reviewable changes (5)
- shared/schemas/social.ts
- shared/schemas/atproto.ts
- shared/schemas/publicUserSession.ts
- server/utils/diff.ts
- shared/utils/parse-basic-frontmatter.ts
🔗 Linked issue
🧭 Context
After adding support for auto-imports in the Nuxt plugin, we can reduce Knip config. This revealed unused code, which is also deleted in this PR.
📚 Description
knip --fix↔ oxlint ↔ remove-unused-vars)--exclude dependenciesfor production mode in CI (for flexible dev/deps division)Please review the removals, let me know what we should restore/ignore!