refactor(types): enable noImplicitAny - #162
Merged
Merged
Conversation
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #161
改动
根因说明
之前预估的 6 个隐式 any 是同一个根因:
text-table无类型声明 →table()返回any→ 下游.split()/.map()/.replace()回调参数全部隐式 any。安装官方@types/text-table后,整条链获得上下文类型,只剩一个真实错误:@types/text-table把align收紧为"l" | "r" | "c" | "." | null | undefined,代码里的""不在联合内。已核对 text-table 运行时源码(index.js 只比较'.'/'r'/'c'):undefined与""走同一条默认分支,替换可证等价、零行为变化。callback 参数无需手写注解——类型全部来自 DT 声明的上下文推导。
验证
npm run typecheck(noImplicitAny 开启)npm test -- --runInBandnpm run build+ emit 检查npm run test:package