Cursor rule
.cursor/rules/code-style.mdcCode style guidelines for NOWCRM
Cursor rules
Quality
62/100
Scores the file, not the repository.Length
287 words
6 headings · 4 code blocksRepository
26
— · pushed 116 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Code Style Guidelines78## Formatting Standards9- **Prettier**: 2-space indentation, single quotes, trailing commas, semicolons10- **Print width**: 80 characters11- **ESLint**: No unused imports, consistent import ordering, prefer const over let1213## Naming Conventions14```typescript15// ✅ Variables and functions - camelCase16const userAccountBalance = 1000;17const calculateMonthlyPayment = () => {};1819// ✅ Constants - SCREAMING_SNAKE_CASE20const API_ROUTES_STRAPI = {21 USERS: 'users',22 CONTATs: 'contacts',23} as const;2425// ✅ Types and Classes - PascalCase26class UserService {}27type UserAccountData = {};28type ButtonProps = {}; // Component props suffix with 'Props'2930// ✅ Files and directories - kebab-case31// user-profile.component.tsx32// user-profile.styles.ts33```3435## Function Structure36```typescript37// ✅ Small, focused functions38// ✅ Required parameters first, optional last39const processUserData = (40 user: User,41 options: ProcessingOptions,42 callback?: (result: ProcessedUser) => void43): ProcessedUser => {44 const processedUser = transformUserData(user);45 applyOptions(processedUser, options);4647 if (callback) {48 callback(processedUser);49 }5051 return processedUser;52};53```5455## Comments56```typescript57// ✅ Explain business logic and non-obvious intentions58// Apply 15% discount for premium users with orders > $10059const discount = isPremiumUser && orderTotal > 100 ? 0.15 : 0;6061// TODO: Replace with proper authentication service62const isAuthenticated = localStorage.getItem('token') !== null;6364/**65 * JSDoc for public APIs66 * @param basePrice - The base price before modifications67 * @returns The final price after tax and discount68 */69const calculateTotalPrice = (basePrice: number): number => {70 // Implementation71};72```7374## Error Handling75```typescript76// ✅ Proper error types and meaningful messages77try {78 const user = await userService.findById(userId);79 if (!user) {80 throw new UserNotFoundError(`User with ID ${userId} not found`);81 }82 return user;83} catch (error) {84 logger.error('Failed to fetch user', { userId, error });85 throw error;86}87```
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/file-structure.mdc · 26 | Cursor rules | buildstylearch | 70/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/react-general-guidelines.mdc · 26 | Cursor rules | archuiperformancedo-not | 61/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/file-structure.mdc Diff against .cursor/rules/react-general-guidelines.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 |
