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

Code before:
    });

    describe("baseConfig", () => {
        it("can be an object", async () => {
            const eslint = new FlatESLint({
                overrideConfigFile: true,
                baseConfig: {
                    rules: {
                        semi: 2
                    }
                }
            });

            const [{ messages }] = await eslint.lintText("foo");

            assert.strictEqual(messages.length, 1);
            assert.strictEqual(messages[0].ruleId, "semi");
        });

        it("can be an array", async () => {
            const eslint = new FlatESLint({
                overrideConfigFile: true,
                baseConfig: [
                    {
                        rules: {
                            "no-var": 2
                        }
                    },
                    {
                        rules: {
                            semi: 2
                        }
                    }
                ]
            });

            const [{ messages }] = await eslint.lintText("var foo");

            assert.strictEqual(messages.length, 2);
            assert.strictEqual(messages[0].ruleId, "no-var");
            assert.strictEqual(messages[1].ruleId, "semi");
        });

        it("should be inserted after default configs", async () => {
            const eslint = new FlatESLint({
                overrideConfigFile: true,
                baseConfig: {
                    languageOptions: {
                        ecmaVersion: 5,
                        sourceType: "script"
                    }

Review comment (suggestion):
`!node_modules/myconf` also shouldn't have any effects after `**/node_modules/**`. because it unignores the directory but everything under it is still ignored by `**/node_modules/**`.

Code after:
                                column: 3,
                                endColumn: 5,
                                endLine: 1,
                                line: 1,
                                message: "Expected '===' and instead saw '=='.",
                                messageId: "unexpected",
                                nodeType: "BinaryExpression",
                                ruleId: "eqeqeq",
                                severity: 2
                            }
                        ],
                        source: "a == b",
                        usedDeprecatedRules: [],
                        warningCount: 0,
                        fatalErrorCount: 0
                    }
                ]);
            });
        });

        describe("if { ignores: 'foo/*.js', ... } is present by '--config node_modules/myconf/eslint.config.js',", () => {
            const { prepare, cleanup, getPath } = createCustomTeardown({
                cwd: `${root}a3`,
                files: {
                    "node_modules/myconf/eslint.config.js": `module.exports = [{
                        ignores: ["!node_modules/myconf", "foo/*.js"],
                    }, {
                        rules: {
                            eqeqeq: "error"
                        }
                    }]`,
                    "node_modules/myconf/foo/test.js": "a == b",
                    "foo/test.js": "a == b"
                }
            });

            beforeEach(prepare);
            afterEach(cleanup);

            it("'lintFiles()' with '**/*.js' should lint 'node_modules/myconf/foo/test.js' but not 'foo/test.js'.", async () => {
                const engine = new FlatESLint({
                    overrideConfigFile: "node_modules/myconf/eslint.config.js",
                    cwd: getPath()
                });
                const files = (await engine.lintFiles("**/*.js"))
                    .map(r => r.filePath)
                    .sort();

                assert.deepStrictEqual(files, [
                    path.join(getPath(), "node_modules/myconf/eslint.config.js"),
                    path.join(getPath(), "node_modules/myconf/foo/test.js")