Skip to content
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

Streamline name casing in README #3285

Closed
wants to merge 1 commit into from

Conversation

kristiandupont
Copy link

As per this suggestion, I did a quick scan through the README and streamlined all name casing: schemas are camelCased, types are PascalCased.

Copy link

netlify bot commented Feb 29, 2024

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 366a85e
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/65e08ab8c5d8be00084500ec
😎 Deploy Preview https://deploy-preview-3285--guileless-rolypoly-866f8a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@colinhacks
Copy link
Owner

In a lot of cases I'm partial to Pascal-casing, since schemas ultimately represent types. This also enables a pattern that I personally love where a schema and it's inferred type can share a name. They are the runtime & static representation of the same type, so this feels right to me.

const Dog = z.object({
  name: z.string(),
  age: z.number(),
});

type Dog = z.infer<typeof Dog>

But for utility schemas with a self-evident static type I wouldn't capitalize.

const nonemptyString = z.string().min(1)

That's what I do and what feels natural to me within TypeScript norms.

I appreciate the PR, but a lot of the changes in this PR feel weird to me so I'm not going to merge. Ultimately people can do what they want and I don't think there's much value in trying to establish a dogma here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants