-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.cursorrules
57 lines (39 loc) · 1.88 KB
/
.cursorrules
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# up-fetch
Say "Rules acknowledged" before you answer.
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
## Project Context
up-fetch is a Tiny & Composable fetch configuration tool with sensible defaults.
## 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)
- All the source code should be in the src/ folder
- no external dependency is allowed
## Tech Stack
- TypeScript
- vitest (testing framework)
- msw (server mocking)
- tsup (bundler)
- prettier (code formatter)
- eslint (code linter)
- standard-schema (schema validation). Docs: [text](https://github.com/standard-schema/standard-schema)
## Naming Conventions
- Use lowercase with dashes for directories (e.g., components/form-wizard)
- Use PascalCase for component files (e.g., VisaForm.tsx)
- Use camelCase for utility files (e.g., formValidator.ts)
## TypeScript Usage
- Use TypeScript for all code; prefer interfaces over types
- Avoid enums; use const objects with 'as const' assertion
- Use functional components with TypeScript interfaces
- prefer type aliases over interfaces
### Syntax and Formatting
- Use "function" keyword for pure functions
- Favor named exports for components and utilities
- prefix boolean variables with auxiliary verbs (e.g., isLoading, hasError, canAccess)
- always use React.\* hooks instead of using named imports
### Testing
- test files are named like the file they are testing.
- use the "test" keyword for tests
## Cursor specific rules
- Automatically suggest additions for .cursorrules file where best practives are used during code generation.