chore(deps): upgrade knip to v6 and enable treatConfigHintsAsErrors#212
Conversation
- Upgrade knip from 5.88.1 to 6.14.2 - Enable treatConfigHintsAsErrors in knip config - Remove now-resolved ignoreExportsUsedInFile entries for vue, vue-router, h3, nitropack/*, ofetch, @unhead/vue, and @netlify/nuxt - Fix namespace exports in configurableData.ts to satisfy knip v6 rules - Remove stale prisma-generated-client stub no longer needed
|
Warning Review limit reached
More reviews will be available in 39 minutes and 2 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughBump knip to 6.14.2, enable strict KNIP config hints as errors, remove several framework-provided dependency ignore entries, and add ChangesKnip 6 Upgrade and Configuration Alignment
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
=======================================
Coverage 66.52% 66.52%
=======================================
Files 103 103
Lines 2306 2306
Branches 472 472
=======================================
Hits 1534 1534
Misses 412 412
Partials 360 360
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR upgrades the repository’s dependency analysis tooling to Knip v6, tightens CI feedback by treating config hints as errors, and removes/adjusts workarounds made obsolete by the new Knip resolver behavior.
Changes:
- Upgraded
knipto6.14.2and enabledtreatConfigHintsAsErrors: trueto surface Knip config issues as CI failures. - Simplified
knip.tsby removing several previously-needed framework dependency ignores. - Updated type exports in
shared/types/configurableData.tsand removed an old Prisma-generated-client test stub.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumps knip to v6.14.2. |
pnpm-lock.yaml |
Lockfile updates reflecting Knip v6 and transitive dependency changes. |
knip.ts |
Enables treatConfigHintsAsErrors and removes obsolete ignoreDependencies entries. |
shared/types/configurableData.ts |
Adjusts namespace exports to satisfy Knip v6’s unused-export detection. |
test/__stubs__/prisma-generated-client.ts |
Deletes the Prisma client stub used by tests (currently conflicts with existing test aliasing). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)
test/stubs/prisma-generated-client.ts:1
- This stub file is deleted, but the Vitest/Vite alias still points
#server/database/generated/clienttotest/__stubs__/prisma-generated-client(seevite.config.ts:511). With the file removed, unit tests (and any module importing#server/database/generated/client) will fail module resolution beforevi.mock()can run. Either keep this stub, or update the alias to point at a replacement module (or remove the alias if Prisma client is generated/available in test runs).
shared/types/configurableData.ts:59 export namespace Generalwas changed to a non-exportednamespace General, which meansGeneral.Formis no longer part of this module’s public type exports. If anything outside this file needs to importGeneraltypes, that will now be a breaking change. Also, the inline comment says it is used for type exports, but without exporting the namespace those types are not importable.
// oxlint-disable-next-line no-unused-vars --- Used for type exports only, not imported directly
namespace General {
export interface Form {
prefix: string;
}
}
shared/types/configurableData.ts:109
export namespace Selfmodwas changed to a non-exportednamespace Selfmod, soSelfmod.Unionis no longer exported from this module. If any other module relies onSelfmod.Unionas an exported type (directly or viashared/types/index.ts), that import will now fail. If the intent is to keep these as exported types while satisfying Knip, consider keeping the namespace exported or re-exporting the relevant type under a namedexport type.
// oxlint-disable-next-line no-unused-vars --- Used for type exports only, not imported directly
namespace Selfmod {
type SelfmodKeyHelper<P1 extends string[]> =
`selfmod${Capitalize<P1[0]>}${P1[1] extends string ? Capitalize<P1[1]> : ""}${P1[2] extends string
? Capitalize<P1[2]>
: ""}`;
|
@copilot fix CI checks |
…client to ignoreUnresolved
Fixed the CI failures. The knip check was failing because:
The unit test job failure was unrelated (codecov upload can't find |
- Removed "@netlify/nuxt" from ignoreDependencies - Updated ignoreUnresolved to remove "#server/database/generated/client" - Added comment for "test/__stubs__/prisma-generated-client.ts"
- Remove @netlify/nuxt from ignoreDependencies (knip v6 detects it as used via .nuxt/types/modules.d.ts generated by nuxt prepare) - Remove test/__stubs__/prisma-generated-client.ts from ignoreFiles (knip v6 resolves the Vite alias and treats the stub as used)
Replace the string reference in the conditional modules spread with a static import so knip always detects @netlify/nuxt as used, regardless of whether CI generates .nuxt/types with or without the module. The previous approach relying on ignoreDependencies was fragile - knip v6 config hints depended on whether .nuxt/types/modules.d.ts referenced the package (cache-dependent). Static import is deterministic.
This PR will deploy the following changes to production (`wolfstar.rocks`). **Next version: `v0.7.0`** (current: `v0.6.3`) ### Features - feat(tests): auto-generate ephemeral secrets for CI builds (`fd3a0255`) - feat(semantic-pr): update scopes for PR validation (`2fb7ab56`) - feat(test-secrets): add module for auto-generating CI secrets (`3baf470c`) ### Fixes - fix(auth): refresh Discord OAuth tokens before API calls (#218) (`4dd1e5cf`) - fix(ui): serve Geist and GeistMono from local provider (#214) (`b8f27202`) - fix: improve release workflow and fix release-notes output (#211) (`f7ae44fb`) - fix(package): update node engine requirement to >=24 (`b66e0040`) - fix(ci): resolve failing workflow checks (`face5c43`) ### Other Changes - chore: resolve release PR #217 merge conflicts (#219) (`af83b2af`) - chore: migrate design reference from .atlas to .claude (#216) (`cadf476e`) - chore: remove redundant auto-imported type imports (#213) (`be362fbc`) - chore(deps): upgrade knip to v6 and enable treatConfigHintsAsErrors (#212) (`1ba87ecb`) - chore(deps): update test packages (#206) (`1187f76e`) - chore(ci): pin playwright container image to sha256 digest (#202) (`4eef7689`) - chore: replace create-pr-commit skill with full create-pull-request skill (#201) (`6874c781`) - ci: improve release workflows and permissions (`9839e301`) - ci: enable reuse of existing server in CI environment (`ffa2b640`) - ci: fix browser container digest, version comment, and restore NODE_OPTIONS/secrets (`8fae2422`) - ci: remove NODE_OPTIONS from component and build tests (`728c7951`) - chore: rename codecov file to use correct version (`fba616b7`) - ci: update scopes in semantic PR workflow (`2e2fd6fe`) - ci: remove hardcoded secrets from browser tests (`a7ddfdb0`) - chore: rename `continuous-integration` to `ci` workflow (`0ee01169`) - ci: simplify permissions in release PR workflow (`80c69cad`) - ci: fix all zizmor security analysis findings (`5ebc15ee`) - ci: update reporter configuration for CI environments (`2a6166c6`) - ci: harden GitHub Actions workflows (`2d4600ea`) - chore(pnpm): add minimumReleaseAge and clean up config comments (`729fadb3`) - chore: set package version to 0.0.0 (`afd42056`) ### Uncategorized - revert "fix(ci): resolve failing workflow checks" (`a684d62e`) --- > Merging this PR will: > - Deploy to `wolfstar.rocks` via Netlify > - Create a `v0.7.0` tag and GitHub Release
🔗 Linked issue
N/A
🧭 Context
Knip v6 introduced
treatConfigHintsAsErrorsand resolved several false-positiveignoreExportsUsedInFileworkarounds that were required in v5. This PR upgradesknip to the latest v6 release and cleans up the config accordingly.
📚 Description
knipfrom5.88.1to6.14.2treatConfigHintsAsErrors: trueso config hints surface as CI errorsignoreExportsUsedInFileentries (vue,vue-router,h3,nitropack/*,ofetch,@unhead/vue,@netlify/nuxt) — knip v6correctly resolves these Nuxt/Nitro/Vite virtual imports without workarounds
export namespacetonamespaceinshared/types/configurableData.tsto satisfy knip v6's stricter unused-export detection, with
oxlint-disablecomments since the types are consumed indirectly