IMUR pottysnitch .cursorrules file for Svelte

{
  "version": "1.0",
  "schema": "https://cursorrules.dev/schema/v1",
  "metadata": {
    "project": "pottysnitch",
    "framework": "sveltekit",
    "typescript": true
  },
  "rules": {
    "command-safety": {
      "severity": "critical",
      "description": "CLI and command execution safety requirements",
      "validation": {
        "pattern": "^(single|group)_command:\\s.+$",
        "examples": [
          "single_command: git status",
          "group_command: git add && git commit"
        ]
      },
      "rules": [
        {
          "id": "CMD001",
          "name": "single-command-block",
          "description": "Each code block must contain only one command type",
          "severity": "error"
        },
        {
          "id": "CMD002",
          "name": "destructive-command-isolation",
          "description": "Destructive commands must be in isolated blocks",
          "severity": "error"
        }
      ]
    },
    "runes": {
      "severity": "error",
      "validation": {
        "pattern": "^\\$(?:state|derived|effect|props|createEventDispatcher)",
        "examples": ["$state<Type>", "$derived(() => value)"]
      },
      "rules": [
        {
          "id": "RUN001",
          "name": "state-declaration",
          "pattern": "^\\$state<[A-Z][\\w]*>",
          "severity": "error"
        }
      ]
    },
    "component-structure": {
      "severity": "warning",
      "description": "Component organization and documentation requirements",
      "rules": [
        {
          "id": "CMP001",
          "name": "script-order",
          "description": "Script section must follow: imports, types, props, state, derived, methods, effects",
          "severity": "warning"
        },
        {
          "id": "CMP002",
          "name": "documentation",
          "description": "Components must have JSDoc comments describing purpose and props",
          "severity": "warning"
        }
      ]
    },
    "error-handling": {
      "severity": "error",
      "description": "Error handling and type safety requirements",
      "rules": [
        {
          "id": "ERR001",
          "name": "type-guard-errors",
          "description": "Use instanceof for Error type guards",
          "pattern": "err instanceof Error",
          "severity": "error"
        },
        {
          "id": "ERR002",
          "name": "async-error-states",
          "description": "Async operations must handle loading and error states",
          "severity": "error"
        }
      ]
    },
    "state-management": {
      "severity": "warning",
      "description": "State management preferences and patterns",
      "rules": [
        {
          "id": "STT001",
          "name": "runes-over-stores",
          "description": "Prefer runes over stores for component-level state",
          "severity": "warning"
        },
        {
          "id": "STT002",
          "name": "effect-cleanup",
          "description": "Effects must return cleanup function when creating subscriptions",
          "severity": "error"
        }
      ]
    }
  }
}
css
html
javascript
rest-api
svelte
typescript

First Time Repository

A public restroom finder app built with SvelteKit and MapLibre

Svelte

Languages:

CSS: 0.4KB
HTML: 1.2KB
JavaScript: 1.8KB
Svelte: 10.7KB
TypeScript: 1.8KB
Created: 12/3/2024
Updated: 12/10/2024

All Repositories (1)

A public restroom finder app built with SvelteKit and MapLibre