Conversation
Summary of ChangesHello, 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 primarily updates the project's linting infrastructure by migrating the ESLint configuration to the modern flat config format. This involves removing the old Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 updates the ESLint configuration to the new flat config format. The new eslint.config.mjs file has a structural issue that will prevent it from working as intended; I've provided a critical fix for this. I've also included a couple of suggestions to further simplify the configuration and the linting script in package.json to align better with modern ESLint practices.
| export default defineConfig([{ | ||
| extends: compat.extends("eslint:recommended"), | ||
|
|
||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.commonjs, | ||
| ...globals.es2015, | ||
| ...globals.node, | ||
| ...globals.mocha, | ||
| }, | ||
|
|
||
| ecmaVersion: 8, | ||
| sourceType: "module", | ||
| }, | ||
|
|
||
| rules: { | ||
| "linebreak-style": ["error", "unix"], | ||
| quotes: ["error", "single"], | ||
| semi: ["error", "always"], | ||
| "no-console": 0, | ||
| "no-unused-vars": 0, | ||
| }, | ||
| }]); No newline at end of file |
There was a problem hiding this comment.
The structure of your ESLint flat configuration is incorrect. The extends property is not valid within a configuration object in the new flat config format. Instead, you should spread the array of configurations returned by compat.extends() into the main configuration array.
Additionally, for better readability, it's recommended to use string values ("off") instead of 0 to disable rules.
export default defineConfig([
...compat.extends("eslint:recommended"),
{
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.es2015,
...globals.node,
...globals.mocha,
},
ecmaVersion: 8,
sourceType: "module",
},
rules: {
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"],
"no-console": "off",
"no-unused-vars": "off",
},
},
]);There was a problem hiding this comment.
This seems to be valid based on the test failure. @kevinthecheung do you mind fixing this? I committed a suggestion from Gemini, so you'll have to pull before pushing new patches.
| const compat = new FlatCompat({ | ||
| baseDirectory: __dirname, | ||
| recommendedConfig: js.configs.recommended, | ||
| allConfig: js.configs.all | ||
| }); |
There was a problem hiding this comment.
As a follow-up improvement, you could simplify this configuration by not using FlatCompat for eslint:recommended. The @eslint/js package, which you already import, provides this configuration directly as js.configs.recommended. Using it would allow you to remove the FlatCompat initialization here, the related imports (path, fileURLToPath, FlatCompat), and the @eslint/eslintrc dependency from package.json. This would make your configuration more aligned with the modern flat config style and reduce dependencies.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
morganchen12
left a comment
There was a problem hiding this comment.
LGTM besides the failure in eslint.config.mjs.
This fixes the broken tests.