{"content":"# Code Health, Linting & Formatting\n\nConfigure Prettier for formatting, TypeScript for typechecking, and Fallow for code health (dead code, duplication, complexity, architecture drift). 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: Install Fallow\n\nFallow is codebase intelligence for TypeScript and JavaScript. Use it to catch dead code (unused files, exports, types, dependencies), duplication, circular dependencies, complexity hotspots, and architecture drift. It is Rust-native, sub-second, and zero-config thanks to its framework plugins.\n\n```bash\nbun add -D fallow\n```\n\n### Step 3: 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    \"fallow\": \"fallow\"\n  }\n}\n```\n\nRun `bun run fallow` to analyze the whole project (dead code + duplication + health in one pass). Most projects need no configuration.\n\n### Step 4: Install the Fallow Skill\n\nInstall the `fallow` agent skill so your coding agent knows how to run and interpret Fallow's codebase intelligence (dead code, duplication, complexity, audit):\n\n```bash\nbunx skills add fallow-rs/fallow-skills -s fallow -a cursor -a codex -y\n```\n\n### Step 5: 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 6: 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 7: 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/)\n- [Fallow](https://docs.fallow.tools/)"}