chenqianhe node-20-sentry-demo .cursorrules file for JavaScript

You are an expert in Svelte 4, SvelteKit, TypeScript, Prisma, TailwindCSS and modern web development.

Key Principles:

Code Style and Structure
- Follow consistent code formatting using Prettier
- Use ESLint for code quality
- Organize imports logically
- Keep components small and focused
- Use TypeScript strict mode

Naming Conventions
- Use PascalCase for component names
- Use camelCase for variables and functions
- Use SCREAMING_SNAKE_CASE for constants
- Use kebab-case for CSS classes and files

TypeScript Usage
- Enable strict mode in tsconfig.json
- Use proper type annotations
- Leverage interfaces and types
- Avoid any type
- Use generics when appropriate

Svelte Components
- Use TypeScript for component logic
- Keep components small and focused
- Use props validation with TypeScript
- Follow reactive declarations best practices
- Use stores for shared state

Prisma Usage
- Keep schema.prisma in prisma directory
- Use migrations for schema changes
- Implement proper error handling
- Use transactions when needed
- Follow naming conventions for models and fields
- Use proper relations between models
- Implement middleware when needed

TailwindCSS
- Use utility-first approach
- Create custom components for reusable styles
- Follow mobile-first responsive design
- Use proper color naming conventions
- Implement dark mode support
- Use proper spacing and sizing utilities
- Create custom plugins when needed

Performance Optimization
- Implement proper loading states
- Use SvelteKit's built-in optimizations
- Optimize images and assets
- Implement proper caching strategies
- Use proper bundling and code splitting
- Monitor Web Vitals

Accessibility
- Follow WCAG guidelines
- Use proper ARIA labels
- Implement proper keyboard navigation
- Use proper color contrast
- Implement proper focus states

Testing
- Write unit tests
- Write integration tests
- Write end-to-end tests
- Use proper test coverage
- Implement proper CI/CD

Documentation
- Write proper documentation
- Use proper JSDoc comments
- Document API endpoints
- Document component props
- Document state management

Key Conventions
- Follow SvelteKit's conventions
- Use TypeScript for type safety
- Follow Prisma best practices
- Use TailwindCSS utility classes
- Implement proper error handling
- Follow accessibility guidelines
- Write proper tests
- Write proper documentation

References:
- Svelte Documentation
- SvelteKit Documentation
- TypeScript Documentation
- Prisma Documentation
- TailwindCSS Documentation
bun
css
eslint
html
javascript
prettier
prisma
react
+3 more

First Time Repository

JavaScript

Languages:

CSS: 6.8KB
HTML: 0.5KB
JavaScript: 16.7KB
Svelte: 0.8KB
TypeScript: 9.3KB
Created: 12/5/2024
Updated: 12/5/2024

All Repositories (1)