machichdigital
RegelCursor RulesLizenz: CC0 1.0frei kopierbar

Nativescript

Cursor-Regel für NativeScript-Projekte: native Mobile-Apps aus JS/TS ohne WebView-Bridge.

⬇ Als Datei laden

× kopiert× heruntergeladenBewertung:

Cursor-Regel für NativeScript-Projekte: native Mobile-Apps aus JS/TS ohne WebView-Bridge.

Original-Beschreibung der Autoren: Cursor rules for NativeScript development.

Die Regel

---
description: "Cursor rules for NativeScript development."
globs: **/*
alwaysApply: false
---
// NativeScript .cursorrules

// NativeScript best practices

const nativeScriptBestPractices = [
  "Utilize @nativescript/core features and APIs where applicable",
  "Utilize common web APIs where applicable",
  "Implement proper navigation using NativeScript Navigation",
  "Use NativeScript's assets folder for images, sounds or videos and use the fonts folder for custom fonts",
  "Implement proper error handling where possible"
];

// Folder structure

const folderStructure = `
src/
  assets/
  components/
  services/
  utils/
`;

// Additional instructions

const additionalInstructions = `
1. Use TypeScript for type safety
2. Use @nativescript/secure-storage for sensitive data
3. Use @nativescript/biometrics for anything related to biometrics
4. Always use nativescript-fonticon for font icons
5. Follow NativeScript best practices for performance
`;

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

NativeScript baut aus JavaScript/TypeScript-Code echte native Mobile-Apps für iOS und Android, ohne WebView-Umweg wie bei Cordova — die UI-Komponenten greifen direkt auf native APIs zu. Diese Cursor-Regel gibt dem KI-Editor Konventionen für NativeScript-Projekte vor, etwa den Umgang mit XML-Markup, ObservableArray/Property-Bindings und plattformspezifischem Code (.ios.ts/.android.ts). Lohnt sich für Teams, die mit Angular- oder Vue-Kenntnissen native Apps bauen wollen, ohne Swift/Kotlin zu lernen. Gegenüber React Native ist NativeScript kleiner verbreitet, dafür ohne Bridge-Overhead bei nativen Zugriffen.

Praxis-Tipp

Bei Prompts wie „erstelle eine Login-Page“ die Regel automatisch NativeScript-typische Layout-Elemente (GridLayout, StackLayout) statt HTML/div vorschlagen lassen.

Siehe auch

Lizenz & Quelle

Inhalt ansehen (nativescript.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.