| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 6 | 3 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 1 | 3 | 2 | 17% |
What each file covers
Sections
0 shared · 6 only in A · 3 only in B- − Code Style Guidelines
- − Formatting Standards
- − Naming Conventions
- − Function Structure
- − Comments
- − Error Handling
- + Code Style
- + Services
- + CI/CD - build pipleline
Commands
neither file has anySection tags
1 shared · 3 only in A · 2 only in B- − lint-format
- − architecture
- − docs
- + build
- + deployment
- code-style
Line diff
nowtec/nowCRM · .cursor/rules/code-style.mdc
@@ −1 @@
1---
2description: Code style guidelines for NOWCRM
3globs:
4alwaysApply: true
5---
6# Code Style Guidelines
7
8## Formatting Standards
9- **Prettier**: 2-space indentation, single quotes, trailing commas, semicolons
10- **Print width**: 80 characters
11- **ESLint**: No unused imports, consistent import ordering, prefer const over let
12
13## Naming Conventions
14```typescript
15// ✅ Variables and functions - camelCase
16const userAccountBalance = 1000;
17const calculateMonthlyPayment = () => {};
18
19// ✅ Constants - SCREAMING_SNAKE_CASE
20const API_ROUTES_STRAPI = {
21 USERS: 'users',
22 CONTATs: 'contacts',
23} as const;
24
25// ✅ Types and Classes - PascalCase
26class UserService {}
27type UserAccountData = {};
28type ButtonProps = {}; // Component props suffix with 'Props'
29
30// ✅ Files and directories - kebab-case
31// user-profile.component.tsx
32// user-profile.styles.ts
33```
34
35## Function Structure
36```typescript
37// ✅ Small, focused functions
38// ✅ Required parameters first, optional last
39const processUserData = (
40 user: User,
41 options: ProcessingOptions,
42 callback?: (result: ProcessedUser) => void
43): ProcessedUser => {
44 const processedUser = transformUserData(user);
45 applyOptions(processedUser, options);
46
47 if (callback) {
48 callback(processedUser);
49 }
50
51 return processedUser;
52};
53```
54
55## Comments
56```typescript
57// ✅ Explain business logic and non-obvious intentions
58// Apply 15% discount for premium users with orders > $100
59const discount = isPremiumUser && orderTotal > 100 ? 0.15 : 0;
60
61// TODO: Replace with proper authentication service
62const isAuthenticated = localStorage.getItem('token') !== null;
63
64/**
65 * JSDoc for public APIs
66 * @param basePrice - The base price before modifications
67 * @returns The final price after tax and discount
68 */
69const calculateTotalPrice = (basePrice: number): number => {
70 // Implementation
71};
72```
73
74## Error Handling
75```typescript
76// ✅ Proper error types and meaningful messages
77try {
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```
nowtec/nowCRM · CLAUDE.md
@@ +1 @@
1# Code Style
2Read coding guidelines completed
3.cursor/rules
4
5
6# Services
7See all the services under **apps** directory
8
9
10# CI/CD - build pipleline
11.github/workflows/main.yaml - creates release, builds services, pushed to Github registry, sends notification to Telegram
@@ −1 +1 @@
1−---
2−description: Code style guidelines for NOWCRM
3−globs:
4−alwaysApply: true
5−---
6−# Code Style Guidelines
1+# Code Style
2+Read coding guidelines completed
3+.cursor/rules
74
8−## Formatting Standards
9−- **Prettier**: 2-space indentation, single quotes, trailing commas, semicolons
10−- **Print width**: 80 characters
11−- **ESLint**: No unused imports, consistent import ordering, prefer const over let
125
13−## Naming Conventions
14−```typescript
15−// ✅ Variables and functions - camelCase
16−const userAccountBalance = 1000;
17−const calculateMonthlyPayment = () => {};
6+# Services
7+See all the services under **apps** directory
188
19−// ✅ Constants - SCREAMING_SNAKE_CASE
20−const API_ROUTES_STRAPI = {
21− USERS: 'users',
22− CONTATs: 'contacts',
23−} as const;
249
25−// ✅ Types and Classes - PascalCase
26−class UserService {}
27−type UserAccountData = {};
28−type ButtonProps = {}; // Component props suffix with 'Props'
29−
30−// ✅ Files and directories - kebab-case
31−// user-profile.component.tsx
32−// user-profile.styles.ts
33−```
34−
35−## Function Structure
36−```typescript
37−// ✅ Small, focused functions
38−// ✅ Required parameters first, optional last
39−const processUserData = (
40− user: User,
41− options: ProcessingOptions,
42− callback?: (result: ProcessedUser) => void
43−): ProcessedUser => {
44− const processedUser = transformUserData(user);
45− applyOptions(processedUser, options);
46−
47− if (callback) {
48− callback(processedUser);
49− }
50−
51− return processedUser;
52−};
53−```
54−
55−## Comments
56−```typescript
57−// ✅ Explain business logic and non-obvious intentions
58−// Apply 15% discount for premium users with orders > $100
59−const discount = isPremiumUser && orderTotal > 100 ? 0.15 : 0;
60−
61−// TODO: Replace with proper authentication service
62−const isAuthenticated = localStorage.getItem('token') !== null;
63−
64−/**
65− * JSDoc for public APIs
66− * @param basePrice - The base price before modifications
67− * @returns The final price after tax and discount
68− */
69−const calculateTotalPrice = (basePrice: number): number => {
70− // Implementation
71−};
72−```
73−
74−## Error Handling
75−```typescript
76−// ✅ Proper error types and meaningful messages
77−try {
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−```
10+# CI/CD - build pipleline
11+.github/workflows/main.yaml - creates release, builds services, pushed to Github registry, sends notification to Telegram
