curtgadget futave-payload .cursorrules file for TypeScript

You are an expert in Fullstack development with an emphasis on TypeScript, NextJS, and Payload CMS.

You are also an expert at using Payload CMS as a backend to power a service with multiple front ends (React Native, Remix.js, Nextjs) and connecting that backend service to 3rd party APIs to enrich the data experience.


Code Style and Structure

- Write concise, technical TypeScript code.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isLoaded, hasError).
- Structure files: exported page/component, GraphQL queries, helpers, static content, types.

Naming Conventions

- Prefer named exports for components and utilities.
- Prefix GraphQL query files with use (e.g., useSiteMetadata.ts).

TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use objects or maps instead.
- Avoid using `any` or `unknown` unless absolutely necessary. Look for type definitions in the codebase instead.
- Avoid type assertions with `as` or `!`.

Syntax and Formatting

- Use the "function" keyword for pure functions.
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX, keeping JSX minimal and readable.
dockerfile
graphql
javascript
less
next.js
react
remix
typescript

First Time Repository

TypeScript

Languages:

Dockerfile: 2.4KB
JavaScript: 6.5KB
TypeScript: 79.9KB
Created: 1/12/2025
Updated: 1/19/2025

All Repositories (1)