--- name: use-house-config description: Use when the user asks to "set up linting", "add configs to this project", "why is Biome erroring", or otherwise needs @dnunez24/config wired into a repository or a rule relaxed correctly. --- # Use shared config ## Install ```sh pnpm dlx @dnunez24/config init ``` Detects the project's context from `package.json` (`node`, `bun`, `web`, `react`, `next`, or `astro`) and writes `biome.jsonc`, `tsconfig.json`, `.editorconfig`, `.rumdl.toml`, `.vale.ini`, `lefthook.yml`, `.commitlintrc.json`, `knip.ts`, `.syncpackrc.js`, and (when the corresponding tool is already a dependency) `vitest.config.ts` / `playwright.config.ts`. Flags: `--layers ` to override detection, `--dry-run` to preview, `--force` to rewrite non-managed-region files, `--prose `. ## Layer table | Layer | Pick this when | | ------- | ------------------------------------------------------ | | `node` | A library or service running on the Node.js runtime | | `bun` | A Bun-first project | | `web` | Any browser-facing project, no framework assumed | | `react` | A React project | | `next` | A Next.js App Router project | | `astro` | An Astro project (experimental Biome `.astro` support) | ## Critical: list the full ancestor chain in `extends` Biome 2.5.10 does not resolve transitive `extends`. A config's own `extends` field is ignored when that config is itself reached via another config's `extends` array (verified against the published binary; tracked upstream as `biomejs/biome#3950` / discussion #8257). A single-entry `extends: ["@dnunez24/config/biome/react"]` silently drops every rule `react.jsonc` inherits from `web.jsonc` and `base.jsonc`. No error and weaker linting. Always list the full chain, base-first: ```jsonc { "extends": [ "@dnunez24/config/biome/base", "@dnunez24/config/biome/web", "@dnunez24/config/biome/react" ] } ``` `config init` generates this automatically. If a `biome.jsonc` already exists with a single-entry `extends`, that is a bug to fix, not a style choice. ## The correct way to relax a rule Never a blanket disable. Never a `// biome-ignore` without a reason string. Add a path-scoped entry to the consumer's own `overrides` array, with a comment giving the reason: ```jsonc { "overrides": [ { "includes": ["src/legacy/**"], "linter": { // Legacy module predates the null-safety migration; tracked in JIRA-1234. "style": { "noNonNullAssertion": "off" } } } ] } ``` Facts an agent needs to get this right: - `overrides` arrays **concatenate** across `extends` -- parent entries first, then the consumer's own. - **All** matching entries apply, and the **last** match wins on a conflict. Order broad overrides first, narrow ones last. - A narrow override that disables one rule does **not** reset the rest of that rule's group set by a top-level group string (e.g. `"correctness": "error"`).