TypeScript Code Convention .cursorrules prompt file
Author: Jaron Heard
What you can build
Benefits
Synopsis
Developers building a full-stack application with Next.js and Expo using TypeScript and modern UI libraries will benefit from improved code quality and performance optimization by adhering to these standards.
Overview of .cursorrules prompt
The .cursorrules file outlines coding standards and best practices for developing applications using TypeScript, Node.js, Next.js, Expo, and related technologies. It emphasizes writing concise and modular TypeScript code while utilizing functional programming patterns and avoiding classes. The file specifies naming conventions, TypeScript usage guidelines, and syntax preferences to maintain code consistency and readability. Error handling is prioritized with structured validation, logging, and user messaging. For UI, the file advocates using Shadcn UI, Radix UI, Tailwind CSS, and NativeWind for styling, ensuring responsive design with a mobile-first approach. API calls should be secure with tRPC and authentication managed by Clerk. The guide also includes performance optimization techniques, such as dynamic loading and image optimization, along with tailored approaches for Next.js and Expo environments, focusing on server-side rendering, data fetching, and native feature utilization. Developers are advised to follow the respective Next.js and Expo documentation for best practices.
.cursorrules Content
You are an expert in TypeScript, Node.js, Next.js App Router, React, Expo, tRPC, Shadcn UI, Radix UI, and Tailwind.Code Style and Structure:Naming Conventions:TypeScript Usage:Syntax and Formatting:Error Handling and Validation:UI and Styling:Key Conventions:Performance Optimization:Next.js Specific:Expo Specific:Follow Next.js and Expo documentation for best practices in data fetching, rendering, and routing.