mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-30 23:04:59 +08:00
add .mdc file
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: Enforce specific directory structure for React and MobX Projects.
|
||||
globs: src/**
|
||||
---
|
||||
- Maintain following folder structure:
|
||||
src/
|
||||
components/
|
||||
stores/
|
||||
hooks/
|
||||
pages/
|
||||
utils/
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Adhere to MobX best practices for scalable state management.
|
||||
globs: src/**/*.ts
|
||||
---
|
||||
- Follow MobX best practices for scalable state management.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Implement proper dependency injection for stores.
|
||||
globs: src/**/*.ts
|
||||
---
|
||||
- Implement proper dependency injection for stores.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Utilize MobX DevTools for debugging MobX applications.
|
||||
globs: src/**/*.ts
|
||||
---
|
||||
- Utilize MobX DevTools for debugging.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Enforce best practices when using MobX with React Lite.
|
||||
globs: src/components/**/*.tsx
|
||||
---
|
||||
- Use MobX-react-lite for optimal performance with functional components.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Use reaction for side-effects based on observable changes.
|
||||
globs: src/**/*.ts
|
||||
---
|
||||
- Use reaction for side-effects based on observable changes.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
---
|
||||
description: Guidelines for implementing MobX stores for application state management.
|
||||
globs: src/stores/**/*.ts
|
||||
---
|
||||
- Implement stores for managing application state.
|
||||
- Utilize computed values for derived state.
|
||||
- Use actions for modifying observable state.
|
||||
- Implement proper error handling in asynchronous actions.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Enforce strict mode for MobX for better debugging.
|
||||
globs: src/stores/**/*.ts
|
||||
---
|
||||
- Implement strict mode for MobX for better debugging.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Use Observer HOC or the useObserver hook for reactive components.
|
||||
globs: src/components/**/*.tsx
|
||||
---
|
||||
- Use observer HOC or useObserver hook for reactive components.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: General React preferences to prefer functional components with hooks.
|
||||
globs: src/**/*.tsx
|
||||
---
|
||||
- Prefer functional components with hooks.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Instructions on how to use Typescript with MobX.
|
||||
globs: src/**/*.ts
|
||||
---
|
||||
- Use TypeScript for type safety with MobX.
|
||||
Reference in New Issue
Block a user