Skip to content

Commit

Permalink
fix(core): #131 type error if declaration is set to true in tsconfig
Browse files Browse the repository at this point in the history
Do now show type errors on defineConfig, if declaration is set to true in the tsconfig.
We export all zod types to fix the type error.
See microsoft/TypeScript#42873
  • Loading branch information
sdorra committed Jul 11, 2024
1 parent 4c490e1 commit c4c9044
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-stingrays-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@content-collections/core": patch
---

Do now show type errors on defineConfig, if declaration is set to true in the tsconfig.
5 changes: 5 additions & 0 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { Parser, Parsers } from "./parser";
import { CacheFn } from "./cache";
import { NotSerializableError, Serializable } from "./serializer";

// Export all zod types to fix type errors,
// if declaration is set to true in tsconfig.json.
// @see https://github.com/microsoft/TypeScript/issues/42873
export type * from "zod";

export type Meta = {
filePath: string;
fileName: string;
Expand Down

0 comments on commit c4c9044

Please sign in to comment.