Repository: eslint/eslint
File: lib/config/config-loader.js (JavaScript)

Code before:
             */

            let emptyConfig = typeof fileConfig === "undefined";

            debug(`Config file ${configFilePath} is ${emptyConfig ? "empty" : "not empty"}`);

            if (fileConfig) {
                if (Array.isArray(fileConfig)) {
                    if (fileConfig.length === 0) {
                        debug(`Config file ${configFilePath} is an empty array`);
                        emptyConfig = true;
                    } else {
                        configs.push(...fileConfig);
                    }
                } else {
                    if (Object.keys(fileConfig).length === 0) {
                        debug(`Config file ${configFilePath} is an empty object`);
                        emptyConfig = true;
                    } else {
                        configs.push(fileConfig);
                    }
                }
            }

            if (emptyConfig) {
                globalThis.process?.emitWarning?.(`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want.`, "ESLintEmptyConfigWarning");
            }

        }

        // add in any configured defaults
        configs.push(...defaultConfigs);

        // append command line ignore patterns
        if (ignorePatterns && ignorePatterns.length > 0) {

            let relativeIgnorePatterns;

            /*
             * If the config file basePath is different than the cwd, then
             * the ignore patterns won't work correctly. Here, we adjust the
             * ignore pattern to include the correct relative path. Patterns
             * passed as `ignorePatterns` are relative to the cwd, whereas
             * the config file basePath can be an ancestor of the cwd.
             */
            if (basePath === cwd) {
                relativeIgnorePatterns = ignorePatterns;
            } else {

                // relative path must only have Unix-style separators
                const relativeIgnorePath = path.relative(basePath, cwd).replace(/\\/gu, "/");

Review comment (refactor):
```suggestion
                globalThis.process?.emitWarning?.(`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want. If you want to run ESLint with an empty config, export [{}] to remove this warning.`, "ESLintEmptyConfigWarning");
```

A suggestion on how to remove the warning if empty config is intentional.

Code after:
             */

            let emptyConfig = typeof fileConfig === "undefined";

            debug(`Config file ${configFilePath} is ${emptyConfig ? "empty" : "not empty"}`);

            if (!emptyConfig) {
                if (Array.isArray(fileConfig)) {
                    if (fileConfig.length === 0) {
                        debug(`Config file ${configFilePath} is an empty array`);
                        emptyConfig = true;
                    } else {
                        configs.push(...fileConfig);
                    }
                } else {
                    if (typeof fileConfig === "object" && fileConfig !== null && Object.keys(fileConfig).length === 0) {
                        debug(`Config file ${configFilePath} is an empty object`);
                        emptyConfig = true;
                    } else {
                        configs.push(fileConfig);
                    }
                }
            }

            if (emptyConfig) {
                globalThis.process?.emitWarning?.(`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want. If you want to run ESLint with an empty config, export [{}] to remove this warning.`, "ESLintEmptyConfigWarning");
            }

        }

        // add in any configured defaults
        configs.push(...defaultConfigs);

        // append command line ignore patterns
        if (ignorePatterns && ignorePatterns.length > 0) {

            let relativeIgnorePatterns;

            /*
             * If the config file basePath is different than the cwd, then
             * the ignore patterns won't work correctly. Here, we adjust the
             * ignore pattern to include the correct relative path. Patterns
             * passed as `ignorePatterns` are relative to the cwd, whereas
             * the config file basePath can be an ancestor of the cwd.
             */
            if (basePath === cwd) {
                relativeIgnorePatterns = ignorePatterns;
            } else {

                // relative path must only have Unix-style separators
                const relativeIgnorePath = path.relative(basePath, cwd).replace(/\\/gu, "/");