Skip to content

feat(konsistent): validate schemas for declared and exported type definitions#61

Merged
felixarntz merged 2 commits into
mainfrom
fa/type-schema-validation
Jul 20, 2026
Merged

feat(konsistent): validate schemas for declared and exported type definitions#61
felixarntz merged 2 commits into
mainfrom
fa/type-schema-validation

Conversation

@felixarntz

Copy link
Copy Markdown
Collaborator

Pull Request Description

Adds schema validation to exportTypes and declareTypes, allowing conventions to enforce structural constraints on local TypeScript type aliases and interfaces.

  • Supports schema for declared and exported type definitions while keeping it mutually exclusive with from
  • Enforces declaration-specific object semantics: configured properties must exist, required properties must be non-optional, and other configured properties must be optional
  • Allows partial object validation unless additionalProperties is explicitly false
  • Adds unit and end-to-end coverage for valid partial schemas and missing-property failures
  • Updates the documentation and generated configuration schemas

Relevant technical choices

Type schemas reuse the existing schema matcher and parsed type-shape representation. Validation intentionally applies only to local definitions and does not resolve re-exports, named references, inheritance, or composed types.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated
  • A changeset has been added (run pnpm changeset in the project root if package files were modified)
  • I have reviewed this pull request (self-review)

@felixarntz
felixarntz merged commit 8455569 into main Jul 20, 2026
7 checks passed
@felixarntz
felixarntz deleted the fa/type-schema-validation branch July 20, 2026 17:06
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