-
Notifications
You must be signed in to change notification settings - Fork 31
fix: prettier-vscode
doesn't work with import
#271
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
✅ Deploy Preview for apiccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for liveccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for appccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Summary of Changes
Hello @Hanssen0, 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 addresses a compatibility issue with the prettier-vscode
extension, specifically fixing instances where it failed to work correctly due to how Prettier plugins were referenced in prettier.config.mjs
files. The core change involves simplifying the plugin declarations from using import.meta.resolve()
to directly specifying the plugin names as strings. This update is applied consistently across multiple package configurations, ensuring that prettier-vscode
can properly load and utilize the configured plugins, thereby restoring expected formatting behavior.
Highlights
- Prettier Configuration Update: Modified
prettier.config.mjs
files across various packages to update how Prettier plugins are referenced. - Plugin Resolution Fix: Replaced
import.meta.resolve()
calls with direct string names for plugins (e.g.,"prettier-plugin-organize-imports"
) to resolve an issue whereprettier-vscode
was not correctly loading plugins. - Enhanced
prettier-vscode
Compatibility: This change directly addresses a reported issue (prettier/prettier-vscode#3066) where the VS Code Prettier extension was not functioning as expected due to the previous plugin import method.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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
-
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. ↩
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.
Code Review
This pull request correctly addresses an incompatibility with prettier-vscode
by replacing import.meta.resolve
with static strings for plugin definitions in numerous prettier.config.mjs
files. This change enhances compatibility and is implemented consistently across the repository. The fix is appropriate and well-executed. A potential area for future improvement, highlighted by this widespread change, would be to consolidate the duplicated Prettier configurations. Leveraging Prettier's configuration lookup by having a single root config and removing identical package-level configs would simplify maintenance and prevent the need for such wide-ranging changes for a single configuration update.
✅ Deploy Preview for docsccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
/canary |
🚀 Canary version published successfully! View workflow run The following packages have been published to npm:
|
Both https://github.com/Hanssen0/ccc/actions/runs/17113458629/job/48539677322 and https://github.com/ckb-devrel/ccc/actions/runs/17113715498/job/48540439531 work fine without error. We previously got some errors of failing to resolve plugins, but those should be solved by disabling prettier for changeset. Plugins are dev dependencies and won't be installed when publishing, so we shouldn't let changeset invoke the prettier (or at least a custom prettier config file should be provided to changeset, but sadly we can't do that). |
https://github.com/ckb-devrel/ccc/actions/runs/17113901205/job/48540983050 passed, #226 updated correctly. |
Related issue prettier/prettier-vscode#3066