zero-tolerance-doctrine: noImplicitAny reported missing when strict is true
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- devtools
调研方向
false 的发现来自对 src/checkers/sacred-laws/zero-tolerance.ts 中 compilerOptions.strict 和 compilerOptions.noImplicitAny 的两项独立检查,所以请从那里开始。阅读现有检查如何处理 strict,然后思考 noImplicitAny 未设置与显式设为 false 时的区别。完成标准是:包含 strict: true 且没有 noImplicitAny 的测试夹具不产生任何发现,而包含 strict: true, noImplicitAny: false 的夹具仍然产生发现。
由索引模型根据 Issue 内容生成。
描述
Version: develop, and #503 (bugfix/486-foreign-json-reader)
Law: Zero Tolerance Doctrine (SACRED LAW): src/checkers/sacred-laws/zero-tolerance.ts
What happens
The law reports TypeScript noImplicitAny not enabled for a tsconfig that sets "strict": true and does not repeat "noImplicitAny": true. strict turns noImplicitAny on, so the finding is false.
develop, zero-tolerance.ts:
if (!tsConfig || !compilerOptions.strict) {
violations.push('TypeScript strict mode not enabled');
}
if (!tsConfig || !compilerOptions.noImplicitAny) {
violations.push('TypeScript noImplicitAny not enabled');
}
#503 reads the extends chain, but it keeps the same two independent checks (for (const [flag, finding] of [['strict', …], ['noImplicitAny', …]])).
Reproduction
A project whose tsconfig.json is { "compilerOptions": { "strict": true } } gets TypeScript noImplicitAny not enabled.
What I ruled out
This repository's own self-audit is not affected, because its tsconfig sets both flags explicitly. I have only read the code path above and have not built a fixture yet.
Suggested direction
Treat noImplicitAny as enabled when it is true, or when it is unset and strict is true. Only an explicit "noImplicitAny": false should be reported. strictModeOf in #503's src/utils/tsconfig-chain.ts already models this "strict implies" rule the other way round. Red/green: a fixture with strict: true and no noImplicitAny produces no finding, and one with strict: true, noImplicitAny: false still produces it.
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 2 小时 36 分钟
- 30 天内合并 PR
- 168
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Rule-Of-Code/RoC 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
Rule-Of-Code/RoC#548 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
Rule-Of-Code/RoC#547 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
Rule-Of-Code/RoC#501 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 62/100
Rule-Of-Code/RoC#563 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 50/100
Rule-Of-Code/RoC#562 ·
维护者通常 1 天内回复
相似的 Issue
-
bug done
难度 2/5 1-3 小时 新手友好度 65/100
neavo/LinguaGacha#1124 ·
维护者通常 1 天内回复
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errors可能已有人在做 @fullsend-ai-coder 今天认领。 未关闭e2e-failure ready-to-code
难度 2/5 1 小时以内 新手友好度 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 条评论 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
brylie/mission-island#225 ·
维护者通常 1 天内回复
-
status/need-triage
难度 2/5 1-3 小时 新手友好度 72/100
google-gemini/gemini-cli#30412 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复