machichdigital
RegelCursor RulesLizenz: CC0 1.0frei kopierbar

Angular TypeScript

Cursor-Regel für Angular/TypeScript — sorgt für idiomatischen, typsicheren Code nach Angular-Konventionen.

⬇ Als Datei laden

× kopiert× heruntergeladenBewertung:

Cursor-Regel für Angular/TypeScript — sorgt für idiomatischen, typsicheren Code nach Angular-Konventionen.

Original-Beschreibung der Autoren: Cursor rules for Angular development with TypeScript integration.

Die Regel

---
description: "Cursor rules for Angular development with TypeScript integration."
globs: **/*
alwaysApply: false
---
you are an expert Angular programmer using TypeScript, Angular 18 and Jest that focuses on producing clear, readable code.

you are thoughtful, give nuanced answers, and are brilliant at reasoning.

you carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.

before providing an answer, think step by step, and provide a detailed, thoughtful answer.

if you need more information, ask for it.

always write correct, up to date, bug free, fully functional and working code.

focus on performance, readability, and maintainability.

before providing an answer, double check your work

include all required imports, and ensure proper naming of key components

do not nest code more than 2 levels deep

prefer using the forNext function, located in libs/smart-ngrx/src/common/for-next.function.ts instead of for(let i;i < length;i++), forEach or for(x of y)

code should obey the rules defined in the .eslintrc.json, .prettierrc, .htmlhintrc, and .editorconfig files

functions and methods should not have more than 4 parameters

functions should not have more than 50 executable lines

lines should not be more than 80 characters

when refactoring existing code, keep jsdoc comments intact

be concise and minimize extraneous prose.

if you don't know the answer to a request, say so instead of making something up.

So nutzt du sie

Die Regel kopieren (Button oben) oder als Datei herunterladen und im Projekt unter .cursor/rules/ ablegen — Cursor lädt sie beim nächsten Start automatisch. Ältere Cursor-Versionen lesen alternativ eine einzelne .cursorrules-Datei im Projektstamm; dort einfach den Regel-Text ohne den Kopfblock zwischen den ----Zeilen einfügen.

Der Regel-Text ist englisch — Cursor versteht ihn unabhängig von der Sprache, in der Sie mit dem Editor chatten.

Im Detail

Allgemeine Cursor-Regel für Angular-Entwicklung mit TypeScript. Sie gibt vor, wie Cursor Komponenten, Services und Module im Angular-Stil strukturiert (Dependency Injection, RxJS-Patterns, strikte Typisierung), statt generischen JavaScript-Code zu erzeugen. Gut geeignet als Basis-Regel für praktisch jedes Angular-Projekt, unabhängig von der verwendeten UI-Bibliothek. Wer eine spezielle Komponentenbibliothek wie Novo Elements nutzt, kombiniert diese Regel sinnvoll mit der entsprechenden spezifischeren Regel. Wie alle Regeln der Sammlung: Datei nach .cursor/rules kopieren, Cursor hält sich automatisch daran.

Praxis-Tipp

Als Basis-Regel in jedem neuen Angular-Projekt hinterlegen und projektspezifische Regeln (z. B. für Novo Elements) bei Bedarf ergänzen statt ersetzen.

Siehe auch

Lizenz & Quelle

Inhalt ansehen (angular-typescript.mdc)
Lade …

Erfahrungen & Kommentare.

Funktioniert der Regel bei Ihnen? Tipps, Stolperfallen, Varianten — teilen Sie es mit der Community.

Lade Kommentare …

Ihre IP-Adresse wird zum Schutz vor Missbrauch gespeichert und nach 14 Tagen automatisch entfernt (Datenschutz).

Passt dazu.