# Preset layers (`@st1ggy/linter-config`)

This document is the **high-level matrix** of how flat-config and Stylelint presets are layered. The machine-readable inventory (every flat-config rule id and Stylelint rule name with effective severity for sample files) lives in [`../data/linter-config-inventory.json`](../data/linter-config-inventory.json). Regenerate it from a checkout of this repo with:

```bash
node scripts/inventory.mjs
```

(`LINTER_CONFIG_ROOT` overrides the default repository root.)

## Flat-config layers

| Layer | `@st1ggy/linter-config` preset | Notes |
| --- | --- | --- |
| Base + stylistic | `eslint-common` (`config.common.js`, `@eslint/js` recommended, `@stylistic` all + overrides) | Foundation for TS/JS. |
| TypeScript | `config.typescript.js` | typescript-eslint integration. |
| Imports | `config.import.js` (import-x) | Resolver and import ordering. |
| Prettier-in-ESLint | `config.prettier.js` | eslint-plugin-prettier + config-prettier. |
| Unicorn | `config.unicorn.js` | eslint-plugin-unicorn. |
| SonarJS | `config.sonarjs.js` | eslint-plugin-sonarjs. |
| React | `config.react.js` | React/JSX + hooks. |
| SolidJS | `config.solid.js` | `eslint-plugin-solid` recommended for JS/JSX, TypeScript preset for TS/TSX, and JSX formatting. |
| Next.js | `config.next.js` | `@next/eslint-plugin-next`. |
| Svelte | `svelte-stack.js` | `eslint-plugin-svelte` flat recommended + TS parser options. |
| Astro | `astro-stack.js` | `eslint-plugin-astro` recommended. |

Inventory rule counts (sample files in this repository):

- `eslint-common`: effective rules on `src/examples/example.ts`
- `eslint-react`: includes React layer on the same sample
- `eslint-solid`: effective rules on `src/examples/example.solid.tsx`
- `eslint-next`: Next layer on the same sample
- `eslint-svelte`: effective rules on `src/examples/example.svelte`
- `eslint-astro`: effective rules on `src/examples/example.astro`

## Oxlint counterparts

The package also exports `common-ox`, `react-ox`, `solid-ox`, `next-ox`, `svelte-ox`, `astro-ox`, `angular-ox`, `vue-ox` and `nuxt-ox`. Each is one `OxlintConfig` object, used through `oxlint.config.ts`, with `options.typeAware: true` and Oxlint's own native tsgolint engine. The project compiler and declaration checks stay on TypeScript 6; the original ESLint presets remain available.

All nine Ox variants use Oxlint and a separate `oxfmt --check`; source `prettier/prettier` checks and `import-x/order` in the six migrated presets are recorded as `formatter` instead of running competing JS rules. Import ordering is an intentional formatter-policy change, not identical source diagnostics. Svelte/Astro use `oxfmt-svelte`/`oxfmt-astro`, Angular uses `oxfmt-angular`, and other stacks use `oxfmt-common`. Every stack retains Stylelint. No Ox stack generates an ESLint companion; Vue/Nuxt/Svelte/Astro/Angular templates are not linted. Old `eslint-*-ox` exports remain available only for explicit opt-in use. See [OXLINT_RULE_MAPPING.md](OXLINT_RULE_MAPPING.md) for the six source-derived presets' correspondence and gaps. Angular/Vue/Nuxt compose the common preset and have separately tested framework integrations, not a claim of complete source/target parity.

Regenerate and verify the Oxlint inventory with:

```bash
npm run generate:ox
npm run inventory:ox
npm run generate:ox:check
npm run inventory:ox:check
```

## Stylelint (SCSS preset)

| Layer | `@st1ggy/linter-config` | Notes |
| --- | --- | --- |
| SCSS stack | `stylelint.config.scss.js` (recommended + scss + sass-guidelines + clean-order + plugins) | Full Stylelint stack for SCSS. |

Inventory: Stylelint rule entries after `extends` resolution on `src/examples/example.scss`.
