Repository: eslint/eslint
File: tests/lib/config/flat-config-array.js (JavaScript)

Code before:
                    ], `Key "${key}": This appears to be in eslintrc format rather than flat config format.`);

                });
            });

            it("should error when plugins is an array", async () => {
                await assertInvalidConfig([
                    {
                        plugins: ["foo"]
                    }
                ], "Key \"plugins\": This appears to be in eslintrc format (array of strings) rather than flat config format (object).");

            });


        });

    });

    // https://github.com/eslint/eslint/issues/12592
    describe("Shared references between rule configs", () => {

        it("shared rule config should not cause a rule validation error", () => {

            /* eslint-disable-next-line prefer-const -- need to allow mutation inside FlatConfigArray */
            let ruleConfig = ["error", {}];

            const configs = new FlatConfigArray([{
                rules: {
                    camelcase: ruleConfig,
                    "default-case": ruleConfig
                }
            }]);

            configs.normalizeSync();

            const config = configs.getConfig("foo.js");

            assert.deepStrictEqual(config.rules, {
                camelcase: [2, {
                    ignoreDestructuring: false,
                    ignoreGlobals: false,
                    ignoreImports: false
                }],
                "default-case": [2, {}]
            });

        });


        it("should throw rule validation error for camelcase", async () => {

Review comment (suggestion):
```suggestion
            const ruleConfig = ["error", {}];
```

I think `let` isn't necessary here.

Code after:
                    ], `Key "${key}": This appears to be in eslintrc format rather than flat config format.`);

                });
            });

            it("should error when plugins is an array", async () => {
                await assertInvalidConfig([
                    {
                        plugins: ["foo"]
                    }
                ], "Key \"plugins\": This appears to be in eslintrc format (array of strings) rather than flat config format (object).");

            });


        });

    });

    // https://github.com/eslint/eslint/issues/12592
    describe("Shared references between rule configs", () => {

        it("shared rule config should not cause a rule validation error", () => {

            const ruleConfig = ["error", {}];

            const configs = new FlatConfigArray([{
                rules: {
                    camelcase: ruleConfig,
                    "default-case": ruleConfig
                }
            }]);

            configs.normalizeSync();

            const config = configs.getConfig("foo.js");

            assert.deepStrictEqual(config.rules, {
                camelcase: [2, {
                    ignoreDestructuring: false,
                    ignoreGlobals: false,
                    ignoreImports: false
                }],
                "default-case": [2, {}]
            });

        });


        it("should throw rule validation error for camelcase", async () => {