Align eslint-config-next TypeScript peer with typescript-eslint (#101247)
## Summary
Narrow `eslint-config-next`'s optional TypeScript peer to `>=4.8.4
<6.1.0`, matching its `typescript-eslint` dependency. The previous
`>=3.3.1` range advertised unsupported compiler APIs, including
TypeScript 7, even though importing the config with TypeScript 7 throws
in `typescript-eslint`. Keep the peer optional for JavaScript consumers.
This makes the package metadata report the compatibility constraint
during installation. The side-by-side TypeScript 6 API / TypeScript 7
compiler setup is documented in #101246.
## Verification
- Packed the changed local `eslint-config-next` and installed it in
fresh consumer projects with ESLint 9.39.5. pnpm 12.15.0 (both
`--strict-peer-dependencies=false` and `--strict-peer-dependencies`),
Yarn Classic 1.22.22, and Yarn 4.18.1 with the `node-modules` linker
accept `typescript: npm:@typescript/typescript6@6.0.2` alongside
`@typescript/native: npm:typescript@7.0.2`. Each setup resolves the
compatibility package, exposes the TypeScript 6.0.3 compiler API, and
successfully lints a TypeScript file with
`eslint-config-next/typescript`.
- Fresh plain `typescript@7.0.2` installs produce peer warnings. pnpm's
`peers check` and Yarn 4's YN0060 diagnostic explicitly identify
`eslint-config-next` and `>=4.8.4 <6.1.0`; Yarn Classic reports the
unsupported TypeScript peers in the dependency tree.
- Yarn version limitation: 4.18.1 installs and lints successfully but
warns that its built-in TypeScript compatibility patch cannot find
`_tsc.js` in the alias package. An additional check with Yarn 4.10.3
fails at that patch step, before linting.
- `pnpm exec jest --runInBand test/unit/eslint-config-next`: 3 tests and
3 snapshots passed.
- `pnpm test-start-webpack test/production/eslint-config-next`: all 5
existing JavaScript/TypeScript checks passed, covering ESLint 9 and 10,
including npm installation.
- `pnpm install --frozen-lockfile` passed without a lockfile change. The
local JS build, package formatting, and pre-commit checks passed. ESLint
ignores the JSON manifest because no matching configuration applies.
<!-- NEXT_JS_LLM -->