{"content":"# Editor and Linting Setup\n\nConfigure Prettier for code formatting and TypeScript for typechecking. Includes VSCode settings and EditorConfig for consistent code style. Skips ESLint/Biome to avoid config complexity.\n\n### Step 1: Install Prettier\n\n```bash\nbun add -D prettier\n```\n\n### Step 2: Add scripts\n\nAdd these scripts to your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"typecheck\": \"tsc --noEmit\",\n    \"fmt\": \"prettier --write .\"\n  }\n}\n```\n\n### Step 3: Install VSCode Extension (Optional)\n\nInstall the Prettier VSCode extension for automatic formatting:\n\n- [Install in Cursor](cursor:extension/esbenp.prettier-vscode)\n- Or via VS Code command line: `ext install esbenp.prettier-vscode`\n\nNote: The extension may be marked as deprecated (replaced by `prettier.prettier-vscode`), however I've found that at least in Cursor `esbenp.prettier-vscode` works without issues while `prettier.prettier-vscode` has issues formatting .tsx files.\n\n### Step 4: Add .vscode Configuration (Optional)\n\nCreate a `.vscode` folder in your project root with the following files:\n\n#### .vscode/extensions.json\n\nRecommend the Prettier extension to all contributors:\n\n```json\n{\n  // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.\n  // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp\n  // List of extensions which should be recommended for users of this workspace.\n  \"recommendations\": [\"esbenp.prettier-vscode\"],\n  // List of extensions recommended by VS Code that should not be recommended for users of this workspace.\n  \"unwantedRecommendations\": []\n}\n```\n\n#### .vscode/settings.json\n\nEnable format on save with Prettier as the default formatter:\n\n```json\n{\n  \"editor.formatOnSave\": true,\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n}\n```\n\n### Step 5: Add .editorconfig (Optional)\n\nCreate a `.editorconfig` file in your project root. This is optional since Prettier already enforces these rules by default, but it ensures consistency when contributors use editors without setting up Prettier:\n\n```editorconfig\n# Editor config - see http://EditorConfig.org\n\nroot = true\n\n[*]\ncharset = utf-8\ninsert_final_newline = true\nend_of_line = lf\nindent_style = space\nindent_size = 2\nmax_line_length = 80\n```\n\n---\n\n## References\n\n- [Prettier Philosophy](https://prettier.io/docs/option-philosophy)\n- [EditorConfig](https://editorconfig.org/)"}