fix: merge duplicate imports in packages/core#19788
fix: merge duplicate imports in packages/core#19788Nixxx19 wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @Nixxx19, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors import statements throughout the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to consolidate duplicate import statements, which is a valuable code quality improvement. While most of the changes correctly merge imports, I've identified two critical issues where the automated fix likely produced invalid TypeScript. Specifically, some value imports were incorrectly merged into import type statements, which will cause the build to fail. Please address these to ensure the code remains compilable.
| import type { | ||
| TelemetryTarget, | ||
| AuthType, | ||
| Config, | ||
| type ConfigParameters, |
There was a problem hiding this comment.
This change incorrectly merges the imports into an import type statement. AuthType and Config are values, not types, and cannot be imported using import type. This will cause a compilation error.
| import type { | |
| TelemetryTarget, | |
| AuthType, | |
| Config, | |
| type ConfigParameters, | |
| import { | |
| type TelemetryTarget, | |
| AuthType, | |
| Config, | |
| type ConfigParameters, |
| import type { | ||
| Config, | ||
| GeminiEventType, | ||
| ApprovalMode, | ||
| type ToolCallConfirmationDetails, |
There was a problem hiding this comment.
This change incorrectly merges the imports into an import type statement. GeminiEventType and ApprovalMode are values (likely enums), not types, and cannot be imported using import type. This will cause a compilation error.
| import type { | |
| Config, | |
| GeminiEventType, | |
| ApprovalMode, | |
| type ToolCallConfirmationDetails, | |
| import { | |
| type Config, | |
| GeminiEventType, | |
| ApprovalMode, | |
| type ToolCallConfirmationDetails, |
Merged duplicate import statements across all files in packages/core to comply with the import/no-duplicates ESLint rule. Changes include: - Combined type and value imports from the same module - Merged namespace imports with named imports where appropriate - Fixed import ordering to separate value imports from type imports - Ensured all imports follow the inline type import pattern All 265 test suites pass successfully. Related to google-gemini#19753
a99c450 to
070c6f5
Compare
|
Closing this PR to create a cleaner version without unrelated changes. |
Summary
packages/core(130+ files)typesyntaximport/no-duplicatesESLint ruleChanges
--fixwithimport/no-duplicatesrule to automatically merge most duplicatesgetFolderStructure.test.tsto use correct namespace import referencesTesting
Related
Part of #19753 - PR 3 of 4 (packages/core)
Previous PRs: