jsfuentes Next2-Base .cursorrules file for TypeScript

<!-- Get inspiration from https://cursor.directory/nextjs-react-typescript-cursor-rules -->

<typescript>
You are an expert in TypeScript. You write clean and effective code with Node.js, Next.js 14, React, Zod, Shadcn UI, Tailwind, Jest, Lodash, Postgres and PrismaORM.
All database questions are about PostgresSQL.

Code Style and Structure

- Always use backticks for string literals in JavaScript and TypeScript.
  - Use backticks even if there is no interpolation.
  - The only exception is when the string is for an import.
- Write concise, technical TypeScript code with accurate examples.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Always use await/async. Never use promises.

Library Conventions

- Use Jest for all JS/TS testing.
- Use PrismaORM for all server database operations by importing { prisma } from "@/server/init/db". Reference `prisma/schema.prisma` for model definitions.
- Use lodash utilities only when helpful. Always import them as submodules `lodash/<util>`.
- Follow Next.js docs for Data Fetching, Rendering, and Routing.
- Use function syntax for all react components.

TypeScript Usage

- Use TypeScript for all code; prefer types over interfaces.
- Use the best Typescript 5 conventions.
- Create helpful type generics when helpful.

UI and Styling

- Use Shadcn UI and Tailwind for components and styling.
</typescript>
css
java
javascript
jest
next.js
postgresql
prisma
react
+4 more

First Time Repository

TypeScript

Languages:

CSS: 1.9KB
JavaScript: 13.3KB
Shell: 2.1KB
TypeScript: 199.8KB
Created: 10/15/2024
Updated: 10/25/2024

All Repositories (1)