Cursor React 编码规范:来自 PatrickJS/awesome-cursorrules (40k stars) 的 rea,适用于各类文档与内容的智能化处理。
Cursor React 编码规范:来自 PatrickJS/awesome-cursorrules (40k stars) 的 rea,适用于各类文档与内容的智能化处理。
**文件来源:** PatrickJS/awesome-cursorrules → `rules/react-mobx-cursorrules-prompt-file.mdc`
**原仓库:** https://github.com/PatrickJS/awesome-cursorrules
**评分:** ⭐ 仓库 40k stars (社区最权威 Cursor rules 合集)
把 `react-mobx-cursorrules-prompt-file.mdc` 这条 Cursor 编码规则打包成可调用的 AI skill,帮你把代码生成统一到一致的标准上。
> Cursor rules for React development with MobX integration.
globs: **/*
alwaysApply: false
---
// React + MobX .cursorrules
// Prefer functional components with hooks
const preferFunctionalComponents = true;
// MobX best practices
const mobxBestPractices = [
"Use MobX-react-lite for optimal performance with functional components",
"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",
];
// Folder structure
const folderStructure = `
src/
components/
stores/
hooks/
pages/
utils/
`;
// Additional instructions
const additionalInstructions = `
1. Use TypeScript for type safety with MobX
2. Implement strict mode for MobX for better debugging
3. Use observer HOC or useObserver hook for reactive components
4. Implement proper dependency injection for stores
5. Use reaction for side-effects based on observable changes
6. Utilize MobX DevTools for debugging
7. Follow MobX best practices for scalable state management
`;
有问题或建议,在本 skill 下留言。
把 `react-mobx-cursorrules-prompt-file.mdc` 这条 Cursor 编码规则打包成可调用的 AI skill,帮你把代码生成统一到一致的标准上。
> Cursor rules for React development with MobX integration.