-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add docs files #4078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs files #4078
Conversation
|
Deployment failed with the following error: |
WalkthroughThis update introduces a comprehensive set of new documentation files for the Zod library. The changes cover detailed guides on schema definitions, basic usage, ecosystem integrations, error customization and formatting, and the use of TypeScript generics and type inference. New pages also address JSON Schema conversion, metadata handling through registries, and a migration guide for Zod 4, along with documentation for various packages including the core library, a mini variant, and the main API. Additionally, metadata configuration and sample test components enhance documentation structure and navigation. Changes
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (49)
packages/docs/content/test.mdx (2)
6-10: Code Block Clarity and Context
The JavaScript code block is syntactically correct and clearly demonstrates a simpleconsole.logstatement. For enhanced documentation value, consider adding a brief explanation or caption near the code block to clarify the purpose of this snippet in the context of JSON components.
18-18: Cleanup of Trailing Content
There appears to be an extra newline at the end of the file. For a cleaner file structure and consistency with other documentation files, consider removing any unnecessary trailing whitespace.packages/docs/content/object-vs-interface.mdx (1)
6-6: Potential Stray ContentA lone “6” appears on line 6. If this isn’t intentional content, please remove it to keep the document clean.
packages/docs/content/meta.json (1)
1-22: Documentation Metadata OrganizationThis JSON file clearly organizes the documentation pages into sections and uses string markers (e.g.
"---Beta---") to delineate groups. Verify that these markers are handled as expected by the documentation system. If they serve only as internal dividers, adding a brief comment or moving them to a separate config might improve clarity.packages/docs/content/type-inference.mdx (2)
5-5: Minor Stylistic SuggestionThere is an extra space before the period in the sentence on line 5. Consider removing it for consistency.
15-18: Punctuation ConsistencyIn the explanatory text on line 17, consider adding a comma after “For instance” to improve readability.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~17-~17: A comma might be missing here.
Context: ...les ``` What about transforms? In reality each Zod schema internally tracks **two...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[typographical] ~17-~17: After the expression ‘for example’ a comma is usually used.
Context: ... mix, these two values can diverge. For instance `z.string().transform(val => val.length...(COMMA_FOR_EXAMPLE)
packages/docs/content/json-schema.mdx (6)
122-125: Commented Pipes SectionThe commented-out section describing pipes is informative. If it isn’t intended for final rendering, consider removing it or converting it to active documentation to avoid confusion.
🧰 Tools
🪛 LanguageTool
[duplication] ~124-~124: Possible typo: you repeated a word.
Context: ... {/* ### Pipes Pipes contain and input and and output schema. Zod uses the *output sch...(ENGLISH_WORD_REPEAT_RULE)
173-245: Commented Table ReferenceThe large commented-out table provides a useful reference for supported options. Consider converting this into a rendered markdown table if it is intended for end-user reference, or remove it if obsolete.
384-397: Override Function ExampleThe override example illustrates how to modify the generated JSON Schema. Note the typo “dircectly” on line 387—it should read “directly”.
400-411: Pipes Option ExampleThe examples for the pipes option show how to extract either the output or input schema using
pipe: "input". Also, the description contains a duplicate “and” (“input and and output schema”); please correct this to “input and output schema.”
413-420: URI Customization ExampleThe code block for the
urioption starts an example for customizing external$refURIs but appears incomplete. Verify whether this block should be completed or removed.🧰 Tools
🪛 LanguageTool
[duplication] ~418-~418: Possible typo: you repeated a word.
Context: ...###pipes` Pipes contain an input and and output schema. By default the result of...(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~418-~418: Did you mean: “By default,”?
Context: ...contain an input and and output schema. By default the result ofz.toJSONSchemarepresen...(BY_DEFAULT_COMMA)
421-894: Commented Accordion SectionsSeveral large Accordion sections and additional commented-out examples follow. Confirm whether these commented sections are intended to remain in the source file or if they should be cleaned up to avoid confusion in the final documentation.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~433-~433: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts anidto a fully-qualified URI. ```ts const myRegistry = z.regist...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~860-~860: Did you mean: “By default,”?
Context: ...try will be extracted intoschemas. By default the$refURIs are relative paths like...(BY_DEFAULT_COMMA)
[uncategorized] ~861-~861: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts anidto a fully-qualified URI. ```ts z.toJSONSchema(z.globalRegi...(HYPHENATED_LY_ADVERB_ADJECTIVE)
packages/docs/content/generic-functions.mdx (2)
39-40: Result PresentationThe sentence “The Result is now fully and properly typed…” could benefit from using a lowercase “result” for consistency.
53-54: Explanation of Type Inference IssueThe explanation notes that TypeScript “is treating” the schema as a generic
ZodTypeAny. For stylistic consistency, consider rephrasing this to “treats” instead.🧰 Tools
🪛 LanguageTool
[uncategorized] ~54-~54: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...e to how TypeScript inference works, it is treatingschemalike aZodTypeAnyinstead of...(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
packages/docs/content/packages/zod.mdx (1)
30-30: Grammar Improvement: Pluralize "instance"
Consider changing "All instance ofZodTypeimplement the following methods:" to "All instances ofZodTypeimplement the following methods:".🧰 Tools
🪛 LanguageTool
[uncategorized] ~30-~30: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...from@zod/core. All instance ofZodTypeimplement the following me...(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
packages/docs/content/index.mdx (1)
54-64: Optional Refactor: Remove Commented-out Code
There is a commented-out block of<ParamField>components (lines 54–64). If these are not intended for end-user documentation, consider removing them to keep the file clean.packages/docs/content/error-customization.mdx (1)
295-297: Style Suggestion: Refine Note on Locale Loading
The note currently reads:Note — The
zodlibrary automatically loads theenlocale automatically. The@zod/minipackage does not load any locale; instead all error messages default toInvalid input.Consider revising it to:
Note — The
zodlibrary automatically loads theenlocale. The@zod/minipackage does not load any locale; instead, all error messages default toInvalid input.This change removes the duplicate adverb "automatically" and adds a comma for clarity.
Proposed diff:
- The `zod` library automatically loads the `en` locale automatically. The `@zod/mini`package does not load any locale; instead all error messages default to `Invalid input`. + The `zod` library automatically loads the `en` locale. The `@zod/mini` package does not load any locale; instead, all error messages default to `Invalid input`.🧰 Tools
🪛 LanguageTool
[style] ~296-~296: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...ary automatically loads theenlocale automatically. The@zod/minipackage does not load a...(ADVERB_REPETITION_PREMIUM)
[uncategorized] ~296-~296: Possible missing comma found.
Context: .../minipackage does not load any locale; instead all error messages default toInvalid ...(AI_HYDRA_LEO_MISSING_COMMA)
packages/docs/content/v4/index.mdx (10)
27-30: Fix double determiner in sentence.
In the sentence “With luck, it will serve a the new foundation for many more years to come”, remove the extra determiner. Consider rephrasing to “serve as the new foundation” or “serve a new foundation”.🧰 Tools
🪛 LanguageTool
[grammar] ~29-~29: Two determiners in a row. Choose either “a” or “the”.
Context: ...ns-%2B1-desc). With luck, it will serve a the new foundation for many more years to c...(DT_DT)
245-246: Refine punctuation in benchmark explanation.
In the benchmark section where it reads “In Zod 3, this took4000msto compile; and adding additional calls to.extend()…”, replace the semicolon with a comma (e.g. “4000ms to compile, and adding …”) for improved readability.🧰 Tools
🪛 LanguageTool
[typographical] ~245-~245: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ... In Zod 3, this took4000msto compile; and adding additional calls to.extend()would t...(CONJUNCTION_AFTER_SEMICOLON)
331-335: Insert comma after introductory phrase.
In the “Exact(er) optional properties” section, consider adding a comma after the introductory phrase to improve clarity. Also, review the repetitive sentence beginnings and consider varying the structure.🧰 Tools
🪛 LanguageTool
[typographical] ~331-~331: It is considered good style to insert a comma after introductory phrases with dates or proper nouns.
Context: ... ### Exact(er) optional properties In TypeScript a property can be "optional" in two dis...(IN_NNP_COMMA)
377-377: Add missing comma.
A comma appears to be missing in this section. Please review the sentence and insert proper punctuation where needed.🧰 Tools
🪛 LanguageTool
[typographical] ~377-~377: It seems that a comma is missing.
Context: ...-in API. ### True recursive types But wait there's more! After implementing `z.int...(WAIT_COMMA)
420-420: Reconsider compound modifier punctuation.
The phrase “strongly-typed metadata” might be better rendered as “strongly typed metadata” (removing the hyphen) per style guidelines for adverbs ending in “ly”.🧰 Tools
🪛 LanguageTool
[uncategorized] ~420-~420: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...od 4 introduces a new system for adding strongly-typed metadata to your schemas. Metadata isn'...(HYPHENATED_LY_ADVERB_ADJECTIVE)
559-559: Simplify expression.
Consider replacing “by all means” with a more concise alternative (for example, “simply continue using”) to reduce wordiness.🧰 Tools
🪛 LanguageTool
[style] ~559-~559: ‘by all means’ might be wordy. Consider a shorter alternative.
Context: ...f you are using that package currently, by all means continue using it. Zod now implements...(EN_WORDINESS_PREMIUM_BY_ALL_MEANS)
599-599: Streamline expression for conciseness.
Rephrase “At the moment this isn't configurable; this may change in the future” to “Currently, this isn’t configurable but may change in the future” for a more concise tone.🧰 Tools
🪛 LanguageTool
[style] ~599-~599: For conciseness, consider replacing this expression with an adverb.
Context: ...d string → at favoriteNumbers[1] ``` At the moment this isn't configurable; this may chang...(AT_THE_MOMENT)
681-681: Insert comma after “Similarly”.
Add a comma after “Similarly” to improve the readability of the sentence in that section.🧰 Tools
🪛 LanguageTool
[uncategorized] ~681-~681: A comma may be missing after the conjunctive/linking adverb ‘Similarly’.
Context: ...] z.uint32(); // [0, 4294967295] ``` Similarly the followingbigintnumeric formats ...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
691-691: Reduce intensifier and check abbreviation punctuation.
Consider removing “very” from “very simple” to streamline the text, and ensure that abbreviations (e.g. “etc.”) include the proper period.🧰 Tools
🪛 LanguageTool
[style] ~691-~691: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...he existingz.coerce.boolean()API is very simple: falsy values (false,undefined, `n...(EN_WEAK_ADJECTIVE)
[style] ~691-~691: In American English, abbreviations like “etc.” require a period.
Context: ...,undefined,null,0,"",NaNetc) becomefalse, truthy values become `...(ETC_PERIOD)
780-780: Correct phrase for grammatical accuracy.
Revise “in a couple ways” to “in a couple of ways” to maintain proper grammatical form.🧰 Tools
🪛 LanguageTool
[grammar] ~780-~780: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...minated union support has improved in a couple ways. First, you no longer need to specify t...(PLENTY_OF_NOUNS)
packages/docs/content/ecosystem.mdx (1)
17-17: Enhance the request for contributions.
Consider adding “please” before “let me know [on Twitter]” to make the call for contributions sound more inviting.🧰 Tools
🪛 LanguageTool
[style] ~17-~17: This expression usually appears with a “please” in front of it.
Context: ... built a tool or library on top of Zod, let me know [on Twitter](https://twitter.com/colinh...(INSERT_PLEASE)
packages/docs/content/packages/core.mdx (4)
51-51: Fix duplicate word.
Remove the duplicate “release” in “the first stable release release of Zod 4.”🧰 Tools
🪛 LanguageTool
[duplication] ~51-~51: Possible typo: you repeated a word.
Context: ...rding to semver). Once the first stable release release of Zod 4, at which pointv1.0.0will ...(ENGLISH_WORD_REPEAT_RULE)
55-55: Eliminate word repetition.
There is a duplicate “first” in “you first first look into [Standard Schema]”. Please remove the extra occurrence.🧰 Tools
🪛 LanguageTool
[duplication] ~55-~55: Possible typo: you repeated a word.
Context: ...Zod schemas (say, an API framework) you first first look into [Standard Schema](https://sta...(ENGLISH_WORD_REPEAT_RULE)
59-59: Add missing article for clarity.
Consider adding “the” before “Standard Schema won’t be sufficient” to enhance grammatical clarity.🧰 Tools
🪛 LanguageTool
[uncategorized] ~59-~59: You might be missing the article “the” here.
Context: ...ty (say, introspecting the schema) then Standard Schema won't be sufficient. In this cas...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
76-76: Consider inserting a missing comma.
Review the sentence discussing peer dependencies to see if a comma would improve readability (e.g. after the descriptive phrase).🧰 Tools
🪛 LanguageTool
[uncategorized] ~76-~76: A comma might be missing here.
Context: ...cy lets users "bring-their-own-Zod". As written this allows the user to use any0.x.y...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
packages/docs/content/metadata.mdx (1)
13-14: Revise compound modifier punctuation.
In the line “Registries are collections of schemas, each associated with some strongly-typed metadata…”, consider removing the hyphen to read “strongly typed metadata” per style guidelines.🧰 Tools
🪛 LanguageTool
[uncategorized] ~14-~14: The hyphen in strongly-typed is redundant.
Context: ... of schemas, each associated with some strongly-typed metadata. To create a simple registry:...(ADVERB_LY_HYPHEN_FIX)
packages/docs/content/packages/mini.mdx (3)
7-7: Simplify wording.
Consider rephrasing “the exact same functionality aszod” to “the same functionality aszod” to reduce redundancy.🧰 Tools
🪛 LanguageTool
[style] ~7-~7: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...the release of Zod 4. It implements the exact same functionality aszod, but using a *fu...(EN_WORDINESS_PREMIUM_EXACT_SAME)
62-62: Insert comma for clarity.
Add a comma after “Instead” in the sentence “Instead you pass these checks into schemas using the.check()method” to improve readability.🧰 Tools
🪛 LanguageTool
[uncategorized] ~62-~62: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: .../mini` such methods aren't implemented. Instead you pass these checks into schemas usin...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
141-145: Review punctuation in locale section.
In the default locale section, ensure the sentence “This means, by default themessageproperty of all issues will simply read ‘Invalid input’.” is correctly punctuated—consider whether a comma is needed after the introductory phrase.🧰 Tools
🪛 LanguageTool
[uncategorized] ~145-~145: Possible missing comma found.
Context: ...r otherwise customized. This means, by default themessageproperty of all issues wi...(AI_HYDRA_LEO_MISSING_COMMA)
packages/docs/content/v4/changelog.mdx (4)
293-305: ISO Datetime Validation SectionThe ISO datetime examples (approximately lines 293–305) demonstrate how to use the
z.iso.datetime()API along with options (such asoffset: trueand precision settings). Consider reviewing the punctuation (for example, ensuring any missing commas are added) to improve clarity.
121-140: Streamlined Issue Formats ExplanationThe “updates issue formats” portion provides a very thorough mapping from legacy Zod 3 issue types to their Zod 4 counterparts. The examples and type listings help clarify the changes. Please review the grammar and punctuation (per the static analysis hints) for additional polish.
178-190: Clarification on Error Map Precedence ChangesThe explanation of the new error map precedence (lines 178–190) benefits from clear side‑by‑side code examples. It would be helpful to explicitly state that the contextual error passed to
.parse()no longer overrides the schema‑level error.
1-2613: Overall Migration Guide Documentation QualityThis migration guide is highly comprehensive. It explains almost every breaking change between Zod 3 and Zod 4 with extensive examples (using Tabs, Callouts, and Accordions) that help clarify how to adapt to the new APIs. Please address minor stylistic issues (e.g. wordiness, punctuation, and consistency) as noted by static analysis.
🧰 Tools
🪛 LanguageTool
[style] ~46-~46: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...l sorts of footguns (they can't be used in conjunction witherrorMap) and do not align with Zod's...(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~194-~194: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...thod onZodErrorhas been deprecated. Instead use the top-levelz.treeifyError()fu...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~198-~198: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...onZodErrorhas also been deprecated. Instead use the top-levelz.treeifyError()fu...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~332-~332: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... This has been long deprecated in Zod 3 and it now removed in Zod 4. There is no di...(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~332-~332: Did you mean “its” (the possessive pronoun)?
Context: ...his API. There were lots of footguns in it's implementation, and it's use is general...(ITS_PREMIUM)
[grammar] ~332-~332: Did you mean to use the possessive pronoun “its”?
Context: ...of footguns in it's implementation, and it's use is generally an anti-pattern. ### ...(IT_S_ITS)
[misspelling] ~332-~332: This word is normally spelled as one.
Context: ...mentation, and it's use is generally an anti-pattern. ### changesz.unknown()optionality...(EN_COMPOUNDS_ANTI_PATTERN)
[grammar] ~446-~446: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...nement functions could still narrow the type of a schema. This wasn't documented but was ...(KIND_OF_A)
[uncategorized] ~458-~458: Loose punctuation mark.
Context: ...4: stillunknown``` ##z.ostring(), etc dropped The undocumented convenien...(UNLIKELY_OPENING_PUNCTUATION)
[style] ~458-~458: In American English, abbreviations like “etc.” require a period.
Context: ... stillunknown``` ##z.ostring(), etc dropped The undocumented convenience m...(ETC_PERIOD)
[uncategorized] ~575-~575: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...enericDefhas been entirely removed. Instead the base class now only tracksOutput...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[style] ~575-~575: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others.
Context: ...z.ZodTypeto behave more intuitively in many cases. ```ts const inferSchema<T extends z.Z...(IN_MANY_STYLE_CASES)
[style] ~605-~605: In American English, abbreviations like “etc.” require a period.
Context: ...class, plus$ZodString,$ZodNumber, etc), utility functions/types, issue types ...(ETC_PERIOD)
[style] ~611-~611: In American English, abbreviations like “etc.” require a period.
Context: ...class, plus$ZodString,$ZodNumber, etc), utility functions/types, issue types ...(ETC_PERIOD)
[typographical] ~613-~613: Consider adding a comma here.
Context: ... error class ($ZodError). As you can see these things are all prefixed with$...(AS_YOU_CAN_SEE_COMMA)
[style] ~654-~654: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ... // => "12" ``` This is primarily used in conjunction withZodPipe. The `.transform()` method no...(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
packages/docs/content/error-formatting.mdx (3)
51-75:z.treeifyError()SectionThis section explains how to use the
z.treeifyError()utility to convert a complex error into a nested structure. The code block (lines 57–75) is easy to follow. A small nitpick: you might consider rephrasing the accompanying explanatory text to avoid repeating the word “errors” too many times.
108-144: Deprecatedz.formatError()DocumentationThe section (lines 108–144) clearly marks
z.formatError()as deprecated and provides a detailed example showing its output format. The use of an Accordion to hide the extended example is very user‑friendly. It may help to add a brief note recommending migration toz.treeifyError().
1-183: Overall Error Formatting DocumentationThis file offers a comprehensive overview of the various error formatting utilities in Zod, along with clear examples that show the differences between the available APIs. Minor stylistic adjustments (as per static analysis recommendations) will help further polish the document.
🧰 Tools
🪛 LanguageTool
[style] ~8-~8: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ...d correctness in its error reporting. In many cases, it's helpful to convert the `$ZodError...(IN_MANY_STYLE_CASES)
[uncategorized] ~77-~77: The preposition “on” seems more likely in this position.
Context: ...n easily access the errors that occured at a particular path. Theerrorsfield c...(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[formatting] ~87-~87: Did you mean “?”
Context: ...`` > Be sure to use optional chaining (?.) to avoid errors when accessing nested...(MULTIPLE_PUNCTATION_MARKS_1)
packages/docs/content/api.mdx (6)
1-9: Introduction and Frontmatter for API DocumentationThe initial section (lines 1–9) provides clear frontmatter, a descriptive title (“Defining schemas”), and a brief introduction to schema validation. There is a minor wording issue in line 9 (“complex. nested objects”)—consider removing the period for smooth reading.
35-44: Coerced Schema ExampleThe code example (lines 35–44) demonstrating how coerced values are parsed is clear. It may be helpful to add a brief note about how coercion can affect type safety to set proper expectations.
292-317: ISO Datetime ValidationThe examples for validating ISO datetimes (lines 292–317) are thorough and demonstrate default behaviors (e.g. no timezone offsets) as well as how to enable offsets and control precision. A slight punctuation review (e.g. adding missing commas) is recommended.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~307-~307: Possible missing comma found.
Context: ...00"); // ❌ (no offsets allowed) ``` To allow Timezone offsets can be allowed by sett...(AI_HYDRA_LEO_MISSING_COMMA)
682-697: Customizingz.stringbool()OptionsThe customization examples for
z.stringbool()(lines 682–688 and 690–697) effectively show how to override the default truthy/falsy values and set case‑sensitivity. Please change “Be default” to “By default.”
1906-2041: Advanced Refinement TechniquesThis extended section covers the now‑deprecated
.superRefine()API (with a callout warning) and provides an in‑depth explanation of the more versatile.check()API. The examples are comprehensive; consider streamlining some code comments to enhance readability.🧰 Tools
🪛 LanguageTool
[misspelling] ~1907-~1907: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...in sequence, even if one of them causes an validation error. This is usually desir...(EN_A_VS_AN)
[uncategorized] ~1935-~1935: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }, { "code": "custom", "message": "Must...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~1966-~1966: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }] ``` To customize the e...(UNLIKELY_OPENING_PUNCTUATION)
1-2639: Overall API Documentation for Defining SchemasThis file is an exhaustive and well‑organized reference for defining all types of schemas in Zod. The use of tabs, callouts, and detailed code examples makes it very user‑friendly. Please address the minor nitpicks regarding punctuation, phrasing (e.g. “complex. nested objects” should be “complex nested objects”), and the “colos” typo noted earlier.
🧰 Tools
🪛 LanguageTool
[style] ~140-~140: Consider removing “of” to be more concise
Context: ...sWith("fourscore")) ``` All of the APIs documented below support the `erro...(ALL_OF_THE)
[uncategorized] ~307-~307: Possible missing comma found.
Context: ...00"); // ❌ (no offsets allowed) ``` To allow Timezone offsets can be allowed by sett...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~577-~577: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...``` You can also pass in an externally-declared TypeScript enum. Zod 4 ...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[grammar] ~860-~860: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...et's run through them. */} There are a couple ways in which a key can be "optional" in Typ...(PLENTY_OF_NOUNS)
[duplication] ~883-~883: Possible typo: you repeated a word.
Context: ...ect()API can only representA. When an an optional schema (e.g.z.string().optio...(ENGLISH_WORD_REPEAT_RULE)
[misspelling] ~901-~901: Did you mean “side effect” (=adverse effect, unintended consequence)? Open compounds are not hyphenated.
Context: ...: string | undefined; } ``` As a happy side-effect of this newz.interface()API, it's p...(AFFECT_EFFECT)
[grammar] ~1213-~1213: The verb ‘make’ seems to be in the wrong form here.
Context: ...nvenience, Zod provides a dedicated API for make some or all properties optional, inspir...(FOR_VB)
[uncategorized] ~1338-~1338: Did you mean: “By default,”?
Context: ... {/* ###.passthroughBy default Zod object schemas strip out unrecogniz...(BY_DEFAULT_COMMA)
[style] ~1354-~1354: Consider using a more polite wording.
Context: ... has been stripped ``` Instead, if you want to pass through unknown keys, use `.pas...(IF_YOU_WANT)
[uncategorized] ~1365-~1365: Did you mean: “By default,”?
Context: ...an", extraKey: 61 } ``` ###.strictBy default Zod object schemas strip out unrecogniz...(BY_DEFAULT_COMMA)
[style] ~1447-~1447: In American English, abbreviations like “etc.” require a period.
Context: ...ct APIs (pick, omit, required, partial, etc) work as you'd expect. <A...(ETC_PERIOD)
[misspelling] ~1465-~1465: This word is normally spelled with a hyphen.
Context: ...ema.array()), }); ``` This is verbose, error prone, and counter to the goals of Zod. The `...(EN_COMPOUNDS_ERROR_PRONE)
[uncategorized] ~1465-~1465: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...face()` API was introduced in large part so recursive types could be more readily r...(COMMA_COMPOUND_SENTENCE_2)
[style] ~1513-~1513: Consider using a more polite wording.
Context: ...b> {/* ###.nonemptyIf you want to ensure that an array contains at lea...(IF_YOU_WANT)
[style] ~1629-~1629: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ue of the discriminator key, TypeScript is able to "narrow" the type signature as you'd ex...(BE_ABLE_TO)
[duplication] ~1645-~1645: Possible typo: you repeated a word.
Context: .../ string } } ``` You could represent with with a regularz.union(). But regular unio...(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~1646-~1646: Possible missing comma found.
Context: ...es. This can be slow for large unions. So Zod provides az.discriminatedUnion()...(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~1742-~1742: The plural noun “schemas” cannot be used with the article “an”.
Context: ...umber | symbol, unknown> ``` To create an object schemas containing keys defined by an enum: ``...(A_NNS)
[style] ~1750-~1750: “Despite the fact that” is a wordy phrase. Consider making your sentence clearer.
Context: ...ordion title="A note on numeric keys"> Despite the fact that TypeScript lets you defineRecordtyp...(ALTHOUGH_CLARITY)
[misspelling] ~1907-~1907: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...in sequence, even if one of them causes an validation error. This is usually desir...(EN_A_VS_AN)
[uncategorized] ~1935-~1935: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }, { "code": "custom", "message": "Must...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~1966-~1966: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }] ``` To customize the e...(UNLIKELY_OPENING_PUNCTUATION)
[style] ~2266-~2266: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...`` Most commonly, transforms are used in conjunction with Pipes. This combination is us...(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~2474-~2474: “its” (belonging to it) seems less likely than “it”
Context: ...fido; // works fine ``` In some cases, its can be desirable to simulate [nominal t...(AI_HYDRA_LEO_CPT_ITS_IT)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
packages/docs/content/api.mdx(1 hunks)packages/docs/content/basics.mdx(1 hunks)packages/docs/content/ecosystem.mdx(1 hunks)packages/docs/content/error-customization.mdx(1 hunks)packages/docs/content/error-formatting.mdx(1 hunks)packages/docs/content/generic-functions.mdx(1 hunks)packages/docs/content/index.mdx(1 hunks)packages/docs/content/json-schema.mdx(1 hunks)packages/docs/content/meta.json(1 hunks)packages/docs/content/metadata.mdx(1 hunks)packages/docs/content/object-vs-interface.mdx(1 hunks)packages/docs/content/packages/core.mdx(1 hunks)packages/docs/content/packages/mini.mdx(1 hunks)packages/docs/content/packages/zod.mdx(1 hunks)packages/docs/content/parsing.mdx(1 hunks)packages/docs/content/test.mdx(1 hunks)packages/docs/content/type-inference.mdx(1 hunks)packages/docs/content/v4/changelog.mdx(1 hunks)packages/docs/content/v4/index.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/docs/content/type-inference.mdx
[uncategorized] ~17-~17: A comma might be missing here.
Context: ...les ``` What about transforms? In reality each Zod schema internally tracks **two...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[typographical] ~17-~17: After the expression ‘for example’ a comma is usually used.
Context: ... mix, these two values can diverge. For instance `z.string().transform(val => val.length...
(COMMA_FOR_EXAMPLE)
packages/docs/content/generic-functions.mdx
[uncategorized] ~54-~54: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...e to how TypeScript inference works, it is treating schema like a ZodTypeAny instead of...
(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
packages/docs/content/metadata.mdx
[uncategorized] ~14-~14: The hyphen in strongly-typed is redundant.
Context: ... of schemas, each associated with some strongly-typed metadata. To create a simple registry:...
(ADVERB_LY_HYPHEN_FIX)
[uncategorized] ~192-~192: A comma may be missing after the conjunctive/linking adverb ‘Similarly’.
Context: ...output type (z.infer<typeof schema>). Similarly you can use z.$input to reference the...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
packages/docs/content/v4/index.mdx
[grammar] ~29-~29: Two determiners in a row. Choose either “a” or “the”.
Context: ...ns-%2B1-desc). With luck, it will serve a the new foundation for many more years to c...
(DT_DT)
[typographical] ~245-~245: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ... In Zod 3, this took 4000ms to compile; and adding additional calls to .extend() would t...
(CONJUNCTION_AFTER_SEMICOLON)
[typographical] ~331-~331: It is considered good style to insert a comma after introductory phrases with dates or proper nouns.
Context: ... ### Exact(er) optional properties In TypeScript a property can be "optional" in two dis...
(IN_NNP_COMMA)
[style] ~338-~338: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...itted from the object ("key optional"). In ValueOptional, the prop key *must b...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[typographical] ~377-~377: It seems that a comma is missing.
Context: ...-in API. ### True recursive types But wait there's more! After implementing `z.int...
(WAIT_COMMA)
[uncategorized] ~420-~420: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...od 4 introduces a new system for adding strongly-typed metadata to your schemas. Metadata isn'...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[style] ~559-~559: ‘by all means’ might be wordy. Consider a shorter alternative.
Context: ...f you are using that package currently, by all means continue using it. Zod now implements...
(EN_WORDINESS_PREMIUM_BY_ALL_MEANS)
[style] ~599-~599: For conciseness, consider replacing this expression with an adverb.
Context: ...d string → at favoriteNumbers[1] ``` At the moment this isn't configurable; this may chang...
(AT_THE_MOMENT)
[uncategorized] ~681-~681: A comma may be missing after the conjunctive/linking adverb ‘Similarly’.
Context: ...] z.uint32(); // [0, 4294967295] ``` Similarly the following bigint numeric formats ...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[style] ~691-~691: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...he existing z.coerce.boolean() API is very simple: falsy values (false, undefined, `n...
(EN_WEAK_ADJECTIVE)
[style] ~691-~691: In American English, abbreviations like “etc.” require a period.
Context: ..., undefined, null, 0, "", NaN etc) become false, truthy values become `...
(ETC_PERIOD)
[grammar] ~780-~780: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...minated union support has improved in a couple ways. First, you no longer need to specify t...
(PLENTY_OF_NOUNS)
packages/docs/content/packages/core.mdx
[duplication] ~51-~51: Possible typo: you repeated a word.
Context: ...rding to semver). Once the first stable release release of Zod 4, at which point v1.0.0 will ...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~55-~55: Possible typo: you repeated a word.
Context: ...Zod schemas (say, an API framework) you first first look into [Standard Schema](https://sta...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~59-~59: You might be missing the article “the” here.
Context: ...ty (say, introspecting the schema) then Standard Schema won't be sufficient. In this cas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~76-~76: A comma might be missing here.
Context: ...cy lets users "bring-their-own-Zod". As written this allows the user to use any 0.x.y...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[style] ~78-~78: Consider a shorter alternative to avoid wordiness.
Context: ...d to pick some version of Zod to use, in order to write your code. Use a dev dependency...
(IN_ORDER_TO_PREMIUM)
[grammar] ~378-~378: Consider using either the past participle “accepted” or the present participle “accepting” here.
Context: ...ctices for doing so. 1. If you're just accept user-defined schemas, use Standard Sche...
(BEEN_PART_AGREEMENT)
[grammar] ~384-~384: The word ‘installs’ is not a noun.
Context: ...od/core`, avoiding accidental duplicate installs. ```json { "peerDependencies": { ...
(A_INSTALL)
packages/docs/content/packages/zod.mdx
[uncategorized] ~30-~30: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...from @zod/core. All instance of ZodType implement the following me...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
packages/docs/content/error-customization.mdx
[style] ~296-~296: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...ary automatically loads the en locale automatically. The @zod/minipackage does not load a...
(ADVERB_REPETITION_PREMIUM)
[uncategorized] ~296-~296: Possible missing comma found.
Context: .../minipackage does not load any locale; instead all error messages default to Invalid ...
(AI_HYDRA_LEO_MISSING_COMMA)
packages/docs/content/packages/mini.mdx
[style] ~7-~7: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...the release of Zod 4. It implements the exact same functionality as zod, but using a *fu...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
[uncategorized] ~62-~62: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: .../mini` such methods aren't implemented. Instead you pass these checks into schemas usin...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~145-~145: Possible missing comma found.
Context: ...r otherwise customized. This means, by default the message property of all issues wi...
(AI_HYDRA_LEO_MISSING_COMMA)
packages/docs/content/error-formatting.mdx
[style] ~8-~8: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ...d correctness in its error reporting. In many cases, it's helpful to convert the `$ZodError...
(IN_MANY_STYLE_CASES)
[uncategorized] ~77-~77: The preposition “on” seems more likely in this position.
Context: ...n easily access the errors that occured at a particular path. The errors field c...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[formatting] ~87-~87: Did you mean “?”
Context: ...`` > Be sure to use optional chaining (?.) to avoid errors when accessing nested...
(MULTIPLE_PUNCTATION_MARKS_1)
packages/docs/content/ecosystem.mdx
[style] ~17-~17: This expression usually appears with a “please” in front of it.
Context: ... built a tool or library on top of Zod, let me know [on Twitter](https://twitter.com/colinh...
(INSERT_PLEASE)
[uncategorized] ~62-~62: Loose punctuation mark.
Context: ...- tRPC: Build end-to-end typesafe APIs without ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~63-~63: Loose punctuation mark.
Context: ...d-plugins/tree/main/packages/zod-nestjs): Helper methods for using Zod in a NestJ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~64-~64: Loose punctuation mark.
Context: ...ithub.com/flock-community/zod-endpoints): Contract-first strictly typed endpoints...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~65-~65: Loose punctuation mark.
Context: ...ps://github.com/evertdespiegeleer/zhttp): An OpenAPI compatible, strictly typed h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~66-~66: Loose punctuation mark.
Context: ....com/SeasonedSoftware/domain-functions/): Decouple your business logic from your ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~67-~67: Loose punctuation mark.
Context: ...core`](https://github.com/ecyrbe/zodios): A typescript API client with runtime an...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~68-~68: Loose punctuation mark.
Context: ...://github.com/RobinTail/express-zod-api): Build Express-based APIs with I/O schem...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~69-~69: Loose punctuation mark.
Context: ...noduck/blob/main/src/tapiduck/README.md): End-to-end typesafe JSON APIs with Zod ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~70-~70: Loose punctuation mark.
Context: ...://github.com/JakeFenley/koa-zod-router): Create typesafe routes in Koa with I/O ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~71-~71: Loose punctuation mark.
Context: ...ttps://github.com/RobinTail/zod-sockets): Zod-powered Socket.IO microframework wi...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~73-~73: Loose punctuation mark.
Context: ...](https://github.com/modevol-com/gqloom): Weave GraphQL schema and resolvers usin...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~77-~77: Loose punctuation mark.
Context: ...ithub.com/react-hook-form/resolvers#zod): A first-party Zod resolver for React Ho...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~78-~78: Loose punctuation mark.
Context: ...github.com/causaly/zod-validation-error): Generate user-friendly error messages f...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~79-~79: Loose punctuation mark.
Context: ...b.com/robertLichtnow/zod-formik-adapter): A community-maintained Formik adapter f...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~80-~80: Loose punctuation mark.
Context: ...https://github.com/esamattis/react-zorm): Standalone <form> generation and vali...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~81-~81: Loose punctuation mark.
Context: ...](https://github.com/rileytomasek/zodix): Zod utilities for FormData and URLSearc...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~82-~82: Loose punctuation mark.
Context: ...ps://conform.guide/api/zod/parseWithZod): A typesafe form validation library for ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~83-~83: Loose punctuation mark.
Context: .../github.com/kiliman/remix-params-helper): Simplify integration of Zod with standa...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~84-~84: Loose punctuation mark.
Context: ...//github.com/glazy/formik-validator-zod): Formik-compliant validator library that...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~85-~85: Loose punctuation mark.
Context: ...ap`](https://github.com/aiji42/zod-i18n): Useful for translating Zod error messag...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~86-~86: Loose punctuation mark.
Context: .../github.com/fabian-hiller/modular-forms): Modular form library for SolidJS that s...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~87-~87: Loose punctuation mark.
Context: ...ttps://github.com/crutchcorn/houseform/): A React form library that uses Zod for ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~88-~88: Loose punctuation mark.
Context: ...thub.com/ciscoheat/sveltekit-superforms): Supercharged form library for SvelteKit...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~89-~89: Loose punctuation mark.
Context: ...ps://github.com/MonoidDev/mobx-zod-form): Data-first form builder based on MobX &...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~90-~90: Loose punctuation mark.
Context: ...etm/vee-validate/tree/main/packages/zod): Form library for Vue.js with Zod schema...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~91-~91: Loose punctuation mark.
Context: ...github.com/thepeaklab/zod-form-renderer): Auto-infer form fields from zod schema ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~92-~92: Loose punctuation mark.
Context: ...-zod`](https://github.com/MrBr/antd-zod): Zod adapter for Ant Design form fields ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~93-~93: Loose punctuation mark.
Context: ...`](https://github.com/schalkventer/frrm): Tiny 0.5kb Zod-based, HTML form abstrac...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~97-~97: Loose punctuation mark.
Context: ...https://github.com/sachinraja/zod-to-ts): Generate TypeScript definitions from Zo...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~98-~98: Loose punctuation mark.
Context: ...ub.com/StefanTerdell/zod-to-json-schema): Convert your Zod schemas into [JSON Sch...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~99-~99: Loose punctuation mark.
Context: ...-plugins/tree/main/packages/zod-openapi): Converts a Zod schema to an OpenAPI v3....
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~100-~100: Loose punctuation mark.
Context: ...://github.com/DavidTimms/zod-fast-check): Generate fast-check arbitraries from ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~101-~101: Loose punctuation mark.
Context: ...bkk/abitia/tree/master/packages/zod-dto): Generate Nest.js DTOs from a Zod schema...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~102-~102: Loose punctuation mark.
Context: ...com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...ithub.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs fr...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...github.com/incetarik/nestjs-graphql-zod): Generates NestJS GraphQL model classes ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...ttps://github.com/samchungy/zod-openapi): Create full OpenAPI v3.x documentation ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~106-~106: Loose punctuation mark.
Context: ...ithub.com/samchungy/fastify-zod-openapi): Fastify type provider, validation, seri...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~107-~107: Loose punctuation mark.
Context: ... typeschema: Universal adapter for schema validation...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~112-~112: Loose punctuation mark.
Context: ...https://github.com/fabien0102/ts-to-zod): Convert TypeScript definitions into Zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~113-~113: Loose punctuation mark.
Context: ...//github.com/johngeorgewright/runtyping): Generate Zod from static types & JSON s...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~114-~114: Loose punctuation mark.
Context: ...ub.com/StefanTerdell/json-schema-to-zod): Convert your [JSON Schemas](https://jso...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~115-~115: Loose punctuation mark.
Context: ...ttps://github.com/rsinohara/json-to-zod): Convert JSON objects into Zod schemas. ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~116-~116: Loose punctuation mark.
Context: ...ql-codegen-typescript-validation-schema): GraphQL Code Generator plugin to genera...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~117-~117: Loose punctuation mark.
Context: .../github.com/CarterGrimmeisen/zod-prisma): Generate Zod schemas from your Prisma s...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...ps://github.com/Southclaws/supervillain): Generate Zod schemas from your Go struc...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~119-~119: Loose punctuation mark.
Context: ...b.com/omar-dulaimi/prisma-zod-generator): Emit Zod schemas from your Prisma schem...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...zod`](https://orm.drizzle.team/docs/zod): Emit Zod schemas from your Drizzle sche...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~121-~121: Loose punctuation mark.
Context: ....com/omar-dulaimi/prisma-trpc-generator): Emit fully implemented tRPC routers and...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~123-~123: Loose punctuation mark.
Context: ...quicktype: Convert JSON objects and JSON schemas i...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~124-~124: Loose punctuation mark.
Context: ...oto/sanity-typed/tree/main/packages/zod): Generate Zod Schemas from [Sanity Schem...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~125-~125: Loose punctuation mark.
Context: ...tps://github.com/ivangreene/java-to-zod): Convert POJOs to Zod schemas - [Orval...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~131-~131: Loose punctuation mark.
Context: ...zod-plugins/tree/main/packages/zod-mock): Generate mock data from a Zod schema. P...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~132-~132: Loose punctuation mark.
Context: ...ps://github.com/dipasqualew/zod-mocking): Generate mock data from your Zod schema...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~133-~133: Loose punctuation mark.
Context: ...://github.com/timdeschryver/zod-fixture): Use your zod schemas to automate the ge...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~134-~134: Loose punctuation mark.
Context: ...- zocker: Generate plausible mock-data from your ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~140-~140: Loose punctuation mark.
Context: ...github.com/JacobWeisenburger/freerstore): Firestore cost optimizer. - [slonik](...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~141-~141: Loose punctuation mark.
Context: ...me-validation-and-static-type-inference): Node.js Postgres client with strong Zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~142-~142: Loose punctuation mark.
Context: ...emql`](https://github.com/a2lix/schemql): Enhances your SQL workflow by combining...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~143-~143: Loose punctuation mark.
Context: ...](https://github.com/mdbetancourt/soly): Create CLI applications with zod. - [p...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~144-~144: Loose punctuation mark.
Context: ...(https://github.com/vadimdemedes/pastel): Create CLI applications with react, zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~145-~145: Loose punctuation mark.
Context: ...https://github.com/sidwebworks/zod-xlsx): A xlsx based resource validator using Z...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...v`](https://github.com/lostfictions/znv): Type-safe environment parsing and valid...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~147-~147: Loose punctuation mark.
Context: ...https://github.com/alexmarqs/zod-config): Load configurations across multiple sou...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~148-~148: Loose punctuation mark.
Context: ...in/packages/unplugin-environment#readme): A plugin for loading enviroment variabl...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~149-~149: Loose punctuation mark.
Context: ...ps://codeberg.org/reesericci/zod-struct): Create runtime-checked structs with Zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~153-~153: Loose punctuation mark.
Context: .../github.com/JacobWeisenburger/zod_utilz): Framework agnostic utilities for Zod. -...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~153-~153: When ‘Framework-agnostic’ is used as a modifier, it is usually spelled with a hyphen.
Context: ...ithub.com/JacobWeisenburger/zod_utilz): Framework agnostic utilities for Zod. - [zod-playground]...
(SPECIFIC_HYPHEN)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...://github.com/marilari88/zod-playground): A tool for learning and testing Zod sch...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...ttps://github.com/nereumelo/zod-sandbox): Controlled environment for testing zod ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~156-~156: Loose punctuation mark.
Context: ...https://github.com/schalkventer/zod-dev): Conditionally disables Zod runtime pars...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~157-~157: Loose punctuation mark.
Context: ...hub.com/duplojs/duplojs-zod-accelerator): Accelerates Zod's throughput up to ~100...
(UNLIKELY_OPENING_PUNCTUATION)
packages/docs/content/v4/changelog.mdx
[style] ~46-~46: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...l sorts of footguns (they can't be used in conjunction with errorMap) and do not align with Zod's...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~194-~194: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...thod on ZodError has been deprecated. Instead use the top-level z.treeifyError() fu...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~198-~198: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...on ZodError has also been deprecated. Instead use the top-level z.treeifyError() fu...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~332-~332: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... This has been long deprecated in Zod 3 and it now removed in Zod 4. There is no di...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~332-~332: Did you mean “its” (the possessive pronoun)?
Context: ...his API. There were lots of footguns in it's implementation, and it's use is general...
(ITS_PREMIUM)
[grammar] ~332-~332: Did you mean to use the possessive pronoun “its”?
Context: ...of footguns in it's implementation, and it's use is generally an anti-pattern. ### ...
(IT_S_ITS)
[misspelling] ~332-~332: This word is normally spelled as one.
Context: ...mentation, and it's use is generally an anti-pattern. ### changes z.unknown() optionality...
(EN_COMPOUNDS_ANTI_PATTERN)
[grammar] ~446-~446: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...nement functions could still narrow the type of a schema. This wasn't documented but was ...
(KIND_OF_A)
[uncategorized] ~458-~458: Loose punctuation mark.
Context: ...4: still unknown ``` ## z.ostring(), etc dropped The undocumented convenien...
(UNLIKELY_OPENING_PUNCTUATION)
[style] ~458-~458: In American English, abbreviations like “etc.” require a period.
Context: ... still unknown ``` ## z.ostring(), etc dropped The undocumented convenience m...
(ETC_PERIOD)
[uncategorized] ~575-~575: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...eneric Def has been entirely removed. Instead the base class now only tracks Output...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[style] ~575-~575: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others.
Context: ... z.ZodType to behave more intuitively in many cases. ```ts const inferSchema<T extends z.Z...
(IN_MANY_STYLE_CASES)
[style] ~605-~605: In American English, abbreviations like “etc.” require a period.
Context: ...class, plus $ZodString, $ZodNumber, etc), utility functions/types, issue types ...
(ETC_PERIOD)
[style] ~611-~611: In American English, abbreviations like “etc.” require a period.
Context: ...class, plus $ZodString, $ZodNumber, etc), utility functions/types, issue types ...
(ETC_PERIOD)
[typographical] ~613-~613: Consider adding a comma here.
Context: ... error class ($ZodError). As you can see these things are all prefixed with $ ...
(AS_YOU_CAN_SEE_COMMA)
[style] ~654-~654: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ... // => "12" ``` This is primarily used in conjunction with ZodPipe. The `.transform()` method no...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
packages/docs/content/json-schema.mdx
[duplication] ~124-~124: Possible typo: you repeated a word.
Context: ... {/* ### Pipes Pipes contain and input and and output schema. Zod uses the *output sch...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~381-~381: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...: [ 'firstName', 'lastName' ] // } ``` Instead you can set the reused option to `"re...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[duplication] ~418-~418: Possible typo: you repeated a word.
Context: ... ###pipes` Pipes contain an input and and output schema. By default the result of...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~418-~418: Did you mean: “By default,”?
Context: ...contain an input and and output schema. By default the result of z.toJSONSchema represen...
(BY_DEFAULT_COMMA)
[uncategorized] ~433-~433: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts an id to a fully-qualified URI. ```ts const myRegistry = z.regist...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~860-~860: Did you mean: “By default,”?
Context: ...try will be extracted into schemas. By default the $ref URIs are relative paths like...
(BY_DEFAULT_COMMA)
[uncategorized] ~861-~861: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts an id to a fully-qualified URI. ```ts z.toJSONSchema(z.globalRegi...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
packages/docs/content/api.mdx
[style] ~140-~140: Consider removing “of” to be more concise
Context: ...sWith("fourscore")) ``` All of the APIs documented below support the `erro...
(ALL_OF_THE)
[uncategorized] ~307-~307: Possible missing comma found.
Context: ...00"); // ❌ (no offsets allowed) ``` To allow Timezone offsets can be allowed by sett...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~577-~577: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...``` You can also pass in an externally-declared TypeScript enum. Zod 4 ...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[grammar] ~860-~860: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...et's run through them. */} There are a couple ways in which a key can be "optional" in Typ...
(PLENTY_OF_NOUNS)
[duplication] ~883-~883: Possible typo: you repeated a word.
Context: ...ect()API can only representA. When an an optional schema (e.g. z.string().optio...
(ENGLISH_WORD_REPEAT_RULE)
[misspelling] ~901-~901: Did you mean “side effect” (=adverse effect, unintended consequence)? Open compounds are not hyphenated.
Context: ...: string | undefined; } ``` As a happy side-effect of this new z.interface() API, it's p...
(AFFECT_EFFECT)
[grammar] ~1213-~1213: The verb ‘make’ seems to be in the wrong form here.
Context: ...nvenience, Zod provides a dedicated API for make some or all properties optional, inspir...
(FOR_VB)
[uncategorized] ~1338-~1338: Did you mean: “By default,”?
Context: ... {/* ### .passthrough By default Zod object schemas strip out unrecogniz...
(BY_DEFAULT_COMMA)
[style] ~1354-~1354: Consider using a more polite wording.
Context: ... has been stripped ``` Instead, if you want to pass through unknown keys, use `.pas...
(IF_YOU_WANT)
[uncategorized] ~1365-~1365: Did you mean: “By default,”?
Context: ...an", extraKey: 61 } ``` ### .strict By default Zod object schemas strip out unrecogniz...
(BY_DEFAULT_COMMA)
[style] ~1447-~1447: In American English, abbreviations like “etc.” require a period.
Context: ...ct APIs (pick, omit, required, partial, etc) work as you'd expect. <A...
(ETC_PERIOD)
[misspelling] ~1465-~1465: This word is normally spelled with a hyphen.
Context: ...ema.array()), }); ``` This is verbose, error prone, and counter to the goals of Zod. The `...
(EN_COMPOUNDS_ERROR_PRONE)
[uncategorized] ~1465-~1465: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...face()` API was introduced in large part so recursive types could be more readily r...
(COMMA_COMPOUND_SENTENCE_2)
[style] ~1513-~1513: Consider using a more polite wording.
Context: ...b> {/* ### .nonempty If you want to ensure that an array contains at lea...
(IF_YOU_WANT)
[style] ~1629-~1629: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ue of the discriminator key, TypeScript is able to "narrow" the type signature as you'd ex...
(BE_ABLE_TO)
[duplication] ~1645-~1645: Possible typo: you repeated a word.
Context: .../ string } } ``` You could represent with with a regular z.union(). But regular unio...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~1646-~1646: Possible missing comma found.
Context: ...es. This can be slow for large unions. So Zod provides a z.discriminatedUnion()...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~1742-~1742: The plural noun “schemas” cannot be used with the article “an”.
Context: ...umber | symbol, unknown> ``` To create an object schemas containing keys defined by an enum: ``...
(A_NNS)
[style] ~1750-~1750: “Despite the fact that” is a wordy phrase. Consider making your sentence clearer.
Context: ...ordion title="A note on numeric keys"> Despite the fact that TypeScript lets you define Record typ...
(ALTHOUGH_CLARITY)
[misspelling] ~1907-~1907: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...in sequence, even if one of them causes an validation error. This is usually desir...
(EN_A_VS_AN)
[uncategorized] ~1935-~1935: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }, { "code": "custom", "message": "Must...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~1966-~1966: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }] ``` To customize the e...
(UNLIKELY_OPENING_PUNCTUATION)
[style] ~2266-~2266: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...`` Most commonly, transforms are used in conjunction with Pipes. This combination is us...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~2474-~2474: “its” (belonging to it) seems less likely than “it”
Context: ...fido; // works fine ``` In some cases, its can be desirable to simulate [nominal t...
(AI_HYDRA_LEO_CPT_ITS_IT)
🔇 Additional comments (100)
packages/docs/content/test.mdx (2)
1-4: Front Matter Validity
The YAML front matter is correctly formed with a title and description, ensuring proper metadata for the document. If additional metadata (e.g., author, date, tags) is beneficial for filtering or organization in the documentation system, consider adding it later.
12-17: Cards Component Usage Verification
The section using the<Cards>and<Card>components is clear and concise. Make sure these components are properly imported or provided in the MDX context to ensure they render as expected when the documentation is built. If these are custom components, adding a short description or usage note could also help readers understand their functionality.packages/docs/content/object-vs-interface.mdx (1)
1-3: Front Matter Metadata CheckThe front matter is correctly configured with the title “Object vs. interface”.
packages/docs/content/type-inference.mdx (3)
1-3: Front Matter VerificationThe front matter is properly set with the title “Type inference”.
7-13: Code Example ClarityThe code block demonstrating the use of
z.infer<typeof mySchema>is clear and effectively illustrates type extraction.
21-30: Input and Output Type Extraction ExampleThe subsequent code block clearly shows how to extract both input and output types using
z.input,z.output, andz.infer.packages/docs/content/json-schema.mdx (21)
1-3: Front Matter VerificationThe front matter is correctly configured with the title “JSON Schema”.
5-11: UI Components and Feature AnnouncementThe import statements and the Callout component effectively announce the new JSON Schema conversion feature. The use of an attractive icon (💎) adds visual appeal.
14-30: JSON Schema Conversion ExampleThe code example demonstrating how to convert a Zod schema using
z.toJSONSchema()is concise and clear.
32-33: Explanatory TextThe text following the example succinctly explains that schemas are converted to their closest JSON Schema equivalents, including handling of unrepresentable types.
34-46: Unrepresentable Types ExampleThe code block listing unrepresentable types (with the ❌ markers) is effective in communicating which API endpoints are not supported in JSON Schema conversion.
49-65: String Formats DemonstrationThe examples showing how certain Zod string schemas convert to JSON Schema (via
format) are comprehensive and well-presented.
67-71: Content Encoding ExampleThe example for
z.base64()demonstrates the use ofcontentEncodingclearly.
73-83: Pattern-Based String FormatsThe block outlining additional string formats using patterns is succinct and helpful for users.
85-98: Numeric Types ConversionThe examples differentiating between generic numbers and integers (with potential exclusive bounds) are clear and informative.
100-110: Nullability HandlingThe examples properly illustrate how both
nullandundefinedare converted to{ type: "null" }.
112-120: Optional and Nullable SchemasThe examples using
z.optionalandz.nullableeffectively show how to handle nullable types in JSON Schema conversion.
127-136: Configuration Usage ExampleThe code snippet showing how to pass a second argument to
z.toJSONSchema()for configuration purposes is clear.
139-171: ToJSONSchemaParams Interface DocumentationThe detailed interface definition for
ToJSONSchemaParamsis very comprehensive. Make sure any future changes in configuration options are reflected both in the interface and accompanying documentation.
247-255: Target Parameter ExamplesThe examples using the
targetoption to switch between JSON Schema drafts are correct and clear.
256-292: Metadata and Registries Examples with TabsThe usage examples for schema metadata (using
.meta()or.register()) inside a Tabs component are structured well and illustrate the intended behavior clearly.
293-310: Reiterated Unrepresentable TypesThe section reiterating the unrepresentable APIs is clear and reinforces the concept effectively.
311-323: Error vs. "any" Handling for Unrepresentable TypesThe subsequent example demonstrates how to change the behavior for unrepresentable types by using the
{ unrepresentable: "any" }option. Everything is well illustrated.
324-342: Cycle Handling ExampleThe example for handling cycles using
$refis informative. One note: the function call on line 336 appears astoJSONSchema(User);rather thanz.toJSONSchema(User);—please verify that this call is consistent with your API design.
343-349: Cycles "Throw" OptionThe example showing the use of the
cycles: "throw"option to force an error on cyclic references is clear and useful.
351-369: Reused Schemas (Inline) ExampleThe code demonstrates how reused schemas are inlined by default when using
z.toJSONSchema().
370-382: Reused Schemas (Ref Extraction)The example of using the
"ref"option to extract reused schemas into$defsis clear and well documented.🧰 Tools
🪛 LanguageTool
[uncategorized] ~381-~381: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...: [ 'firstName', 'lastName' ] // } ``` Instead you can set thereusedoption to `"re...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
packages/docs/content/generic-functions.mdx (15)
1-3: Front Matter VerificationThe front matter is correctly configured with the title “Generic functions”.
5-8: Introduction ClarityThe introductory text clearly explains the benefits of using TypeScript generics with Zod schemas.
9-15: Initial inferSchema ExampleThe first code example using
function inferSchema<T>(schema: z.ZodType<T>)effectively illustrates the common pitfall of losing specific type information.
16-18: Explanation of LimitationThe follow‐up explanation properly notes that the initial approach limits TypeScript’s ability to infer the specific Zod subclass.
19-22: Demonstration of inferSchema LimitationThe example output clearly shows that the initial approach returns a generic
ZodType<string>, highlighting the issue.
23-27: Loss of Type Information ExplainedThe explanation reinforces that the original approach loses the specific subclass (e.g.
ZodString), which affects method availability.
28-35: Improved inferSchema ExampleThe revised code using
T extends z.ZodTypeAnyretains full type information. The example correctly shows that callinginferSchema(z.string())returns a specific subtype.
36-37: Utility Type ClarificationThe note clarifying that
ZodTypeAnyis shorthand forZodType<any, any, any>is clear and useful.
41-42: Introducing Inference of Parsed DataThe sub-heading clearly introduces the discussion on parsing and inferred types.
43-52: Initial parseData ExampleThe example demonstrating how
parseDatareturnsanyis clear and effectively sets up the need for improvement.
55-64: Improved parseData Example with Type CastingThe revised
parseDatafunction usingas z.infer<T>effectively recovers the correct type.
65-66: Constraining Allowable InputsThe heading for this section clearly sets up the discussion on limiting accepted schema types.
67-77: Overview of ZodType GenericsThe explanation of the three generic parameters of
ZodTypeis informative and provides good context for later examples.
78-90: Constraining Schema Inputs ExampleThe
makeSchemaOptionalexample clearly shows how to restrict inputs by using a constraint (herez.ZodType<string>), and the accompanying error message reinforces the type safety.
91-91: Overall ClarityThe document clearly explains best practices for writing generic functions with Zod schemas, ensuring both flexibility and type safety.
packages/docs/content/parsing.mdx (1)
1-77: LGTM: Clear and Comprehensive Parsing Documentation
The explanations and examples for.parse,.parseAsync,.safeParse, and.safeParseAsyncare clear and well-structured.packages/docs/content/v4/changelog.mdx (3)
1-7: Header and Import Statements are Clear and Well‑StructuredThe frontmatter (lines 1–3) and the import statements (lines 5–7) are correctly defined and follow our documentation conventions. Consider double‑checking that the title (“Migration guide”) follows the same capitalization style as other documentation files.
23-42: Comprehensive Error Customization SectionThe “## Error customization” section clearly explains the changes in error handling—specifically, the replacement of the
messageparameter with a unifiederrorparameter. The side‑by‑side example in the Tabs (lines 31–42) effectively contrasts the Zod 4 and Zod 3 APIs.
100-108: Enhancement in ZodError ImplementationThe section describing how
ZodErrorno longer extends JavaScript’s nativeErrorclass (lines 100–108) is clear and effectively motivates the performance improvements. The code example is concise and instructive.packages/docs/content/error-formatting.mdx (4)
1-7: Header and Imports in Error Formatting DocsThe frontmatter and import statements (lines 1–7) are clear and consistent with our style. They set a solid foundation for the examples that follow.
12-21: Example Schema for Error FormattingThe example schema (lines 12–17) and the invalid data parsing example (lines 22–25) clearly establish the context for demonstrating error formatting utilities.
90-105:z.prettifyError()UsageThe example (lines 90–105) demonstrating the
z.prettifyError()function is concise and shows how to generate a human‑readable string from the error object. The formatting of the output is clear.
148-182:z.flattenError()Deprecation and UsageThe documentation for
z.flattenError()(lines 148–182) is informative. It explains that while the function can be useful for flat schemas, it loses information on deeper paths. This is well‑illustrated by the code examples provided.packages/docs/content/api.mdx (50)
11-24: Primitive Types SectionThe “## Primitives” section (lines 11–24) takes the reader through the basic types (string, number, bigint, etc.) supported by Zod. The examples are succinct and clear.
26-33: Data Coercion withz.coerceThe explanation and examples (lines 26–33) for coercing input data using
z.coerceaptly differentiate between coercion and direct validation, making it easy for the reader to grasp.
109-122: Extracting Allowed Values from LiteralsThe example using Tabs (lines 109–122) to show how to extract literal values (as a Set) works very well. It clearly contrasts the behavior in Zod versus @zod/mini.
156-170: String Validation APIsThe sample code (lines 156–170) that demonstrates common string validations (max, min, length, regex, startsWith, etc.) is comprehensive and easy to follow, with clear comparisons between the two libraries.
187-195: String Transformation APIsThe transformation examples (lines 187–195) for operations such as trimming and case conversion are concise and effectively laid out using Tabs.
206-264: String Formats and Regex CustomizationThe section covering string formats—including
z.email(),z.uuid(),z.url(), and various other format validators—is very detailed. The inclusion of multiple regex options (default, HTML5, RFC 5322, Unicode) is especially useful.
266-284: UUID Validation SectionThe UUID examples (lines 266–284) clearly illustrate both the basic validator and options for specifying particular UUID versions, as well as convenience methods like
z.uuidv4().
337-346: ISO Date ValidationThe demonstration of
z.iso.date()(lines 337–346) is straightforward with clear examples of valid and invalid dates.
348-363: ISO Time ValidationThe
z.iso.time()examples (lines 348–363) accurately show how the validator works, including its limitations (no timezone offsets). The examples are concise.
366-374: Time Precision in ISO TimeThe code snippet (lines 366–374) for setting a precision value demonstrates the impact of the
precisionoption clearly.
375-380: IP Addresses ValidationThe examples for validating IPv4 and IPv6 addresses (lines 375–380) are simple and effective.
382-400: IP Ranges (CIDR) ValidationThe CIDR notation examples (lines 382–400) successfully illustrate how to validate IP ranges and specify version options.
402-412: Number Validation BasicsThe usage of
z.number()is well emphasized with examples that show proper handling of finite numbers versus edge cases (NaN, Infinity).
414-429: Number‑Specific ValidationsThis section (lines 414–429) detailing comparative number validations (gt, gte, lt, lte, positive, etc.) is comprehensive and informative.
452-459: Integer SchemasThe examples for integer schemas (lines 452–459) using
z.int()andz.int32()are clear.
461-496: BigInt Validation and ComparisonsThe BigInt section (lines 461–496) is detailed with both Zod and @zod/mini examples. It very effectively shows various comparison validations.
501-508: Boolean ValidationThe boolean validation examples (lines 501–508) are succinct and adequately demonstrate the expected behavior.
510-517: Date Instance ValidationThe examples for the Date schema (lines 510–517) using
z.date()andsafeParseare straightforward.
519-525: Custom Error Messaging for DatesThe snippet (lines 519–525) that shows how a custom error message can be specified for date parsing is clear and useful.
527-542: Date‑Specific ValidationsThe validations for minimum and maximum dates (lines 527–542) are clearly presented with parallel examples for Zod and @zod/mini.
544-575: Enum Schema ValidationThe “## Enums” section (lines 544–575) effectively demonstrates both constructing a literal enum and using an externally‑declared TypeScript enum. The Callout regarding TypeScript enums is especially helpful.
595-616: Accessing Schema’s Enum ValuesThe example showcasing how to extract an enum‑like object from a Zod enum (lines 595–616) is very clear and compares the two implementations neatly.
618-635: Enum Modification with.exclude()and.extract()Both the
.exclude()(lines 618–627) and.extract()(lines 637–645) examples effectively demonstrate how to modify enum schemas. The comparisons between Zod and @zod/mini are instructive.
656-680: Newz.stringbool()FeatureThe new
z.stringbool()section (lines 656–680) is very well documented with a wide range of examples showing acceptable truthy and falsy inputs.
699-714: Optional SchemasThe “## Optionals” section (lines 699–714) clearly demonstrates how to allow
undefinedvalues usingz.optional(). The tabbed examples are well‑presented.
716-727: Nullable SchemasThe examples for
z.nullable()(lines 716–727) are clear and provide consistent usage patterns between Zod and @zod/mini.
763-778: Nullish SchemasThe explanation and examples for creating nullish schemas (lines 763–778) are concise and clear.
782-790: Handling Unknown ValuesThe section (lines 782–790) covering
z.any()versusz.unknown()provides an easy‑to‑understand clarification of their intended usage.
792-798: Never SchemaThe brief section on
z.never()(lines 792–798) is clear and to the point.
800-821: Template Literals SupportThe “## Template literals” section (lines 800–821) is an exciting new addition. The examples clearly show how to compose a template literal type, making good use of both literal strings and dynamic schema parts.
823-900: Object Schema Definitions and DifferencesThis large section (lines 823–900) thoroughly explains creation of object schemas using both
z.object()andz.interface(). The examples, including strict and loose variants, and detailed Comparisons using Tabs are very helpful. A few minor grammatical fixes (such as removing the stray period in “complex. nested objects”) would enhance clarity.🧰 Tools
🪛 LanguageTool
[grammar] ~860-~860: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...et's run through them. */} There are a couple ways in which a key can be "optional" in Typ...(PLENTY_OF_NOUNS)
[duplication] ~883-~883: Possible typo: you repeated a word.
Context: ...ect()API can only representA. When an an optional schema (e.g.z.string().optio...(ENGLISH_WORD_REPEAT_RULE)
1555-1568: Tuple SchemasThe tuple examples (lines 1555–1568) clearly demonstrate both fixed‑length tuples and variadic tuples. The explanation is concise and clear.
1577-1601: Union Schemas and Option ExtractionThe union section (lines 1577–1601) effectively shows how to define unions using
z.union()and how to extract the internal option schemas. The explanation is complete and the side‑by‑side examples add clarity.
1627-1669: Discriminated UnionsThe discriminated union section (lines 1627–1669) provides an excellent explanation—covering both automatic discriminator key detection in Zod 4 and nested use cases. The examples are very clear.
🧰 Tools
🪛 LanguageTool
[style] ~1629-~1629: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ue of the discriminator key, TypeScript is able to "narrow" the type signature as you'd ex...(BE_ABLE_TO)
[duplication] ~1645-~1645: Possible typo: you repeated a word.
Context: .../ string } } ``` You could represent with with a regularz.union(). But regular unio...(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~1646-~1646: Possible missing comma found.
Context: ...es. This can be slow for large unions. So Zod provides az.discriminatedUnion()...(AI_HYDRA_LEO_MISSING_COMMA)
1691-1716: Intersection SchemasThe examples show how intersection types work and explain that using
.extend()for merging object schemas is often preferred. This section is concise and informative.
1721-1740: Record SchemasThe documentation for
z.record()(lines 1721–1740) clearly explains how to validate objects with dynamic keys. The note on numeric keys and JavaScript’s coercion to strings is especially useful.
1764-1775: Map SchemasThe map schema example (lines 1764–1775) is well‑demonstrated and shows how to enforce key/value types in a Map.
1777-1788: Set SchemasThe section (lines 1777–1788) on set schemas is comprehensive and includes examples of how to constrain Set sizes. The examples are clear for both Zod and @zod/mini.
1808-1841: Promise Schemas (Deprecated)The promise section (lines 1808–1841) is thorough and clearly explains the two‑phase validation process for promise schemas. The deprecation notice is clearly communicated.
1843-1857: Instanceof ChecksThe example of using
z.instanceof()(lines 1843–1857) is concise and accurately conveys the intended usage for class instance validation.
1858-1905: Refinement MethodsThe refinements section beginning at line 1858 explains how to use
.refine()for custom validations, including asynchronous refinements and the pitfalls of throwing errors. The examples are detailed and the use of Tabs for Zod vs. @zod/mini is very instructive.
2177-2188: Pipes for Schema ChainingThe “Pipes” section (lines 2177–2188) clearly explains how to chain schemas with a pipe, along with useful examples in both implementations.
2198-2242: TransformsThe transforms section describes how to change the input data using a transform function. The examples—both synchronous and asynchronous—are clear, and the explanation of how to report validation issues within a transform is especially valuable.
2341-2407: Default ValuesThe section on setting default values (lines 2341–2407) is clear and provides examples for both static defaults and defaults generated by functions.
2408-2430: Fallback Values with.catch()The examples for defining fallback values using the
.catch()method (lines 2408–2430) are straightforward and illustrate both the static and dynamic forms clearly.
2463-2495: Branded Types for Nominal TypingThe branded types section (lines 2463–2495) clearly explains how to simulate nominal typing in TypeScript using brands. The examples are precise and informative.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~2474-~2474: “its” (belonging to it) seems less likely than “it”
Context: ...fido; // works fine ``` In some cases, its can be desirable to simulate [nominal t...(AI_HYDRA_LEO_CPT_ITS_IT)
2497-2559: Readonly SchemasThe “Readonly” section (lines 2497–2559) demonstrates how to mark schemas (and their resulting parsed outputs) as immutable. The practical examples using
Object.freeze()are especially helpful.
2561-2570: Additional Template LiteralsThis brief revisit to template literals (lines 2561–2570) reinforces the earlier detailed section. The example is concise and confirms the support for composing literal types.
2571-2613: JSON‑Encodable Value ValidationThe JSON section (lines 2571–2613) shows how to validate any JSON‑encodable value by leveraging a lazy‑evaluated union. This convenience API is clearly explained.
2613-2639: Custom SchemasThe final section on using
z.custom()(lines 2613–2639) is concise and demonstrates how to create a schema for arbitrary types (including template literal types). The caution about missing validation functions is very important.
| try { | ||
| Player.parse({ username: 42, xp: "100" }); | ||
| } catch(err){ | ||
| if(error instanceof z.ZodError){ | ||
| err.issues; | ||
| /* [ | ||
| { | ||
| expected: 'string', | ||
| code: 'invalid_type', | ||
| path: [ 'username' ], | ||
| message: 'Invalid input: expected string' | ||
| }, | ||
| { | ||
| expected: 'number', | ||
| code: 'invalid_type', | ||
| path: [ 'xp' ], | ||
| message: 'Invalid input: expected number' | ||
| } | ||
| ] */ | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Variable in Catch Block (Tab "zod")
In this code snippet, the catch block uses catch(err) but then checks if(error instanceof z.ZodError). Please change error to err to correctly reference the caught exception.
Apply the following diff:
- if(error instanceof z.ZodError){
+ if(err instanceof z.ZodError){📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| try { | |
| Player.parse({ username: 42, xp: "100" }); | |
| } catch(err){ | |
| if(error instanceof z.ZodError){ | |
| err.issues; | |
| /* [ | |
| { | |
| expected: 'string', | |
| code: 'invalid_type', | |
| path: [ 'username' ], | |
| message: 'Invalid input: expected string' | |
| }, | |
| { | |
| expected: 'number', | |
| code: 'invalid_type', | |
| path: [ 'xp' ], | |
| message: 'Invalid input: expected number' | |
| } | |
| ] */ | |
| } | |
| } | |
| ``` | |
| try { | |
| Player.parse({ username: 42, xp: "100" }); | |
| } catch(err){ | |
| if(err instanceof z.ZodError){ | |
| err.issues; | |
| /* [ | |
| { | |
| expected: 'string', | |
| code: 'invalid_type', | |
| path: [ 'username' ], | |
| message: 'Invalid input: expected string' | |
| }, | |
| { | |
| expected: 'number', | |
| code: 'invalid_type', | |
| path: [ 'xp' ], | |
| message: 'Invalid input: expected number' | |
| } | |
| ] */ | |
| } | |
| } |
| ```ts | ||
| try { | ||
| Player.parse({ username: 42, xp: "100" }); | ||
| } catch(err){ | ||
| if(error instanceof z.core.$ZodError){ | ||
| err.issues; | ||
| /* [ | ||
| { | ||
| expected: 'string', | ||
| code: 'invalid_type', | ||
| path: [ 'username' ], | ||
| message: 'Invalid input: expected string' | ||
| }, | ||
| { | ||
| expected: 'number', | ||
| code: 'invalid_type', | ||
| path: [ 'xp' ], | ||
| message: 'Invalid input: expected number' | ||
| } | ||
| ] */ | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Variable in Catch Block (Tab "@zod/mini")
Similarly, in the @zod/mini example, replace if(error instanceof z.core.$ZodError) with if(err instanceof z.core.$ZodError) to correctly reference the caught error.
Suggested diff:
- if(error instanceof z.core.$ZodError){
+ if(err instanceof z.core.$ZodError){📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ```ts | |
| try { | |
| Player.parse({ username: 42, xp: "100" }); | |
| } catch(err){ | |
| if(error instanceof z.core.$ZodError){ | |
| err.issues; | |
| /* [ | |
| { | |
| expected: 'string', | |
| code: 'invalid_type', | |
| path: [ 'username' ], | |
| message: 'Invalid input: expected string' | |
| }, | |
| { | |
| expected: 'number', | |
| code: 'invalid_type', | |
| path: [ 'xp' ], | |
| message: 'Invalid input: expected number' | |
| } | |
| ] */ | |
| } | |
| } | |
| ``` | |
| try { | |
| Player.parse({ username: 42, xp: "100" }); | |
| } catch(err){ | |
| if(err instanceof z.core.$ZodError){ | |
| err.issues; | |
| /* [ | |
| { | |
| expected: 'string', | |
| code: 'invalid_type', | |
| path: [ 'username' ], | |
| message: 'Invalid input: expected string' | |
| }, | |
| { | |
| expected: 'number', | |
| code: 'invalid_type', | |
| path: [ 'xp' ], | |
| message: 'Invalid input: expected number' | |
| } | |
| ] */ | |
| } | |
| } |
|
@coderabbitai review post all nitpicks as reviews |
|
@colinhacks I'll review the PR and post all nitpicks as separate review comments, including minor suggestions. Starting the review now. ✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 56
🔭 Outside diff range comments (3)
packages/docs/content/object-vs-interface.mdx (1)
4-6: 🧹 Nitpick (assertive)Remove Extraneous Content
It appears there is a stray character "6" on line 6. If this was not intended as part of the content, please remove it.
packages/docs/content/test.mdx (1)
18-18: 🧹 Nitpick (assertive)Trailing Content Check
Line 18 appears to be either a stray line number or an unintended extra line. If this line does not serve a purpose, consider removing it to maintain clean formatting.
packages/docs/content/meta.json (1)
23-23:⚠️ Potential issueRemove Potential Extraneous Content
There appears to be an unexpected line with the sole content
23at the end of the file. If this line is actually present in the file, it will invalidate the JSON format. Please verify whether it is an annotation artifact; if it is part of the file, remove it.Apply the following diff if necessary:
-23
♻️ Duplicate comments (2)
packages/docs/content/basics.mdx (2)
57-60:⚠️ Potential issueBug: Incorrect variable in catch block
In this code snippet the caught exception is assigned to
errbut the condition incorrectly checksif(error instanceof z.ZodError). Please update it to:- if(error instanceof z.ZodError){ + if(err instanceof z.ZodError){
82-86:⚠️ Potential issueBug: Incorrect variable in catch block (for @zod/mini)
In the
@zod/miniexample the catch block usesif(error instanceof z.core.$ZodError)when it should reference the caught error variable. Please change it as follows:- if(error instanceof z.core.$ZodError){ + if(err instanceof z.core.$ZodError){
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (19)
packages/docs/content/api.mdx(1 hunks)packages/docs/content/basics.mdx(1 hunks)packages/docs/content/ecosystem.mdx(1 hunks)packages/docs/content/error-customization.mdx(1 hunks)packages/docs/content/error-formatting.mdx(1 hunks)packages/docs/content/generic-functions.mdx(1 hunks)packages/docs/content/index.mdx(1 hunks)packages/docs/content/json-schema.mdx(1 hunks)packages/docs/content/meta.json(1 hunks)packages/docs/content/metadata.mdx(1 hunks)packages/docs/content/object-vs-interface.mdx(1 hunks)packages/docs/content/packages/core.mdx(1 hunks)packages/docs/content/packages/mini.mdx(1 hunks)packages/docs/content/packages/zod.mdx(1 hunks)packages/docs/content/parsing.mdx(1 hunks)packages/docs/content/test.mdx(1 hunks)packages/docs/content/type-inference.mdx(1 hunks)packages/docs/content/v4/changelog.mdx(1 hunks)packages/docs/content/v4/index.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/docs/content/json-schema.mdx
[duplication] ~124-~124: Possible typo: you repeated a word.
Context: ... {/* ### Pipes Pipes contain and input and and output schema. Zod uses the *output sch...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~267-~267: A comma might be missing here.
Context: ...context on storing metadata in Zod. In Zod metadata is stored in registries. Zod e...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~381-~381: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...: [ 'firstName', 'lastName' ] // } ``` Instead you can set the reused option to `"re...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[duplication] ~418-~418: Possible typo: you repeated a word.
Context: ... ###pipes` Pipes contain an input and and output schema. By default the result of...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~418-~418: Did you mean: “By default,”?
Context: ...contain an input and and output schema. By default the result of z.toJSONSchema represen...
(BY_DEFAULT_COMMA)
[uncategorized] ~433-~433: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts an id to a fully-qualified URI. ```ts const myRegistry = z.regist...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~860-~860: Did you mean: “By default,”?
Context: ...try will be extracted into schemas. By default the $ref URIs are relative paths like...
(BY_DEFAULT_COMMA)
[uncategorized] ~861-~861: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts an id to a fully-qualified URI. ```ts z.toJSONSchema(z.globalRegi...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
packages/docs/content/type-inference.mdx
[uncategorized] ~17-~17: A comma might be missing here.
Context: ...les ``` What about transforms? In reality each Zod schema internally tracks **two...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[typographical] ~17-~17: After the expression ‘for example’ a comma is usually used.
Context: ... mix, these two values can diverge. For instance `z.string().transform(val => val.length...
(COMMA_FOR_EXAMPLE)
packages/docs/content/metadata.mdx
[uncategorized] ~14-~14: The hyphen in strongly-typed is redundant.
Context: ... of schemas, each associated with some strongly-typed metadata. To create a simple registry:...
(ADVERB_LY_HYPHEN_FIX)
[uncategorized] ~192-~192: A comma may be missing after the conjunctive/linking adverb ‘Similarly’.
Context: ...output type (z.infer<typeof schema>). Similarly you can use z.$input to reference the...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
packages/docs/content/ecosystem.mdx
[style] ~17-~17: This expression usually appears with a “please” in front of it.
Context: ... built a tool or library on top of Zod, let me know [on Twitter](https://twitter.com/colinh...
(INSERT_PLEASE)
[uncategorized] ~62-~62: Loose punctuation mark.
Context: ...- tRPC: Build end-to-end typesafe APIs without ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~63-~63: Loose punctuation mark.
Context: ...d-plugins/tree/main/packages/zod-nestjs): Helper methods for using Zod in a NestJ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~64-~64: Loose punctuation mark.
Context: ...ithub.com/flock-community/zod-endpoints): Contract-first strictly typed endpoints...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~65-~65: Loose punctuation mark.
Context: ...ps://github.com/evertdespiegeleer/zhttp): An OpenAPI compatible, strictly typed h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~66-~66: Loose punctuation mark.
Context: ....com/SeasonedSoftware/domain-functions/): Decouple your business logic from your ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~67-~67: Loose punctuation mark.
Context: ...core`](https://github.com/ecyrbe/zodios): A typescript API client with runtime an...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~68-~68: Loose punctuation mark.
Context: ...://github.com/RobinTail/express-zod-api): Build Express-based APIs with I/O schem...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~69-~69: Loose punctuation mark.
Context: ...noduck/blob/main/src/tapiduck/README.md): End-to-end typesafe JSON APIs with Zod ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~70-~70: Loose punctuation mark.
Context: ...://github.com/JakeFenley/koa-zod-router): Create typesafe routes in Koa with I/O ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~71-~71: Loose punctuation mark.
Context: ...ttps://github.com/RobinTail/zod-sockets): Zod-powered Socket.IO microframework wi...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~73-~73: Loose punctuation mark.
Context: ...](https://github.com/modevol-com/gqloom): Weave GraphQL schema and resolvers usin...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~77-~77: Loose punctuation mark.
Context: ...ithub.com/react-hook-form/resolvers#zod): A first-party Zod resolver for React Ho...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~78-~78: Loose punctuation mark.
Context: ...github.com/causaly/zod-validation-error): Generate user-friendly error messages f...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~79-~79: Loose punctuation mark.
Context: ...b.com/robertLichtnow/zod-formik-adapter): A community-maintained Formik adapter f...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~80-~80: Loose punctuation mark.
Context: ...https://github.com/esamattis/react-zorm): Standalone <form> generation and vali...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~81-~81: Loose punctuation mark.
Context: ...](https://github.com/rileytomasek/zodix): Zod utilities for FormData and URLSearc...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~82-~82: Loose punctuation mark.
Context: ...ps://conform.guide/api/zod/parseWithZod): A typesafe form validation library for ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~83-~83: Loose punctuation mark.
Context: .../github.com/kiliman/remix-params-helper): Simplify integration of Zod with standa...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~84-~84: Loose punctuation mark.
Context: ...//github.com/glazy/formik-validator-zod): Formik-compliant validator library that...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~85-~85: Loose punctuation mark.
Context: ...ap`](https://github.com/aiji42/zod-i18n): Useful for translating Zod error messag...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~86-~86: Loose punctuation mark.
Context: .../github.com/fabian-hiller/modular-forms): Modular form library for SolidJS that s...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~87-~87: Loose punctuation mark.
Context: ...ttps://github.com/crutchcorn/houseform/): A React form library that uses Zod for ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~88-~88: Loose punctuation mark.
Context: ...thub.com/ciscoheat/sveltekit-superforms): Supercharged form library for SvelteKit...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~89-~89: Loose punctuation mark.
Context: ...ps://github.com/MonoidDev/mobx-zod-form): Data-first form builder based on MobX &...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~90-~90: Loose punctuation mark.
Context: ...etm/vee-validate/tree/main/packages/zod): Form library for Vue.js with Zod schema...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~91-~91: Loose punctuation mark.
Context: ...github.com/thepeaklab/zod-form-renderer): Auto-infer form fields from zod schema ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~92-~92: Loose punctuation mark.
Context: ...-zod`](https://github.com/MrBr/antd-zod): Zod adapter for Ant Design form fields ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~93-~93: Loose punctuation mark.
Context: ...`](https://github.com/schalkventer/frrm): Tiny 0.5kb Zod-based, HTML form abstrac...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~97-~97: Loose punctuation mark.
Context: ...https://github.com/sachinraja/zod-to-ts): Generate TypeScript definitions from Zo...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~98-~98: Loose punctuation mark.
Context: ...ub.com/StefanTerdell/zod-to-json-schema): Convert your Zod schemas into [JSON Sch...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~99-~99: Loose punctuation mark.
Context: ...-plugins/tree/main/packages/zod-openapi): Converts a Zod schema to an OpenAPI v3....
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~100-~100: Loose punctuation mark.
Context: ...://github.com/DavidTimms/zod-fast-check): Generate fast-check arbitraries from ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~101-~101: Loose punctuation mark.
Context: ...bkk/abitia/tree/master/packages/zod-dto): Generate Nest.js DTOs from a Zod schema...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~102-~102: Loose punctuation mark.
Context: ...com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...ithub.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs fr...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...github.com/incetarik/nestjs-graphql-zod): Generates NestJS GraphQL model classes ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...ttps://github.com/samchungy/zod-openapi): Create full OpenAPI v3.x documentation ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~106-~106: Loose punctuation mark.
Context: ...ithub.com/samchungy/fastify-zod-openapi): Fastify type provider, validation, seri...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~107-~107: Loose punctuation mark.
Context: ... typeschema: Universal adapter for schema validation...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~112-~112: Loose punctuation mark.
Context: ...https://github.com/fabien0102/ts-to-zod): Convert TypeScript definitions into Zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~113-~113: Loose punctuation mark.
Context: ...//github.com/johngeorgewright/runtyping): Generate Zod from static types & JSON s...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~114-~114: Loose punctuation mark.
Context: ...ub.com/StefanTerdell/json-schema-to-zod): Convert your [JSON Schemas](https://jso...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~115-~115: Loose punctuation mark.
Context: ...ttps://github.com/rsinohara/json-to-zod): Convert JSON objects into Zod schemas. ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~116-~116: Loose punctuation mark.
Context: ...ql-codegen-typescript-validation-schema): GraphQL Code Generator plugin to genera...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~117-~117: Loose punctuation mark.
Context: .../github.com/CarterGrimmeisen/zod-prisma): Generate Zod schemas from your Prisma s...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...ps://github.com/Southclaws/supervillain): Generate Zod schemas from your Go struc...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~119-~119: Loose punctuation mark.
Context: ...b.com/omar-dulaimi/prisma-zod-generator): Emit Zod schemas from your Prisma schem...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...zod`](https://orm.drizzle.team/docs/zod): Emit Zod schemas from your Drizzle sche...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~121-~121: Loose punctuation mark.
Context: ....com/omar-dulaimi/prisma-trpc-generator): Emit fully implemented tRPC routers and...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~123-~123: Loose punctuation mark.
Context: ...quicktype: Convert JSON objects and JSON schemas i...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~124-~124: Loose punctuation mark.
Context: ...oto/sanity-typed/tree/main/packages/zod): Generate Zod Schemas from [Sanity Schem...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~125-~125: Loose punctuation mark.
Context: ...tps://github.com/ivangreene/java-to-zod): Convert POJOs to Zod schemas - [Orval...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~131-~131: Loose punctuation mark.
Context: ...zod-plugins/tree/main/packages/zod-mock): Generate mock data from a Zod schema. P...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~132-~132: Loose punctuation mark.
Context: ...ps://github.com/dipasqualew/zod-mocking): Generate mock data from your Zod schema...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~133-~133: Loose punctuation mark.
Context: ...://github.com/timdeschryver/zod-fixture): Use your zod schemas to automate the ge...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~134-~134: Loose punctuation mark.
Context: ...- zocker: Generate plausible mock-data from your ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~140-~140: Loose punctuation mark.
Context: ...github.com/JacobWeisenburger/freerstore): Firestore cost optimizer. - [slonik](...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~141-~141: Loose punctuation mark.
Context: ...me-validation-and-static-type-inference): Node.js Postgres client with strong Zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~142-~142: Loose punctuation mark.
Context: ...emql`](https://github.com/a2lix/schemql): Enhances your SQL workflow by combining...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~143-~143: Loose punctuation mark.
Context: ...](https://github.com/mdbetancourt/soly): Create CLI applications with zod. - [p...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~144-~144: Loose punctuation mark.
Context: ...(https://github.com/vadimdemedes/pastel): Create CLI applications with react, zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~145-~145: Loose punctuation mark.
Context: ...https://github.com/sidwebworks/zod-xlsx): A xlsx based resource validator using Z...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...v`](https://github.com/lostfictions/znv): Type-safe environment parsing and valid...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~147-~147: Loose punctuation mark.
Context: ...https://github.com/alexmarqs/zod-config): Load configurations across multiple sou...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~148-~148: Loose punctuation mark.
Context: ...in/packages/unplugin-environment#readme): A plugin for loading enviroment variabl...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~149-~149: Loose punctuation mark.
Context: ...ps://codeberg.org/reesericci/zod-struct): Create runtime-checked structs with Zod...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~153-~153: Loose punctuation mark.
Context: .../github.com/JacobWeisenburger/zod_utilz): Framework agnostic utilities for Zod. -...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~153-~153: When ‘Framework-agnostic’ is used as a modifier, it is usually spelled with a hyphen.
Context: ...ithub.com/JacobWeisenburger/zod_utilz): Framework agnostic utilities for Zod. - [zod-playground]...
(SPECIFIC_HYPHEN)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...://github.com/marilari88/zod-playground): A tool for learning and testing Zod sch...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...ttps://github.com/nereumelo/zod-sandbox): Controlled environment for testing zod ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~156-~156: Loose punctuation mark.
Context: ...https://github.com/schalkventer/zod-dev): Conditionally disables Zod runtime pars...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~157-~157: Loose punctuation mark.
Context: ...hub.com/duplojs/duplojs-zod-accelerator): Accelerates Zod's throughput up to ~100...
(UNLIKELY_OPENING_PUNCTUATION)
packages/docs/content/v4/index.mdx
[grammar] ~29-~29: Two determiners in a row. Choose either “a” or “the”.
Context: ...ns-%2B1-desc). With luck, it will serve a the new foundation for many more years to c...
(DT_DT)
[typographical] ~245-~245: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ... In Zod 3, this took 4000ms to compile; and adding additional calls to .extend() would t...
(CONJUNCTION_AFTER_SEMICOLON)
[uncategorized] ~271-~271: A comma might be missing here.
Context: ...30% smaller in Zod 4. That's good! But ultimately Zod's method-heavy API is fundamentally...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[typographical] ~331-~331: It is considered good style to insert a comma after introductory phrases with dates or proper nouns.
Context: ... ### Exact(er) optional properties In TypeScript a property can be "optional" in two dis...
(IN_NNP_COMMA)
[style] ~338-~338: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...itted from the object ("key optional"). In ValueOptional, the prop key *must b...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~373-~373: A comma might be missing here.
Context: ...ou prefer it! For the sake of backwards compatibility z.interface() was added as an opt-in ...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[typographical] ~377-~377: It seems that a comma is missing.
Context: ...-in API. ### True recursive types But wait there's more! After implementing `z.int...
(WAIT_COMMA)
[uncategorized] ~414-~414: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...inally represent commonly cyclical data structure like ORM schemas, GraphQL types, etc. ...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
[uncategorized] ~420-~420: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...od 4 introduces a new system for adding strongly-typed metadata to your schemas. Metadata isn'...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[style] ~559-~559: ‘by all means’ might be wordy. Consider a shorter alternative.
Context: ...f you are using that package currently, by all means continue using it. Zod now implements...
(EN_WORDINESS_PREMIUM_BY_ALL_MEANS)
[style] ~599-~599: For conciseness, consider replacing this expression with an adverb.
Context: ...d string → at favoriteNumbers[1] ``` At the moment this isn't configurable; this may chang...
(AT_THE_MOMENT)
[uncategorized] ~627-~627: A comma might be missing here.
Context: ...y choose to be more or less strict. For convenience Zod exports some common ones. ```ts //...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~681-~681: A comma may be missing after the conjunctive/linking adverb ‘Similarly’.
Context: ...] z.uint32(); // [0, 4294967295] ``` Similarly the following bigint numeric formats ...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[style] ~691-~691: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...he existing z.coerce.boolean() API is very simple: falsy values (false, undefined, `n...
(EN_WEAK_ADJECTIVE)
[style] ~691-~691: In American English, abbreviations like “etc.” require a period.
Context: ..., undefined, null, 0, "", NaN etc) become false, truthy values become `...
(ETC_PERIOD)
[grammar] ~780-~780: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...minated union support has improved in a couple ways. First, you no longer need to specify t...
(PLENTY_OF_NOUNS)
packages/docs/content/generic-functions.mdx
[uncategorized] ~54-~54: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...e to how TypeScript inference works, it is treating schema like a ZodTypeAny instead of...
(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
packages/docs/content/error-customization.mdx
[style] ~296-~296: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...ary automatically loads the en locale automatically. The @zod/minipackage does not load a...
(ADVERB_REPETITION_PREMIUM)
[uncategorized] ~296-~296: Possible missing comma found.
Context: .../minipackage does not load any locale; instead all error messages default to Invalid ...
(AI_HYDRA_LEO_MISSING_COMMA)
packages/docs/content/packages/core.mdx
[duplication] ~51-~51: Possible typo: you repeated a word.
Context: ...rding to semver). Once the first stable release release of Zod 4, at which point v1.0.0 will ...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~55-~55: Possible typo: you repeated a word.
Context: ...Zod schemas (say, an API framework) you first first look into [Standard Schema](https://sta...
(ENGLISH_WORD_REPEAT_RULE)
[style] ~78-~78: Consider a shorter alternative to avoid wordiness.
Context: ...d to pick some version of Zod to use, in order to write your code. Use a dev dependency...
(IN_ORDER_TO_PREMIUM)
[grammar] ~378-~378: Consider using either the past participle “accepted” or the present participle “accepting” here.
Context: ...ctices for doing so. 1. If you're just accept user-defined schemas, use Standard Sche...
(BEEN_PART_AGREEMENT)
[grammar] ~384-~384: The word ‘installs’ is not a noun.
Context: ...od/core`, avoiding accidental duplicate installs. ```json { "peerDependencies": { ...
(A_INSTALL)
packages/docs/content/v4/changelog.mdx
[style] ~46-~46: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...l sorts of footguns (they can't be used in conjunction with errorMap) and do not align with Zod's...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~106-~106: A comma might be missing here.
Context: ...r" code path unacceptably slow. In Zod 4 the ZodError class no longer extends ...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~194-~194: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...thod on ZodError has been deprecated. Instead use the top-level z.treeifyError() fu...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~198-~198: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...on ZodError has also been deprecated. Instead use the top-level z.treeifyError() fu...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~332-~332: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... This has been long deprecated in Zod 3 and it now removed in Zod 4. There is no di...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~332-~332: Did you mean “its” (the possessive pronoun)?
Context: ...his API. There were lots of footguns in it's implementation, and it's use is general...
(ITS_PREMIUM)
[grammar] ~332-~332: Did you mean to use the possessive pronoun “its”?
Context: ...of footguns in it's implementation, and it's use is generally an anti-pattern. ### ...
(IT_S_ITS)
[misspelling] ~332-~332: This word is normally spelled as one.
Context: ...mentation, and it's use is generally an anti-pattern. ### changes z.unknown() optionality...
(EN_COMPOUNDS_ANTI_PATTERN)
[grammar] ~446-~446: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...nement functions could still narrow the type of a schema. This wasn't documented but was ...
(KIND_OF_A)
[uncategorized] ~458-~458: Loose punctuation mark.
Context: ...4: still unknown ``` ## z.ostring(), etc dropped The undocumented convenien...
(UNLIKELY_OPENING_PUNCTUATION)
[style] ~458-~458: In American English, abbreviations like “etc.” require a period.
Context: ... still unknown ``` ## z.ostring(), etc dropped The undocumented convenience m...
(ETC_PERIOD)
[uncategorized] ~575-~575: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...eneric Def has been entirely removed. Instead the base class now only tracks Output...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[style] ~575-~575: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others.
Context: ... z.ZodType to behave more intuitively in many cases. ```ts const inferSchema<T extends z.Z...
(IN_MANY_STYLE_CASES)
[style] ~605-~605: In American English, abbreviations like “etc.” require a period.
Context: ...class, plus $ZodString, $ZodNumber, etc), utility functions/types, issue types ...
(ETC_PERIOD)
[style] ~611-~611: In American English, abbreviations like “etc.” require a period.
Context: ...class, plus $ZodString, $ZodNumber, etc), utility functions/types, issue types ...
(ETC_PERIOD)
[typographical] ~613-~613: Consider adding a comma here.
Context: ... error class ($ZodError). As you can see these things are all prefixed with $ ...
(AS_YOU_CAN_SEE_COMMA)
[style] ~654-~654: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ... // => "12" ``` This is primarily used in conjunction with ZodPipe. The `.transform()` method no...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
packages/docs/content/packages/mini.mdx
[style] ~7-~7: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...the release of Zod 4. It implements the exact same functionality as zod, but using a *fu...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
[uncategorized] ~62-~62: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: .../mini` such methods aren't implemented. Instead you pass these checks into schemas usin...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~145-~145: Possible missing comma found.
Context: ...r otherwise customized. This means, by default the message property of all issues wi...
(AI_HYDRA_LEO_MISSING_COMMA)
packages/docs/content/error-formatting.mdx
[style] ~8-~8: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ...d correctness in its error reporting. In many cases, it's helpful to convert the `$ZodError...
(IN_MANY_STYLE_CASES)
[formatting] ~87-~87: Did you mean “?”
Context: ...`` > Be sure to use optional chaining (?.) to avoid errors when accessing nested...
(MULTIPLE_PUNCTATION_MARKS_1)
packages/docs/content/api.mdx
[style] ~140-~140: Consider removing “of” to be more concise
Context: ...sWith("fourscore")) ``` All of the APIs documented below support the `erro...
(ALL_OF_THE)
[uncategorized] ~307-~307: Possible missing comma found.
Context: ...00"); // ❌ (no offsets allowed) ``` To allow Timezone offsets can be allowed by sett...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~577-~577: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...``` You can also pass in an externally-declared TypeScript enum. Zod 4 ...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~690-~690: Possible missing preposition found.
Context: ...rue"], falsy: ["no", "false"] }) ``` Be default the schema is *case-insensitive...
(AI_HYDRA_LEO_MISSING_TO)
[uncategorized] ~691-~691: Possible missing comma found.
Context: ..."], falsy: ["no", "false"] }) ``` Be default the schema is case-insensitive; all i...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~860-~860: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...et's run through them. */} There are a couple ways in which a key can be "optional" in Typ...
(PLENTY_OF_NOUNS)
[duplication] ~883-~883: Possible typo: you repeated a word.
Context: ...ect()API can only representA. When an an optional schema (e.g. z.string().optio...
(ENGLISH_WORD_REPEAT_RULE)
[misspelling] ~901-~901: Did you mean “side effect” (=adverse effect, unintended consequence)? Open compounds are not hyphenated.
Context: ...: string | undefined; } ``` As a happy side-effect of this new z.interface() API, it's p...
(AFFECT_EFFECT)
[grammar] ~1213-~1213: The verb ‘make’ seems to be in the wrong form here.
Context: ...nvenience, Zod provides a dedicated API for make some or all properties optional, inspir...
(FOR_VB)
[uncategorized] ~1338-~1338: Did you mean: “By default,”?
Context: ... {/* ### .passthrough By default Zod object schemas strip out unrecogniz...
(BY_DEFAULT_COMMA)
[style] ~1354-~1354: Consider using a more polite wording.
Context: ... has been stripped ``` Instead, if you want to pass through unknown keys, use `.pas...
(IF_YOU_WANT)
[uncategorized] ~1365-~1365: Did you mean: “By default,”?
Context: ...an", extraKey: 61 } ``` ### .strict By default Zod object schemas strip out unrecogniz...
(BY_DEFAULT_COMMA)
[style] ~1447-~1447: In American English, abbreviations like “etc.” require a period.
Context: ...ct APIs (pick, omit, required, partial, etc) work as you'd expect. <A...
(ETC_PERIOD)
[misspelling] ~1465-~1465: This word is normally spelled with a hyphen.
Context: ...ema.array()), }); ``` This is verbose, error prone, and counter to the goals of Zod. The `...
(EN_COMPOUNDS_ERROR_PRONE)
[uncategorized] ~1465-~1465: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...face()` API was introduced in large part so recursive types could be more readily r...
(COMMA_COMPOUND_SENTENCE_2)
[style] ~1513-~1513: Consider using a more polite wording.
Context: ...b> {/* ### .nonempty If you want to ensure that an array contains at lea...
(IF_YOU_WANT)
[style] ~1629-~1629: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ue of the discriminator key, TypeScript is able to "narrow" the type signature as you'd ex...
(BE_ABLE_TO)
[duplication] ~1645-~1645: Possible typo: you repeated a word.
Context: .../ string } } ``` You could represent with with a regular z.union(). But regular unio...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~1646-~1646: Possible missing comma found.
Context: ...es. This can be slow for large unions. So Zod provides a z.discriminatedUnion()...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~1742-~1742: The plural noun “schemas” cannot be used with the article “an”.
Context: ...umber | symbol, unknown> ``` To create an object schemas containing keys defined by an enum: ``...
(A_NNS)
[style] ~1750-~1750: “Despite the fact that” is a wordy phrase. Consider making your sentence clearer.
Context: ...ordion title="A note on numeric keys"> Despite the fact that TypeScript lets you define Record typ...
(ALTHOUGH_CLARITY)
[misspelling] ~1907-~1907: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...in sequence, even if one of them causes an validation error. This is usually desir...
(EN_A_VS_AN)
[uncategorized] ~1935-~1935: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }, { "code": "custom", "message": "Must...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~1966-~1966: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }] ``` To customize the e...
(UNLIKELY_OPENING_PUNCTUATION)
[style] ~2266-~2266: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...`` Most commonly, transforms are used in conjunction with Pipes. This combination is us...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~2474-~2474: “its” (belonging to it) seems less likely than “it”
Context: ...fido; // works fine ``` In some cases, its can be desirable to simulate [nominal t...
(AI_HYDRA_LEO_CPT_ITS_IT)
🔇 Additional comments (27)
packages/docs/content/object-vs-interface.mdx (1)
1-3: Front Matter Initialization Looks GoodThe front matter is correctly set up with the required title metadata. Consider adding additional metadata (like a description or tags) if that fits the documentation strategy for future scalability.
packages/docs/content/test.mdx (1)
12-17: Cards Component Usage: Clear and StructuredThe usage of the
<Cards>and<Card>components is well-organized. Please confirm that these components are globally available or properly imported in the MDX environment to avoid runtime issues. Also, verify that the linked URLs are up-to-date.packages/docs/content/meta.json (1)
1-22: JSON Structure and Content OrganizationThe metadata object is well-structured and clearly delineates the documentation sections using both boolean flags and section separators. The
"pages"array effectively categorizes content with intuitive separators like"---Beta---","---Documentation---", and"---Packages---". This design should enhance navigation for the documentation toolchain, assuming it correctly interprets these separator strings.packages/docs/content/type-inference.mdx (1)
5-13: Review of Code Examples
The examples demonstrating how to extract both the inferred type and the separate input/output types are clear and informative. They effectively illustrate thatz.inferreturns the output type even when a transformation is applied.packages/docs/content/json-schema.mdx (1)
1-894: Overall Documentation Quality
The new JSON Schema documentation is very comprehensive. The numerous code examples covering different schema types, configuration options, and advanced topics (e.g. cycles, reused schemas, external URIs) provide a valuable reference for users. Excellent work ensuring that each feature ofz.toJSONSchema()is demonstrated.🧰 Tools
🪛 LanguageTool
[duplication] ~124-~124: Possible typo: you repeated a word.
Context: ... {/* ### Pipes Pipes contain and input and and output schema. Zod uses the *output sch...(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~267-~267: A comma might be missing here.
Context: ...context on storing metadata in Zod. In Zod metadata is stored in registries. Zod e...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~381-~381: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...: [ 'firstName', 'lastName' ] // } ``` Instead you can set thereusedoption to `"re...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[duplication] ~418-~418: Possible typo: you repeated a word.
Context: ...###pipes` Pipes contain an input and and output schema. By default the result of...(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~418-~418: Did you mean: “By default,”?
Context: ...contain an input and and output schema. By default the result ofz.toJSONSchemarepresen...(BY_DEFAULT_COMMA)
[uncategorized] ~433-~433: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts anidto a fully-qualified URI. ```ts const myRegistry = z.regist...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~860-~860: Did you mean: “By default,”?
Context: ...try will be extracted intoschemas. By default the$refURIs are relative paths like...(BY_DEFAULT_COMMA)
[uncategorized] ~861-~861: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts anidto a fully-qualified URI. ```ts z.toJSONSchema(z.globalRegi...(HYPHENATED_LY_ADVERB_ADJECTIVE)
packages/docs/content/index.mdx (4)
1-8: Initial Setup and Imports are Clean
The front matter and import statements (lines 1–8) are well defined; the file correctly sets a centered layout and properly imports both accordion and tab components as well as sponsorship components.
66-73: Beta Release Announcement Section
The beta announcement (lines 66–73) is clear and engaging. The use of a separate div and clear call-to-action (“Click here to read the release notes”) is a good UX practice.
97-116: Installation and Requirements Sections are Informative
The sections detailing TypeScript version requirements, enablingstrictmode, and installation instructions are well written and provide essential information for new users.
153-184: Sponsors Section: Organized and Effective
The sponsors section is well organized, with clear headings for Platinum, Gold, Silver, and Bronze tiers. The inclusion of the respective components keeps the content modular and easy to update as sponsorship details change.packages/docs/content/generic-functions.mdx (4)
1-8: Front Matter and Introduction are Clear
The front matter (lines 1–3) and the introductory paragraph on generic functions are succinct and set the stage for the examples that follow.
12-15: Initial Example Demonstrating a Pitfall
The first code snippet (lines 12–15) correctly illustrates the issue with using a generic parameter of typez.ZodType<T>. This is an effective way to introduce the discussion on type loss.
56-60: Corrected Example with Type Casting is Clear
The improvedparseDatafunction (lines 56–60) correctly uses a type cast to ensure the inferred type is preserved. The inline comment also effectively highlights the change.
66-90: Constraining Inputs Example is Informative
The final example demonstrating how to constrain allowable schemas (lines 66–90) is clear and provides useful feedback through the TypeScript error when passing an incorrect schema type.packages/docs/content/packages/zod.mdx (5)
1-4: Front Matter is Succinct and Accurate
The front matter (lines 1–3) correctly sets the title for the documentation page.
5-10: Overview of thezodPackage
The introductory paragraph (lines 5–10) provides a solid high-level overview of thezodpackage, emphasizing the library’s focus on developer experience and bundle size.
11-19: Schema Definition Example is Clear and Concise
The code snippet demonstrating the use ofz.interface(lines 11–19) is well written and gives a clear example of defining a schema usingzod.
21-28: Chaining API Example is Informative
The chaining example (lines 21–28) illustrates how to use method chaining for schema configuration. This example is succinct and demonstrates multiple methods in a compact form.
32-74: Comprehensive Method List
The detailed list of methods (lines 32–74) is very comprehensive. It clearly documents parsing, refinement, wrapping, metadata, and utility methods available on Zod schemas. This level of detail will be extremely helpful for developers.packages/docs/content/parsing.mdx (1)
1-33: LGTMThe documentation clearly explains the various parsing methods with comprehensive and accurate examples.
packages/docs/content/metadata.mdx (1)
1-7: Front Matter and Imports Look Good
The YAML front matter and import statements are correctly formatted and clear.packages/docs/content/v4/index.mdx (1)
1-7: Front Matter and Import Section Are Solid
The YAML front matter, title, and import statements are all in order.packages/docs/content/packages/core.mdx (1)
1-4: Front Matter and Introduction Are Clear
The front matter and introductory text clearly set the stage for this documentation page.packages/docs/content/v4/changelog.mdx (2)
1-7: Changelog Front Matter and Import Statements Are Well Structured
The front matter, title, and initial import statements (lines 1–7) are properly formatted.
52-98: Error Customization Examples Are Informative
The side-by-side examples comparing Zod 4 with Zod 3 for error customization (using Tabs) are clear and helpful. Ensure that code formatting remains consistent throughout the document.packages/docs/content/error-formatting.mdx (3)
1-7: Front Matter and Imports Are in Order
The YAML front matter and the import statements (lines 1–7) for this document look good.
8-15: Error Formatting Intro and Schema Example Look Good
The introduction outlining the importance of complete and correct error reporting is clear, and the following simple schema example effectively sets up the context.🧰 Tools
🪛 LanguageTool
[style] ~8-~8: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ...d correctness in its error reporting. In many cases, it's helpful to convert the `$ZodError...(IN_MANY_STYLE_CASES)
87-90: Optional Chaining Usage Demonstrated Well
The example demonstrating the use of optional chaining to access errors in nested properties is correct and clearly illustrates the intended usage.🧰 Tools
🪛 LanguageTool
[formatting] ~87-~87: Did you mean “?”
Context: ...`` > Be sure to use optional chaining (?.) to avoid errors when accessing nested...(MULTIPLE_PUNCTATION_MARKS_1)
| --- | ||
| title: JSON | ||
| description: Components | ||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Front Matter Block: Clean and Well-Defined
The YAML front matter is correctly defined with a title and description, which will be useful for metadata and page organization. Please ensure these values align with your documentation conventions throughout the site.
| ## Code Block | ||
|
|
||
| ```js | ||
| console.log('Hello World'); | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Code Block Section: Proper Formatting
The code block is formatted correctly with the JavaScript language specifier. The example using console.log('Hello World'); is clear and demonstrates basic functionality. Consider whether a more context-driven code snippet related to JSON components is needed.
| **What about transforms?** | ||
|
|
||
| In reality each Zod schema internally tracks **two** types: an input and an output. For most schemas (e.g. `z.string()`) these two are the same. But once you add transforms into the mix, these two values can diverge. For instance `z.string().transform(val => val.length)` has an input of `string` and an output of `number`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Nitpick: Punctuation in the "What about transforms?" section
In line 17, the example explanation would read more naturally with a comma after “For instance”. Consider changing:
-For instance `z.string().transform(val => val.length)` has an input of `string` and an output of `number.
+For instance, `z.string().transform(val => val.length)` has an input of `string` and an output of `number.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| **What about transforms?** | |
| In reality each Zod schema internally tracks **two** types: an input and an output. For most schemas (e.g. `z.string()`) these two are the same. But once you add transforms into the mix, these two values can diverge. For instance `z.string().transform(val => val.length)` has an input of `string` and an output of `number`. | |
| **What about transforms?** | |
| In reality each Zod schema internally tracks **two** types: an input and an output. For most schemas (e.g. `z.string()`) these two are the same. But once you add transforms into the mix, these two values can diverge. For instance, `z.string().transform(val => val.length)` has an input of `string` and an output of `number`. |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~17-~17: A comma might be missing here.
Context: ...les ``` What about transforms? In reality each Zod schema internally tracks **two...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[typographical] ~17-~17: After the expression ‘for example’ a comma is usually used.
Context: ... mix, these two values can diverge. For instance `z.string().transform(val => val.length...
(COMMA_FOR_EXAMPLE)
| ``` | ||
|
|
||
| ### `metadata` | ||
|
|
||
| > If you haven't already, read through the [Metadata and registries](/metadata) page for context on storing metadata in Zod. | ||
|
|
||
| In Zod metadata is stored in registries. Zod exports a global registry `z.globalRegistry` that can be used to store common metadata fields like `id`, `title`, `description`, and `examples`. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Stylistic Suggestion: Adding a missing comma for clarity
In the “metadata” section, the text currently reads:
In Zod metadata is stored in registries. Zod exports a global registry `z.globalRegistry` that can be used to store common metadata fields like `id`, `title`, `description`, and `examples`.
To improve clarity, consider adding a comma after “In Zod”:
-In Zod metadata is stored in registries. Zod exports a global registry ...
+In Zod, metadata is stored in registries. Zod exports a global registry ...📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| ### `metadata` | |
| > If you haven't already, read through the [Metadata and registries](/metadata) page for context on storing metadata in Zod. | |
| In Zod metadata is stored in registries. Zod exports a global registry `z.globalRegistry` that can be used to store common metadata fields like `id`, `title`, `description`, and `examples`. | |
| ### `metadata` | |
| > If you haven't already, read through the [Metadata and registries](/metadata) page for context on storing metadata in Zod. | |
| In Zod, metadata is stored in registries. Zod exports a global registry `z.globalRegistry` that can be used to store common metadata fields like `id`, `title`, `description`, and `examples`. |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~267-~267: A comma might be missing here.
Context: ...context on storing metadata in Zod. In Zod metadata is stored in registries. Zod e...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
|
|
||
| By default the `$ref` URIs are relative paths like `"User"`. To make these absolute URIs, use the `uri` option. This expects a function that converts an `id` to a fully-qualified URI. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Minor Formatting: Adding a comma for introductory phrase
In the "Registries" section, the sentence begins with “By default the $ref URIs are relative paths…”. Adding a comma after “By default” enhances the flow:
-By default the `$ref` URIs are relative paths like "User".
+By default, the `$ref` URIs are relative paths like "User".📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| By default the `$ref` URIs are relative paths like `"User"`. To make these absolute URIs, use the `uri` option. This expects a function that converts an `id` to a fully-qualified URI. | |
| By default, the `$ref` URIs are relative paths like `"User"`. To make these absolute URIs, use the `uri` option. This expects a function that converts an `id` to a fully-qualified URI. |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~860-~860: Did you mean: “By default,”?
Context: ...try will be extracted into schemas. By default the $ref URIs are relative paths like...
(BY_DEFAULT_COMMA)
[uncategorized] ~861-~861: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...s a function that converts an id to a fully-qualified URI. ```ts z.toJSONSchema(z.globalRegi...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
|
|
||
| By default, validation issues from checks are considered *continuable*; that is, Zod will execute *all* checks in sequence, even if one of them causes an validation error. This is usually desirable, so Zod can present a comprehensive list of validation issues in one go. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Grammar Correction: Correct article usage
Ensure that the correct article is used in contexts such as “a validation error” (not “an validation error”).
🧰 Tools
🪛 LanguageTool
[misspelling] ~1907-~1907: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...in sequence, even if one of them causes an validation error. This is usually desir...
(EN_A_VS_AN)
| /* [ | ||
| { "code": "custom", "message": "Too short!" }, | ||
| { "code": "custom", "message": "Must be lowercase" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Punctuation Check: Review sentence endings
There appears to be a loose punctuation mark in this section. Please review and adjust the punctuation to maintain consistency in the error message examples.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1935-~1935: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }, { "code": "custom", "message": "Must...
(UNLIKELY_OPENING_PUNCTUATION)
| result.error!.issues; | ||
| // [ { "code": "custom", "message": "Too short!" }] | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Punctuation Check: Consistency in error messaging
Ensure that punctuation surrounding the error issues is consistent and clear. A review of the surrounding text may help eliminate any loose punctuation marks.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1966-~1966: Loose punctuation mark.
Context: ...ode": "custom", "message": "Too short!" }] ``` To customize the e...
(UNLIKELY_OPENING_PUNCTUATION)
|
|
||
| Most commonly, transforms are used in conjunction with [Pipes](#pipes). This combination is useful for performing some initial validation, then transforming the parsed data into another form. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Language Improvement: Simplify wording
The phrase “in conjunction with [Pipes]” could be simplified (for example, “together with [Pipes]”) to improve clarity and reduce wordiness.
🧰 Tools
🪛 LanguageTool
[style] ~2266-~2266: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...`` Most commonly, transforms are used in conjunction with Pipes. This combination is us...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
|
|
||
| In some cases, its can be desirable to simulate [nominal typing](https://en.wikipedia.org/wiki/Nominal_type_system) inside TypeScript. This can be achieved with *branded types* (also known as "opaque types"). | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Grammar Correction: Fix pronoun usage
In the sentence “In some cases, its can be desirable to simulate nominal typing…”, replace “its” with “it” so that it reads “it can be desirable…”.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~2474-~2474: “its” (belonging to it) seems less likely than “it”
Context: ...fido; // works fine ``` In some cases, its can be desirable to simulate [nominal t...
(AI_HYDRA_LEO_CPT_ITS_IT)
Summary by CodeRabbit
Documentation
New Features