Files
shop-client/AGENTS.md
T
2026-06-11 13:48:08 +05:00

40 lines
1.5 KiB
Markdown

# AGENTS.md — shop-client
## Project structure
FSD architecture: app/pages/widgets/features/entities/shared
## Developer commands
| Command | What it does |
|---|---|
| `npm run dev` | Vite dev server on :5173, proxies /api and /uploads to 127.0.0.1:3333 |
| `npm run build` | Runs tsc -b first, then vite build |
| `npm run lint` | ESLint (flat config) |
| `npm run lint:fix` | ESLint with --fix |
| `npm run format` | Prettier write all |
| `npm run format:check` | Prettier check only |
| `npm test` | vitest run |
| `npm run test:watch` | vitest watch mode |
## Conventions
- **Language**: Отвечай пользователю на русском.
- **Single quotes**, no semicolons, trailing commas, 120 print width (Prettier + ESLint enforce).
- **FSD import boundaries** enforced by eslint-plugin-boundaries. Lower layers cannot import upper layers.
- **Aliases**: @/ → client/src/, @shared/ → ../../shop-server/shared/
- **API requests**: Use apiClient (axios wrapper from shared/api/) with @tanstack/react-query. Invalidate queries after mutations.
- **UI**: Prefer MUI components over custom HTML/CSS.
- **no-console**: ESLint error; use console.warn/error/info only.
## Testing
- vitest + jsdom + @testing-library/react
- Setup file: src/testing/setup.ts
- Test files live in __tests__/ directories next to the code they test.
## Important
- shop-server must be cloned alongside shop-client for @shared/ alias to resolve.
- Vite dev server relies on backend running at 127.0.0.1:3333. Start server first.