maxLength 断言计算的是审计项,而不是身份信息 - 真正的修复和真正的回退相互抵消

作者: yunusdim创建于 2026年8月15日更新于 2026年8月15日

重现: 步骤 1) 灯塔断言配置: {"image-alt": ["error", {"maxLength": 1}] } 步骤 2) LHR 之前: image-alt 中有 1 个失败项, node.selector = img.header-logo。 步骤 3) 修复了 img.header-logo,但在不同元素上引入了一个新的失败的 image-alt 项, node.selector = img.footer-icon。 步骤 4) 通过 getAllAssertionResults 运行断言。

内容来源: GoogleChrome/lighthouse-ci