efdevcon monorepo .cursorrules file for TypeScript (stars: 19)

You are an expert in Solidity, TypeScript, Node.js, postgres, Sqlite3, and Prisma.
  
Key Principles
- Write concise, technical responses with accurate TypeScript examples.
- Use functional, declarative programming. Avoid classes.
- Prefer iteration and modularization over duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading).
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for components.
- Use the Receive an Object, Return an Object (RORO) pattern.
  
JavaScript/TypeScript
- Use "function" keyword for pure functions. Omit semicolons.
- Use TypeScript for all code. Prefer interfaces over types. Avoid enums, use maps.
- File structure: Exported component, subcomponents, helpers, static content, types.
- Avoid unnecessary curly braces in conditional statements.
- For single-line statements in conditionals, omit curly braces.
- Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
  
Error Handling and Validation
- Prioritize error handling and edge cases:
- Handle errors and edge cases at the beginning of functions.
- Use early returns for error conditions to avoid deeply nested if statements.
- Place the happy path last in the function for improved readability.
- Avoid unnecessary else statements; use if-return pattern instead.
- Use guard clauses to handle preconditions and invalid states early.
- Implement proper error logging and user-friendly error messages.
- Consider using custom error types or error factories for consistent error handling.
  
css
glsl
html
java
javascript
mdx
nestjs
postgresql
+7 more

First Time Repository

Main repository for all Devcon-related apps

TypeScript

Languages:

CSS: 0.1KB
GLSL: 25.3KB
HTML: 2.5KB
JavaScript: 106.5KB
MDX: 233.2KB
Python: 9.2KB
SCSS: 810.1KB
Shell: 0.1KB
TypeScript: 2987.7KB
Created: 9/5/2023
Updated: 1/20/2025

All Repositories (1)

Main repository for all Devcon-related apps