Skip to content

Instantly share code, notes, and snippets.

@tomredman
Created January 22, 2025 22:12
Show Gist options
  • Save tomredman/70ad5b7bd53ef5e8b445a36e5fa5b0cc to your computer and use it in GitHub Desktop.
Save tomredman/70ad5b7bd53ef5e8b445a36e5fa5b0cc to your computer and use it in GitHub Desktop.
.cursorrules for project using Convex, Typescript, React 19, shadcn, TanStack *, etc.
{
"recommendations": {
"convex": {
"fileStructure": {
"queries": "convex/{feature}/queries.ts",
"mutations": "convex/{feature}/mutations.ts",
"actions": "convex/{feature}/actions.ts"
},
"rules": [
"Actions must include 'use node' when using Node.js packages",
"Actions cannot use ctx.db directly - use ctx.runQuery or ctx.runMutation",
"Queries and mutations should be transactional",
"Use proper Convex pagination with cursor-based approach",
"Follow schema definitions in convex/schemas/"
]
},
"react": {
"components": {
"location": "app/components/",
"styling": "Use shadcn/ui components with Tailwind CSS",
"naming": "PascalCase for components, kebab-case for files"
}
},
"typescript": {
"strict": true,
"rules": [
"Use proper type imports",
"Leverage path aliases (@/ prefix)",
"Define proper interfaces and types in app/types/"
]
},
"imports": {
"preferences": [
"Use path aliases (@/components, @/lib, etc.)",
"Group imports by type (React, components, utils, types)",
"Avoid relative imports beyond one level"
]
},
"email": {
"templates": {
"location": "convex/resend/emails/",
"framework": "React Email components"
}
},
"testing": {
"location": "__tests__/",
"naming": "{feature}.test.ts"
},
"styles": {
"tailwind": {
"theme": "new-york",
"customization": "tailwind.config.js",
"variables": "Use CSS variables for theming"
}
}
},
"formatting": {
"indentation": "spaces",
"quotes": "single",
"semicolons": true
},
"dependencies": {
"packageManager": "npm",
"react": {
"version": "^19.0.0",
"peerDependencies": true
},
"build": {
"tool": "bun",
"dev": "npm run dev"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment