Documentation
v1.0.0
Technical Specification
🎨

Code Style Block

Define coding standards, formatting rules, and style guidelines

Preview

🎨
Code Style
Technical
Formatting:
• Use Prettier with 2-space indentation
• 80-character line length limit
• Trailing commas in multi-line structures
• Single quotes for strings
Naming:
• camelCase for variables and functions
• PascalCase for components and classes
• UPPER_SNAKE_CASE for constants
• kebab-case for file names
Documentation:
• JSDoc comments for all public APIs
• Inline comments for complex logic
• README for each major module
• Type annotations for TypeScript
Best Practices:
• Prefer functional components with hooks
• Use meaningful variable names
• Keep functions small and focused
• Avoid deeply nested conditionals

Style Examples

TypeScript/React Style Guide
Formatting Rules:
• 2 spaces for indentation (no tabs)
• 80-character line length
• Single quotes for strings, double for JSX
• Semicolons required
• Trailing commas in multiline objects/arrays
Naming Conventions:
• Components: PascalCase (UserProfile.tsx)
• Hooks: camelCase with 'use' prefix (useUserData)
• Constants: UPPER_SNAKE_CASE (API_BASE_URL)
• Interfaces: PascalCase with 'I' prefix (IUserData)
Code Organization:
• Group imports: external → internal → relative
• Export default at bottom of file
• Props interface above component
• Helper functions below component
Documentation Standards
JSDoc Comments:
• All public functions require JSDoc
• Include @param and @returns descriptions
• Add @example for complex functions
• Use @deprecated for legacy code
Code Comments:
• Explain WHY, not WHAT
• Comment complex business logic
• Mark TODO items with // TODO:
• Use // FIXME: for known issues
README Structure:
• Purpose and overview
• Installation instructions
• Usage examples
• API documentation
• Contributing guidelines

API Reference

Block Properties
typestring

Fixed value: "code-style"

contentCodeStyleContent

Structured object containing style guidelines

• formatting: object - Indentation, line length, quotes
• naming: object - Naming conventions by type
• documentation: string[] - Comment and doc requirements
• bestPractices: string[] - Code quality guidelines