Skip to content

Instantly share code, notes, and snippets.

View spacedawwwg's full-sized avatar
👨‍💻
Tappin' codes.

Paul Welsh spacedawwwg

👨‍💻
Tappin' codes.
View GitHub Profile
----------------------------------SANITY RULES----------------------------------
When creating sanity schema make sure to include an appropriate icon for the schema using lucide-react or sanity icons as a fallback. Make sure it's always a named export, make sure you're always using the Sanity typescript definitions if it's a ts file. Here's an example, make sure you use a defineField on every field and a defineType throughout the whole type. If you don't see any arrayMembers, don't import it:
import {defineField, defineType, defineArrayMember} from 'sanity' if it's a .ts file.
defineType({
type: 'object',
name: 'custom-object',
fields: [
defineField({