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

Code before:
                    const filePath = getFixturePath("eslintrc", "quotes.js");
                    const exit = await cli.execute(`--no-eslintrc --no-ignore ${filePath}`, null, false);

                    assert.isTrue(log.info.notCalled);
                    assert.strictEqual(exit, 0);
                });
            });

            describe("when executing without no-eslintrc flag", () => {
                it("should load a local config file", async () => {
                    const filePath = getFixturePath("eslintrc", "quotes.js");
                    const exit = await cli.execute(`--no-ignore ${filePath}`, null, false);

                    assert.isTrue(log.info.calledOnce);
                    assert.strictEqual(exit, 1);
                });
            });

            describe("when executing without env flag", () => {
                it("should not define environment-specific globals", async () => {
                    const files = [
                        getFixturePath("globals-browser.js"),
                        getFixturePath("globals-node.js")
                    ];

                    await cli.execute(`--no-eslintrc --config ./packages/js/src/configs/eslint-recommended.js --no-ignore ${files.join(" ")}`, null, false);

                    assert.strictEqual(log.info.args[0][0].split("\n").length, 10);
                });
            });


            describe("when supplied with a plugin", () => {
                it("should pass plugins to ESLint", async () => {
                    const examplePluginName = "eslint-plugin-example";

                    await verifyESLintOpts(`--no-ignore --plugin ${examplePluginName} foo.js`, {
                        overrideConfig: {
                            plugins: [examplePluginName]
                        }
                    });
                });

            });

            describe("when supplied with a plugin-loading path", () => {
                it("should pass the option to ESLint", async () => {
                    const examplePluginDirPath = "foo/bar";

                    await verifyESLintOpts(`--resolve-plugins-relative-to ${examplePluginDirPath} foo.js`, {
                        resolvePluginsRelativeTo: examplePluginDirPath

Review comment (bug):
`name` is not allowed in eslintrc mode. however, `js.configs.recommended` was used here, so I updated the test to avoid failing.

Code after:
                    const filePath = getFixturePath("eslintrc", "quotes.js");
                    const exit = await cli.execute(`--no-eslintrc --no-ignore ${filePath}`, null, false);

                    assert.isTrue(log.info.notCalled);
                    assert.strictEqual(exit, 0);
                });
            });

            describe("when executing without no-eslintrc flag", () => {
                it("should load a local config file", async () => {
                    const filePath = getFixturePath("eslintrc", "quotes.js");
                    const exit = await cli.execute(`--no-ignore ${filePath}`, null, false);

                    assert.isTrue(log.info.calledOnce);
                    assert.strictEqual(exit, 1);
                });
            });

            describe("when executing without env flag", () => {
                it("should not define environment-specific globals", async () => {
                    const files = [
                        getFixturePath("globals-browser.js"),
                        getFixturePath("globals-node.js")
                    ];

                    await cli.execute(`--no-eslintrc --config ./tests/fixtures/config-file/js/.eslintrc.js --no-ignore ${files.join(" ")}`, null, false);

                    assert.strictEqual(log.info.args[0][0].split("\n").length, 10);
                });
            });


            describe("when supplied with a plugin", () => {
                it("should pass plugins to ESLint", async () => {
                    const examplePluginName = "eslint-plugin-example";

                    await verifyESLintOpts(`--no-ignore --plugin ${examplePluginName} foo.js`, {
                        overrideConfig: {
                            plugins: [examplePluginName]
                        }
                    });
                });

            });

            describe("when supplied with a plugin-loading path", () => {
                it("should pass the option to ESLint", async () => {
                    const examplePluginDirPath = "foo/bar";

                    await verifyESLintOpts(`--resolve-plugins-relative-to ${examplePluginDirPath} foo.js`, {
                        resolvePluginsRelativeTo: examplePluginDirPath