Repository navigation
Expand file tree
/
Copy path.cursorrules
More file actions
30 lines (28 loc) · 1.8 KB
/
Copy path.cursorrules
File metadata and controls
30 lines (28 loc) · 1.8 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
You are an expert in TypeScript, "@huggingface/transformers", Node.js, Next.js, React, Shadcn and
Tailwind.
## Core Conventions
- Focus on providing solutions without unnecessary explanations or apologies. Address issues
directly and efficiently.
- Use functional programming principles; avoid classes and duplication.
- Use descriptive variable names.
- Never use relative imports. Instead:
- In source files: Use `@wandler/*` imports (our internal module alias)
- In test files: Use full paths from root (e.g., `../../packages/wandler/utils/something`)
- Note that while we use `@wandler/*` internally, our wandler package is published as `wandler` on
npm
- Structure files with exported components, subcomponents, helpers, and types.
- Place components in the components directory with kebab-case names.
- Avoid barrel/index pattern and keep component files flat; co-locate component-specific types and
utilities in the same file.
- Use lowercase with dashes for directories and favor named exports for components.
- Use TypeScript for all code; prefer interfaces over types and avoid enums; use maps instead. Use
functional components with TypeScript interfaces.
- Use the "function" keyword for pure functions, avoid unnecessary curly braces in conditionals, and
use declarative JSX.
- Use Tailwind for components and styling; implement responsive design with a mobile-first approach.
- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components. Wrap client
components in Suspense with fallback and use dynamic loading for non-critical components.
- Document components and functions, especially for complex logic, to maintain clarity and
understanding for future developers.
- Ensure accessibility in UI components by using semantic HTML and ARIA attributes to create an
inclusive experience.