mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Update Cursor rules
This commit is contained in:
@@ -31,7 +31,7 @@ When working with this project, follow these rules:
|
|||||||
- If the typecheck passed, there's no need for checking the linter errors.
|
- If the typecheck passed, there's no need for checking the linter errors.
|
||||||
|
|
||||||
## Async Operations
|
## Async Operations
|
||||||
- When you need a delay, use `await delay(millis);` in an async function. If the current function is not async,
|
- When you need a delay, use `await delay(millis);` from `@/utils/utils` in an async function. If the current function is not async,
|
||||||
make it async.
|
make it async.
|
||||||
|
|
||||||
## Database
|
## Database
|
||||||
@@ -51,3 +51,8 @@ When working with this project, follow these rules:
|
|||||||
- Batch tool calls when possible to reduce latency
|
- Batch tool calls when possible to reduce latency
|
||||||
- Use semantic search before grep when looking for concepts
|
- Use semantic search before grep when looking for concepts
|
||||||
- Use TODOs for complex multi-step tasks to track progress
|
- Use TODOs for complex multi-step tasks to track progress
|
||||||
|
|
||||||
|
## Styling
|
||||||
|
- Use SCSS modules
|
||||||
|
- Use nested styles
|
||||||
|
- Put SCSS into one folder per page
|
||||||
@@ -3,10 +3,11 @@ alwaysApply: true
|
|||||||
---
|
---
|
||||||
When you work with UI:
|
When you work with UI:
|
||||||
|
|
||||||
1. Use MDUI components as HTML elements with the name "mdui-***". In JSX/TSX use the same elements and props as in HTML.
|
1. Use MDUI components through the wrapper: `@/utils/material`. If the component you want to use is missing in that wrapper,
|
||||||
|
add it. Do NOT remove anything.
|
||||||
3. The supporting text slot for MDUI lists is "description".
|
3. The supporting text slot for MDUI lists is "description".
|
||||||
4. When working with lists/sets in states, use the "useImmer" hook.
|
4. When working with lists/sets in states, use the "useImmer" hook.
|
||||||
5. Do NOT use inline styles in React components if they are static, instead write them in CSS.
|
5. Do NOT use inline styles in React components if they are static, instead write them in CSS.
|
||||||
The CSS is placed in `frontend/src/resources/css/`. Find the appropriate file to put the styles in.
|
Find the appropriate file to put the styles in, or create a new one.
|
||||||
6. In SCSS, for Material Design colors use `$color-dark-<color-name>` variables. For all colors, refer
|
6. In SCSS, for Material Design colors use `$color-dark-<color-name>` variables. For all colors, refer
|
||||||
to `frontend/src/resources/css/common/_colors.scss`.
|
to `frontend/src/css/_material.scss`.
|
||||||
Reference in New Issue
Block a user