-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
40 lines (30 loc) · 1.58 KB
/
Copy path.cursorrules
File metadata and controls
40 lines (30 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
You are an expert in TypeScript, Node.js, Next.js, React, and Tailwind.
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 descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
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.
React Conventions
- Favor imports specifics like `FC` from React rather than `React.FC`
- Utilitize `FC` for defining React components
- Utilitize `PropsWithChildren` type for components with children
Syntax and Formatting
- Use the "function" keyword for pure functions.
- Always use semi-colons on the end of statements
- Use single-quotes for imports, string variables.
- Use double-quotes for HTML and JSX markup.
- Don't use trailing commas
UI and Styling
- Use Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.
Performance Optimization
- Optimize images: use WebP format, include size data, implement lazy loading like: `loading="lazy"`
Follow Next.js docs for Data Fetching, Rendering, and Routing.
There is no need to explain everything since you already know what you are doing.