Skip to content

Commit 3654d6f

Browse files
committed
feat: enhance documentation with coding standards and JSDoc type safety guidelines
1 parent eb62993 commit 3654d6f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

CLAUDE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ BottleCRM is a SaaS CRM platform built with SvelteKit, designed for startups and
1414
- **Icons**: Lucide Svelte
1515
- **Validation**: Zod
1616
- **Package Manager**: pnpm
17+
- **Type Checking**: JSDoc style type annotations (no TypeScript)
1718

1819
## Development Commands
1920

@@ -91,6 +92,42 @@ npx prisma studio
9192
- Use Zod for form validation
9293
- Follow existing patterns in `/contacts`, `/leads`, `/accounts` for consistency
9394

95+
## Coding Standards
96+
97+
### Type Safety
98+
- **NO TypeScript**: This project uses JavaScript with JSDoc style type annotations only
99+
- **JSDoc Comments**: Use JSDoc syntax for type information and documentation
100+
- **Type Checking**: Use `pnpm run check` to validate types via JSDoc annotations
101+
- **Function Parameters**: Document parameter types using JSDoc `@param` tags
102+
- **Return Types**: Document return types using JSDoc `@returns` tags
103+
104+
### JSDoc Examples
105+
```javascript
106+
/**
107+
* Updates a contact in the database
108+
* @param {string} contactId - The contact identifier
109+
* @param {Object} updateData - The data to update
110+
* @param {string} updateData.name - Contact name
111+
* @param {string} updateData.email - Contact email
112+
* @param {string} organizationId - Organization ID for data isolation
113+
* @returns {Promise<Object>} The updated contact object
114+
*/
115+
async function updateContact(contactId, updateData, organizationId) {
116+
// Implementation
117+
}
118+
119+
/**
120+
* @typedef {Object} User
121+
* @property {string} id - User ID
122+
* @property {string} email - User email
123+
* @property {string} name - User name
124+
* @property {string[]} organizationIds - Array of organization IDs
125+
*/
126+
127+
/** @type {User|null} */
128+
let currentUser = null;
129+
```
130+
94131
## Security Requirements
95132
- Never expose cross-organization data
96133
- Always filter queries by user's organization membership

0 commit comments

Comments
 (0)