Files
crewli/.cursorrules
bert.hausmans a269ca6836 chore(tooling): use ESLint as the sole formatter for TS/Vue files
Disables Prettier in Cursor / VSCode. ESLint via dbaeumer.vscode-eslint
becomes the default formatter for typescript / typescriptreact /
javascript / vue files. Save-on-format runs eslint --fix on the file.

Motivation: WS-3 session 1b-iii surfaced that Cursor's default
formatter (Prettier) was rewriting files on save with a config that
mismatched the Crewli ESLint rules (double quotes, semicolons),
producing 164-line diffs on intended 5-line edits. The pattern was
silently invisible because pnpm lint --fix would reverse Prettier's
formatting on the next CI/dev pass — but the working tree noise made
small edits unsafe.

This commit:
- Updates .vscode/settings.json: editor.defaultFormatter is now
  dbaeumer.vscode-eslint at both the global level and in the per-
  language blocks ([typescript], [typescriptreact], [javascript],
  [vue]). Adds eslint.format.enable, eslint.validate, and
  source.fixAll.eslint to codeActionsOnSave. Sets prettier.enable
  to false explicitly. Preserves pre-existing settings unchanged
  (PHP block, editor.tabSize, typescript.preferences,
  files.associations, search.exclude, eslint.workingDirectories).
- Documents the choice in .cursorrules under a new ## Formatter
  section.

The prior [vue] formatter was Vue.volar (not Prettier), but unifying
the Vue formatter under ESLint matches the audit's "single source of
truth" intent — Volar's formatter and ESLint's vue/* rules historically
disagreed on template indentation, and Volar offers no advantage over
ESLint for code formatting (we keep Volar as the language server for
type-checking via the recommendation in .vscode/extensions.json).

.gitignore did not need updating — .vscode/ was already not ignored
and the existing settings.json was already tracked.

No changes to package.json, pnpm-lock.yaml, .eslintrc.cjs, or any
source files. Engineers using Cursor / VSCode need the
dbaeumer.vscode-eslint extension installed (already present in
.vscode/extensions.json's recommendations).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 00:07:15 +02:00

37 lines
1.3 KiB
Plaintext

# Crewli Cursor Rules
## Stack
PHP 8.2 + Laravel 12 | TypeScript + Vue 3 + Vuexy/Vuetify | Pinia + TanStack Query
## Laravel
- Resource controllers, form requests, API resources — always
- `HasUlids` on business models, `HasFactory`, `SoftDeletes` where documented
- Global scope `OrganisationScope` on event-related models
- Policies for authorization — never inline role checks
## Vuexy reference path (mandatory)
- When looking at Vuexy examples, demos, or patterns, ALWAYS reference:
`resources/vuexy-admin-v10.11.1/vue-version/typescript-version/full-version/`
- Never reference `javascript-version/` or `starter-kit/` variants
## Vue 3
- `<script setup lang="ts">` always
- TanStack Query for API state, Pinia for UI state
- Vuetify components first; custom CSS only as a last resort
## Naming
- snake_case DB | camelCase JS | PascalCase Vue | `use*` composables | `use*Store` Pinia
## Tests
- PHPUnit feature test per controller, minimum: 200 + 401 + 403
## Formatter
ESLint is the ONLY formatter for TS/Vue/JS files in this repo. Prettier
is intentionally disabled — `pnpm lint:fix` (or save-on-format with
ESLint extension) is the single source of truth for formatting.
Save-on-format requires the `dbaeumer.vscode-eslint` extension to be
installed and the editor's default formatter set to it (configured in
`.vscode/settings.json`).