Skip to content

fix(pack): downgrade duplicate binding from err to warn#2301

Closed
fireairforce wants to merge 1 commit intonextfrom
fix-duplicate-error
Closed

fix(pack): downgrade duplicate binding from err to warn#2301
fireairforce wants to merge 1 commit intonextfrom
fix-duplicate-error

Conversation

@fireairforce
Copy link
Member

Summary

ref: utooland/next.js#70

Test Plan

更新了快照测试。

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @fireairforce, 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 adjusts the severity level for duplicate variable bindings detected by the pack module. Previously, such occurrences would halt the build process with an error, but they are now downgraded to warnings. This change aims to provide a more lenient approach to certain code patterns, allowing for successful compilation while still notifying developers of potential issues. The modification is supported by the introduction of new snapshot tests that specifically demonstrate and confirm this updated error handling.

Highlights

  • Duplicate Binding Severity: The handling of duplicate bindings within the pack module has been changed from an error to a warning, allowing builds to proceed with a less critical notification.
  • New Snapshot Tests: New snapshot tests have been added to validate the updated behavior for duplicate imports, ensuring the change functions as expected.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new snapshot test to verify that duplicate import bindings are now treated as warnings instead of errors. The test case is well-structured and correctly demonstrates the intended change. I have a few minor suggestions to add a trailing newline to the new test input files, which is a general best practice.

@xusd320
Copy link
Contributor

xusd320 commented Nov 6, 2025

上游的 PR ,感觉用 error msg 字符串匹配不太靠谱啊

@fireairforce
Copy link
Member Author

上游的 PR ,感觉用 error msg 字符串匹配不太靠谱啊

https://github.com/swc-project/swc/blob/main/crates/swc_ecma_lints/src/rules/critical_rules.rs#L770 swc 这里没导出一个错误的 label 之类的内容

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants