-
Notifications
You must be signed in to change notification settings - Fork 52
fix: LiteralUnion type is not work #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough本次变更对 Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/utils/types.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. ✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/utils/types.ts (2)
3-3: 为 Record<never, never> 添加说明注释
建议在此行附近补充注释,解释为何用Record<never, never>替代{},以便未来维护者理解此改动背后的 TypeScript 类型推断考量。
3-3: 添加 TypeScript 类型级测试防止回归
建议引入tsd或类似工具,编写类型测试 (type tests),确保LiteralUnion<T, U>在实际使用中能正确恢复类型提示,避免未来改动导致类型推断失效。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #119 +/- ##
=======================================
Coverage 97.66% 97.66%
=======================================
Files 4 4
Lines 214 214
Branches 80 80
=======================================
Hits 209 209
Misses 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
LiteralUnion 的类型现在无法正常提示了,antd 的 Input 同理
之前

现在

Summary by CodeRabbit