增强: [await-thenable] 允许在 promise 聚合检查中使用 maybe-promise
作者: valadaptive创建于 2025年10月11日更新于 2026年9月16日
标签package: eslint-pluginenhancement: new plugin ruleaccepting prs
我犹豫了,是否应该将此问题报告为 `await-thenable` 规则中的一个 bug,还是作为将此行为移植到新规则的提案。有关的行为是 `await-thenable` 规则的新功能,它会在将一个包含 `Promise<T> | (some non-promise type)` 的数组传入诸如 `Promise.all` 之类的 promise 聚合方法时报告错误。此问题已在 https://GitHub.com/TypeScript-eslint/TypeScript-eslint/issues/11609 中报告为 bug,因为它拒绝了有效且有用的代码。该 bug在 https://GitHub.com/TypeScript-eslint/TypeScript-eslint/pull/11611 中被“修复”了,但仅针对数组 *字面量* 的情况。以下代码仍然被拒绝:
内容来源: typescript-eslint/typescript-eslint