Skip to content

Commit 38ffec8

Browse files
committed
docs: update code quality and frontend rules for Vite cache management and icon usage
- Added guidelines for clearing Vite cache after updating npm packages - Emphasized the use of Redis UI icons and provided instructions for icon usage and exceptions for custom icons
1 parent 1004367 commit 38ffec8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.ai/rules/code-quality.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ alwaysApply: true
6464
- Clean up subscriptions and timers
6565
- Use constants instead of magic numbers
6666

67+
## Vite Cache Management
68+
69+
When updating npm packages (especially `@redis-ui/*` packages):
70+
71+
1. **Clear Vite cache** after `yarn install`:
72+
73+
```bash
74+
rm -rf node_modules/.vite
75+
rm -rf redisinsight/ui/node_modules/.vite
76+
```
77+
78+
2. **Restart dev server** to rebuild dependencies
79+
80+
3. This ensures new package versions are properly loaded
81+
6782
## Pre-Commit Checklist
6883

6984
- [ ] `yarn lint` passes
@@ -75,3 +90,4 @@ alwaysApply: true
7590
- [ ] Descriptive variable names
7691
- [ ] Low cognitive complexity
7792
- [ ] No duplicate code
93+
- [ ] Vite cache cleared (if updated dependencies)

.ai/rules/frontend.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,24 @@ import { EuiButton } from '@elastic/eui';
270270
- ❌ Do not import directly from `@redis-ui/*`
271271
- ❌ Do not add new Elastic UI imports
272272

273+
## Icons
274+
275+
**⚠️ IMPORTANT**: Always use icons from Redis UI library instead of custom SVGs.
276+
277+
### Icon Usage
278+
279+
- **Use Redis UI icons** from `@redis-ui/icons` via `iconRegistry.tsx`
280+
- Icons are automatically exported via `export * from '@redis-ui/icons'` in `iconRegistry.tsx`
281+
- Use `RiIcon` component with icon type: `<RiIcon type="FolderOpenIcon" />`
282+
- **DO NOT create custom SVG icons** - check if the icon exists in Redis UI library first
283+
284+
### Custom Icons (Exception)
285+
286+
Only create custom SVG icons if:
287+
288+
- The icon doesn't exist in Redis UI library
289+
- It's a project-specific icon that won't be added to the library
290+
273291
## Testing Components
274292

275293
### Always Use Shared `renderComponent` Helper

0 commit comments

Comments
 (0)