Rule

0 installs · 0 said it worked

PatrickJS@patrickjs·
CodingRule· for Cursor

Cursor rules for writing clean TypeScript, React, and Vite code

A .mdc rules file that makes Cursor generate concise, functional TypeScript for Node.js, React, Vite, TanStack, and Tailwind projects while preserving existing code and comments.

People use this for

  • cursor rules typescript react
  • vite react typescript prompt
  • clean typescript code generation
  • react tailwind functional components
  • cursor mdc rules react vite
Name
cursor-rules-for-writing-clean-typescript-react-and-vite-code
Works with
Cursor
License
CC0(as observed at the source)
Version
v1 · updated Nov 29, 2026
Imported · UnclaimedCC0

Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.

Are you the author?Claim this profileRequest removal

Use this rule

$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/cursor-rules-for-writing-clean-typescript-react-and-vite-code-2c2k/export/mdc" -o .cursor/rules/cursor-rules-for-writing-clean-typescript-react-and-vite-code.mdc

Then open a new session; Cursor picks it up from .cursor/rules/.

Download cursor-rules-for-writing-clean-typescript-react-and-vite-code.mdc
Manual install

Save cursor-rules-for-writing-clean-typescript-react-and-vite-code.mdc as .cursor/rules/cursor-rules-for-writing-clean-typescript-react-and-vite-code.mdc for this project or ~/.cursor/rules/cursor-rules-for-writing-clean-typescript-react-and-vite-code.mdc for every project, then start a new session.

Rule


description: "Cursor rules for TypeScript development with Node.js, React, and Vite integration." globs: */ alwaysApply: false

You are an expert in TypeScript, Node.js, React, Vite, TanStack Query, TanStack Router, and Tailwind.

Response Constraints

  • Do not remove any existing code unless necessary.
  • Do not remove my comments or commented-out code unless necessary.
  • Do not change the formatting of my imports.
  • Do not change the formatting of my code unless important for new functionality.

Code Style and Structure

  • Write concise, technical TypeScript code with accurate examples.
  • Use functional and declarative programming patterns; avoid classes.
  • Prefer iteration and modularization over code duplication.
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
  • Structure files: exported component, subcomponents, helpers, static content, types.

Naming Conventions

  • Use lowercase with dashes for directories (e.g., components/auth-wizard).
  • Favor named exports for components.

TypeScript Usage

  • Use TypeScript for all code; prefer interfaces over types.
  • Avoid enums; use maps instead.
  • Use functional components with TypeScript interfaces.

Syntax and Formatting

  • Use the "function" keyword for pure functions.
  • Use curly braces for all conditionals. Favor simplicity over cleverness.
  • Use declarative JSX.

UI and Styling

  • Use Tailwind for components and styling.

Performance Optimization

  • Look for ways to make things faster:
    • Use immutable data structures
    • Use efficient data fetching strategies
    • Optimize network requests
    • Use efficient data structures
    • Use efficient algorithms
    • Use efficient rendering strategies
    • Use efficient state management

No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.

Tried it

Reports from people who added this rule to their editor. They roll up into the badges above.

No one has filed a report yet. Try the prompt and be the first.

License: CC0v1 · published Nov 29, 2026

Comments

No comments yet. If you tried this prompt, say how it went.