cloudfour / cloudfour/cloudfour.com-patterns

TypeScript 6 is blocked: typescript-eslint misreads types under it

未关闭
#2,465 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
SCSS
星标
26
派生
3
平均合并
19 小时 32 分钟
30 天内合并 PR
81

描述

This repo is on TypeScript 5.9.3 and never got the v6 upgrade. It will need it before the ESLint 10 / `@cloudfour/eslint-config` v26 work in #2458 can land.

## Why we're stuck on 5.x

Renovate opened #2437 (TypeScript v7), which was closed because TypeScript 7 is incompatible with `typescript-eslint` — it peers `typescript: ">=4.8.4 <6.1.0"`. Unlike our sibling repos there was never a v6 PR here at all, so nothing replaced it.

`@cloudfour/eslint-config` did make the jump — cloudfour/eslint-config#704 merged TypeScript v6 there.

## Why it matters

`@cloudfour/eslint-config` v26 is built on `eslint-config-xo@1.0.0`, which declares:

```
peerDependencies: { typescript: ">=6" }
```

On TypeScript 5.9.3 that peer is unsatisfied, so npm installs `typescript@7.0.2` alongside our pinned copy to satisfy it, dragging in TypeScript 7's `@typescript/typescript-*` platform binaries. Those aren't in `package-lock.json`, so `npm ci` fails with `Missing: typescript@7.0.2 from lock file`. That is exactly what's breaking cloudfour/simple-svg-placeholder#302 right now.

## Why 6.0.3 specifically

The two peer ranges in play only overlap on the 6.0.x line:

| Package | Peer range |
| --- | --- |
| `eslint-config-xo@1.0.0` | `typescript: ">=6"` |
| `typescript-eslint@8.66.0` (a dependency of xo) | `typescript: ">=4.8.4 <6.1.0"` |

TypeScript 7.0.2 is currently `latest` on npm but fails the second range — which is why #2437 was closed. 5.9.3 fails the first. **6.0.3 is the only line satisfying both.**

## Two separate blockers here

Worth being explicit that this repo has **two** independent things standing between it and v26, and fixing one won't unblock #2458 on its own:

1. **This issue** — TypeScript 5.9.3 vs xo's `>=6` peer.
2. **#2464** — `eslint-plugin-react@7.37.5` supports ESLint `^9.7` at most, so it can't coexist with v26's `eslint ^10.6.0` requirement.

#2458 currently fails at `npm ci` on the second of those, so the TypeScript problem hasn't even surfaced there yet. It will once #2464 is resolved.

## This one needs a real check

This repo uses TypeScript properly — there's a `tsconfig.json` and a `ts-dist` build output — so 5.9.3 → 6.0.3 is a genuine major upgrade, not the peer-satisfying formality it is in `simple-svg-placeholder`. It should get a full type-check and build, with a review of anything TypeScript 6 newly rejects.

贡献指南

打开贡献指南

调研方向

先检查依赖设置、tsconfig.json 和 ts-dist 的构建输出,然后运行 npm ci,以验证 lockfile 能根据所声明的 peer 范围解析 TypeScript 6.0.3。运行完整的类型检查和构建,并检查 TypeScript 6 新近拒绝的所有内容;完成的标准是这些检查通过,且没有 TypeScript 7 的 lockfile 失败。

由索引模型根据 Issue 内容生成。

评估

技术栈
eslint, typescript
领域
build-system, tooling
Issue 类型
重构
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。