# @xtarter/config

`@xtarter/config` ships the same lint and format rules xtarterize applies, as a package you extend instead of a config you own. It is [Ultracite](https://ultracite.ai/)'s presets plus the xtarter layer:

- 500 lines per file and 60 per function
- block statements required (`curly` in Oxlint)
- generic array syntax and kebab-case file names
- single quotes, and the same export default defineConfig({
  extends: [core, react],
  env: { node: true },
});
```

Oxlint's JSON config cannot extend npm packages, so use `oxlint.config.ts` (or `.js`/`.mjs`). TypeScript configs need Node.js 22.18 or newer.

## Oxfmt

<AllPackageManagers pkg="oxfmt @xtarter/config" dev />

```ts title="oxfmt.config.ts"
export default defineConfig({
  ...xtarter,
});
```

## Vite+

Vite+ reads Oxlint and Oxfmt settings from the `lint` and `fmt` blocks of `vite.config.ts` and ignores `oxlint.config.ts` and `oxfmt.config.ts`, so put the entries there:

<AllPackageManagers pkg="@xtarter/config" dev />

```ts title="vite.config.ts"
export default defineConfig({
  fmt: {
    ...xtarterFmt,
  },
  lint: {
    env: { node: true },
    extends: [xtarterCore, xtarterReact],
  },
});
```

## Layers

Every Biome and Oxlint entry extends the Ultracite preset of the same name. List `core` first, then the layers for your stack; later layers win, so framework exceptions (such as route file names in Remix or TanStack) apply.

| Tool | Entries |
| --- | --- |
| Biome | `core`, `angular`, `astro`, `cypress`, `drizzle`, `jest`, `nestjs`, `next`, `playwright`, `qwik`, `react`, `react-native`, `remix`, `solid`, `storybook`, `svelte`, `tanstack`, `type-aware`, `vitest`, `vue` |
| Oxlint | `core`, `angular`, `anti-slop`, `astro`, `cypress`, `drizzle`, `gdp`, `jest`, `js-plugins`, `landmines`, `nestjs`, `next`, `playwright`, `qwik`, `react`, `react-native`, `remix`, `shadcn`, `solid`, `storybook`, `svelte`, `tanstack`, `vitest`, `vue` |
| Oxfmt | `@xtarter/config/oxfmt` (no layers) |

### Opt-in Oxlint layers

Extend these when you want stricter rules and accept a slower lint pass, since each runs through Oxlint's JS plugins. xtarterize adds only `landmines`, and only to an Oxlint config it creates; it never adds a layer to an existing config.

| Layer | What it catches | Install |
| --- | --- | --- |
| `anti-slop` | Unjustified type assertions, `unknown` leaking through signatures, module mocking, and similar escape hatches ([anti-slop](https://github.com/dmmulroy/anti-slop)) | Nothing extra |
| `landmines` | Shortcuts coding agents take to get a green check: mocking the code under test, fixed sleeps, retries, raised timeouts, and comments narrating the diff ([landmines](https://github.com/interfere-inc/landmines)) | `@interfere/landmines` 0.1.1 or newer |
| `gdp` | Forged authorization proofs ([gdp-ts](https://github.com/rauchg/gdp-ts)) | `@gdp-ts/core` |
| `shadcn` | Tailwind v4 classes that break your components, variants, or theme ([@shadcn/lint](https://github.com/shadcn-ui/lint)) | `@shadcn/lint` |
| `js-plugins` | Rules Oxlint lacks natively, from eslint-plugin-github, eslint-plugin-sonarjs, and React Doctor | `eslint-plugin-github`, `eslint-plugin-sonarjs`, `oxlint-plugin-react-doctor` |

Repeat the layer's `jsPlugins` at the root of your config. Oxlint loads the plugins through `extends` either way, but tools such as Knip read `jsPlugins` only from the root and would otherwise report the plugin package as unused:

<AllPackageManagers pkg="oxlint @xtarter/config @interfere/landmines" dev />

```ts title="oxlint.config.ts"
export default defineConfig({
  extends: [core, landmines],
  env: { node: true },
  jsPlugins: landmines.jsPlugins,
});
```

`landmines` is opinionated beyond tests. It rejects comments other than directives, `WARNING:` and `SAFETY:` notes, and TSDoc on exported API; annotated return types; and `.spec.ts` file names. Turn `landmines-structure/test-file-names` off for frameworks whose convention is `.spec.ts`, such as Playwright, Cypress, Angular, and NestJS.

## Versioning

Each release pins one Ultracite version, so a given `@xtarter/config` version always means the same rules.

| Change | Release |
| --- | --- |
| New or stricter rule, including an Ultracite upgrade | Minor |
| Relaxed rule or fix | Patch |
| Removed entry, or a new major version of Biome, Oxlint, or Oxfmt required | Major |

Minor releases can add errors to your project; their release notes name the rules they add.

ESLint and Prettier entries are not published. xtarter supports only Biome and the Oxc tools.