Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .eslintrc.json

This file was deleted.

39 changes: 39 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineConfig } from "eslint/config";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

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,
},
}]);
Comment on lines +16 to +41
Copy link
Copy Markdown
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
Copy Markdown
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.

3 changes: 2 additions & 1 deletion firestore/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"devDependencies": {
"@types/mocha": "^10.0.1",
"firebase-tools": "^12.2.1",
"mocha": "^10.2.0"
"mocha": "^10.2.0",
"debug": "^4.4.3"
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
"lint": "find . -type f -name \"*.js\" -not -path \"*node_modules*\" | xargs eslint"
Comment thread
morganchen12 marked this conversation as resolved.
Outdated
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.5",
"@eslint/js": "9.39.4",
"@types/node": "^24.10.0",
"eslint": "^9.39.1",
"eslint": "^9.39.4",
"eslint-config-google": "^0.14.0",
"firebase-tools": "^14.24.0",
"globals": "^17.4.0",
"pnpm": "^10.20.0",
"typescript": "^5.9.3"
}
Expand Down
Loading
Loading