Cursor rule
.cursor/rules/react-general-guidelines.mdcReact general guidelines for Twenty CRM
Cursor rules
Quality
61/100
Scores the file, not the repository.Length
257 words
6 headings · 4 code blocksRepository
26
— · pushed 116 days agoLast changed
3 days ago
First indexed 3 days ago.12345# React Guidelines67## Core Rules8- **Functional components only** (no classes)9- **Named exports only** (no default exports)10- **Event handlers over useEffect** for state updates1112## Component Structure13```typescript14// ✅ Correct15export const UserProfile = ({ user, onEdit }: UserProfileProps) => {16 const handleEdit = () => onEdit(user.id);1718 return (19 <StyledContainer>20 <h1>{user.name}</h1>21 <Button onClick={handleEdit}>Edit</Button>22 </StyledContainer>23 );24};25```2627## Props & Event Handlers28```typescript29// ✅ Correct - Destructure props30const Button = ({ onClick, isDisabled, children }: ButtonProps) => (31 <button onClick={onClick} disabled={isDisabled}>32 {children}33 </button>34);3536// ✅ Correct - Event handlers over useEffect37const UserForm = ({ onSubmit }: UserFormProps) => {38 const handleSubmit = async (data: FormData) => {39 await onSubmit(data);40 // Direct event handling, not useEffect41 };4243 return <Form onSubmit={handleSubmit} />;44};45```4647## Component Design48- **Small, focused components** - Single responsibility49- **Composition over inheritance** - Combine simple components50- **Extract complex logic** into custom hooks5152```typescript53// ✅ Good - Composed from smaller components54const UserCard = ({ user }: UserCardProps) => (55 <StyledCard>56 <UserAvatar user={user} />57 <UserInfo user={user} />58 <UserActions user={user} />59 </StyledCard>60);61```6263## Performance64```typescript65// ✅ Use memo for expensive components only66const ExpensiveChart = memo(({ data }: ChartProps) => {67 // Complex rendering logic68 return <ComplexChart data={data} />;69});7071// ✅ Memoize callbacks when needed72const UserList = ({ users, onUserSelect }: UserListProps) => {73 const handleUserSelect = useCallback((user: User) => {74 onUserSelect(user);75 }, [onUserSelect]);7677 return (78 <div>79 {users.map(user => (80 <UserItem key={user.id} user={user} onSelect={handleUserSelect} />81 ))}82 </div>83 );84};85```
Also in nowtec/nowCRM
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nowtec/nowCRM.cursor/rules/architecture.mdc · 26 | Cursor rules | arch | 54/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/code-style.mdc · 26 | Cursor rules | lint-formatstylearchdocs | 62/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/file-structure.mdc · 26 | Cursor rules | buildstylearch | 70/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/readme.mdc · 26 | Cursor rules | testlint-formatarchtypes+2 | 73/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/testing-guidelines.mdc · 26 | Cursor rules | setupteststylearch+3 | 73/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/translations.mdc · 26 | Cursor rules | stylearchagent-behaviour | 62/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/typescript-guidelines.mdc · 26 | Cursor rules | styletypesui | 58/100 | 3 days ago | |
| nowtec/nowCRMCLAUDE.md · 26 | CLAUDE.md | buildstyledeployment | 21/100 | 3 days ago |
Diff against .cursor/rules/architecture.mdc Diff against .cursor/rules/code-style.mdc Diff against .cursor/rules/file-structure.mdc Diff against .cursor/rules/readme.mdc Diff against .cursor/rules/testing-guidelines.mdc Diff against .cursor/rules/translations.mdc Diff against .cursor/rules/typescript-guidelines.mdc Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
