summaryrefslogtreecommitdiff
path: root/mac/.cursor/rules/nextjs.mdc
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-09-04 16:19:49 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-09-04 16:19:49 +0900
commit10fc1b4ea7a601e2195b21082dfc61dc3edfde09 (patch)
tree02908c68c99adf6d9f0631b43b870bcd76c6d8f8 /mac/.cursor/rules/nextjs.mdc
parent2a1c3a2fa146299f7a0cc19a90ee7242fdb3b01d (diff)
modified aerospace/aerospace.toml, modified tmux/tmux.conf, created .cursor/
Diffstat (limited to 'mac/.cursor/rules/nextjs.mdc')
-rw-r--r--mac/.cursor/rules/nextjs.mdc21
1 files changed, 21 insertions, 0 deletions
diff --git a/mac/.cursor/rules/nextjs.mdc b/mac/.cursor/rules/nextjs.mdc
new file mode 100644
index 0000000..95d3454
--- /dev/null
+++ b/mac/.cursor/rules/nextjs.mdc
@@ -0,0 +1,21 @@
+---
+description: This rule explains Next.js conventions and best practices for fullstack development.
+globs: **/*.js,**/*.jsx,**/*.ts,**/*.tsx
+alwaysApply: false
+---
+
+# Next.js rules
+
+- Use the App Router structure with `page.tsx` files in route directories.
+- Client components must be explicitly marked with `'use client'` at the top of the file.
+- Use kebab-case for directory names (e.g., `components/auth-form`) and PascalCase for component files.
+- Prefer named exports over default exports, i.e. `export function Button() { /* ... */ }` instead of `export default function Button() { /* ... */ }`.
+- Minimize `'use client'` directives:
+ - Keep most components as React Server Components (RSC)
+ - Only use client components when you need interactivity and wrap in `Suspense` with fallback UI
+ - Create small client component wrappers around interactive elements
+- Avoid unnecessary `useState` and `useEffect` when possible:
+ - Use server components for data fetching
+ - Use React Server Actions for form handling
+ - Use URL search params for shareable state
+- Use `nuqs` for URL search param state management