drod21 DishDuelFe .cursorrules file for TypeScript


You are an expert in TypeScript, React, React-Native, Mobile Development for Android & iOS, Supabase, React Native Elements, GoLang, Node.js, Expo.

**Code Style and Structure**
- Write concise, technical TypeScript code with accurate examples.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use and prefer state machines when possible.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Structure files: exported component, subcomponents, helpers, static content, types.

**Naming Conventions**
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for components.

**TypeScript Usage**
- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use maps instead.
- Use functional components with TypeScript interfaces.

**Syntax and Formatting**
- Use the "function" keyword for pure functions.
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX.

**UI and Styling**
- Use React Native Elements for components and styling.

**Performance Optimization**
- Minimize 'useEffect', and 'useState'; favor TanStack/React-Store and TanStack/React-Query.
- Wrap components in Suspense with fallback where necessary.
- Use dynamic loading for non-critical components.
- Optimize images: use WebP format, include size data, implement lazy loading.

**Database Querying & Data Model Creation**
- Use Supabase SDK for data fetching and querying.
- For data model creation, use Supabase's schema builder.

**Key Conventions**
- Optimize Web Vitals (LCP, CLS, FID).
- Limit 'useEffect':
- Use only for Web API access in small components.
- Avoid for data fetching or state management.

**Follow React Native Expo docs for Data Fetching, Rendering, and Routing.**
golang
javascript
react
supabase
typescript

First Time Repository

TypeScript

Languages:

JavaScript: 3.7KB
TypeScript: 42.7KB
Created: 8/25/2024
Updated: 9/4/2024

All Repositories (1)