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>
This commit is contained in:
76
.vscode/settings.json
vendored
76
.vscode/settings.json
vendored
@@ -1,37 +1,57 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"editor.tabSize": 2,
|
||||
|
||||
"[php]": {
|
||||
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
|
||||
"editor.tabSize": 4
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
|
||||
"typescript.preferences.importModuleSpecifier": "relative",
|
||||
"typescript.suggest.autoImports": true,
|
||||
|
||||
"files.associations": {
|
||||
"*.php": "php",
|
||||
".env*": "dotenv"
|
||||
},
|
||||
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/vendor": true,
|
||||
"**/dist": true
|
||||
},
|
||||
|
||||
|
||||
"eslint.format.enable": true,
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"typescript",
|
||||
"vue"
|
||||
],
|
||||
"eslint.workingDirectories": [
|
||||
{ "directory": "apps/admin", "changeProcessCWD": true },
|
||||
{ "directory": "apps/app", "changeProcessCWD": true },
|
||||
{ "directory": "apps/portal", "changeProcessCWD": true }
|
||||
]
|
||||
],
|
||||
|
||||
"prettier.enable": false,
|
||||
|
||||
"[php]": {
|
||||
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
|
||||
"editor.tabSize": 4
|
||||
},
|
||||
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||
},
|
||||
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||
},
|
||||
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||
},
|
||||
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||
},
|
||||
|
||||
"typescript.preferences.importModuleSpecifier": "relative",
|
||||
"typescript.suggest.autoImports": true,
|
||||
|
||||
"files.associations": {
|
||||
"*.php": "php",
|
||||
".env*": "dotenv"
|
||||
},
|
||||
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/vendor": true,
|
||||
"**/dist": true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user