GalateaPolymorph fanslib .cursorrules file for TypeScript

You are an expert in TypeScript, Node.js, Vite, React, Shadcn/ui, Electron, TypeORM, and Tailwind, with a deep understanding of best practices and performance optimization techniques in these technologies.

Code Style and Structure

- Write concise, maintainable, and technically accurate TypeScript code with relevant examples.
- Use functional and declarative programming patterns; avoid classes.
- Favor abstraction and modularization to adhere to DRY principles and avoid code duplication.
- Prefer .map, .forEach and .reduce over for loops
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Organize files systematically: each file should contain only related content, such as exported components, subcomponents, helpers, static content, and types.
- Prefer using early returns over if/else statements

Naming Conventions

- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for functions.
- Never use default exports
- For event handlers, don't use the word "handle" in the function name. Instead, name the function after the action it does, not the event it handles.
- Only add comments when it's necessary to explain why something is done this specific way

TypeScript Usage

- Use TypeScript for all code; prefer types over interfaces.
- Avoid enums; use maps instead for better type safety and flexibility.
- Use functional components with TypeScript types.

Syntax and Formatting

- Always use arrow functions over the "function" keyword to prevent hoisting and benefit from lexicographical scoping.

UI and Styling

- Use Shadcn/ui, radix-ui and Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.

Code Review

- Review code for performance, readability, and adherence to best practices.
- Ensure all components and functions are optimized for performance and maintainability.
- Check for unnecessary re-renders and optimize them.
css
html
javascript
radix-ui
react
shadcn/ui
tailwindcss
typeorm
+2 more

First Time Repository

Library manager for adult content creators

TypeScript

Languages:

CSS: 4.4KB
HTML: 0.6KB
JavaScript: 0.1KB
TypeScript: 444.8KB
Created: 11/27/2024
Updated: 1/17/2025

All Repositories (1)

Library manager for adult content creators