feat(cli): export DockerDoctorConfig type and defineConfig helper#33
Merged
Conversation
Users can now type docker-doctor.config.ts either with `satisfies DockerDoctorConfig` (type-only — safe for npx-only projects) or the `defineConfig` identity helper (requires the package as a devDependency). Also fix the config type's `categories` to Partial<Record<…>> — the validator always accepted a subset, and the documented examples were type-invalid under the old full-Record shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docker-doctor.config.tscan now be typed.@docker-doctor/cliexports:DockerDoctorConfig(+RuleCategory) — for the npx-safe pattern:defineConfig— identity helper for projects with the package as a devDependency. Docs call out that it's a runtime import and fails to load without the install, steering npx users tosatisfies.Bug fix folded in
DockerDoctorConfig.categorieswasRecord<RuleCategory, RuleSeverity>— a full record requiring all five categories, which made the documented example (categories: { "Image Size": "off" }) type-invalid. NowPartial<Record<…>>, matching what the validator has always accepted at runtime. Widening only — existing configs stay valid.Docs
Configuration reference gains a "Typed config" section covering both patterns and when to use which; README's config example now uses
satisfies.Testing
ultracite checkclean.defineConfigconfig loads through the real CLI,rulesoverride dropspin-image-version, partialcategories: { "Image Size": "off" }dropsprefer-slim, untouched rules still fire.satisfiesform typechecks against the shipped.d.ts(strict), and an invalid category errors with'Bogus' does not exist in type 'Partial<Record<RuleCategory, RuleSeverity>>'.Changeset: patch bump for
@docker-doctor/cli.🤖 Generated with Claude Code