Skip to content

Update ESLint config#423

Merged
kevinthecheung merged 5 commits intomasterfrom
kc-eslint
Mar 9, 2026
Merged

Update ESLint config#423
kevinthecheung merged 5 commits intomasterfrom
kc-eslint

Conversation

@kevinthecheung
Copy link
Contributor

@kevinthecheung kevinthecheung commented Mar 9, 2026

This fixes the broken tests.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 .eslintrc.json file and introducing eslint.config.mjs with the updated configuration. Corresponding ESLint-related development dependencies have also been upgraded or added to facilitate this change. Additionally, a new debug development dependency was introduced in the firestore/main package.

Highlights

  • ESLint Configuration Migration: The project's ESLint configuration has been migrated from the legacy .eslintrc.json format to the new flat configuration system using eslint.config.mjs.
  • ESLint Dependency Updates: Core ESLint packages and related dependencies (@eslint/eslintrc, @eslint/js, globals) were updated or added to support the new flat configuration.
  • New debug Dependency: The debug package was added as a development dependency in firestore/main/package.json.

🧠 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
  • .eslintrc.json
    • Removed the legacy ESLint configuration file.
  • eslint.config.mjs
    • Introduced the new ESLint flat configuration file, defining linting rules and environments.
  • firestore/main/package.json
    • Added the debug package as a development dependency.
  • package.json
    • Updated the eslint package and added @eslint/eslintrc, @eslint/js, and globals development dependencies to support the new flat configuration.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
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 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.

Comment on lines +16 to +39
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
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

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",
        },
    },
]);

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +10 to +14
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

@kevinthecheung kevinthecheung marked this pull request as ready for review March 9, 2026 22:39
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Contributor

@morganchen12 morganchen12 left a comment

Choose a reason for hiding this comment

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

LGTM besides the failure in eslint.config.mjs.

@kevinthecheung kevinthecheung merged commit 820af91 into master Mar 9, 2026
9 checks passed
@kevinthecheung kevinthecheung deleted the kc-eslint branch March 9, 2026 23:42
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