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

Code before:
     * passed to the constructor.
     * @returns {string|undefined} The path to the config file being used or
     *      `undefined` if no config file is being used.
     */
    async findConfigFile() {
        const options = privateMembers.get(this).options;
        const { configFilePath } = await locateConfigFileToUse(options);

        return configFilePath;
    }

    /**
     * Checks if a given path is ignored by ESLint.
     * @param {string} filePath The path of the file to check.
     * @returns {Promise<boolean>} Whether or not the given path is ignored.
     */
    async isPathIgnored(filePath) {
        const config = await this.calculateConfigForFile(filePath);

        return config === void 0;
    }
}

/**
 * Returns whether flat config should be used.
 * @returns {Promise<boolean>} Where flat config should be used.
 */
async function shouldUseFlatConfig() {
    switch (process.env.ESLINT_USE_FLAT_CONFIG) {
        case "true":
            return true;
        case "false":
            return false;
        default:

            /*
             * If neither explicitly enabled nor disabled, then use the presence
             * of a flat config file to determine enablement.
             */
            return !!(await findFlatConfigFile(process.cwd()));
    }
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
    FlatESLint,
    shouldUseFlatConfig
};

Review comment (suggestion):
Not your fault, but might as well fix it now.

```suggestion
 * @returns {Promise<boolean>} Whether flat config should be used.
```

Code after:
     * passed to the constructor.
     * @returns {string|undefined} The path to the config file being used or
     *      `undefined` if no config file is being used.
     */
    async findConfigFile() {
        const options = privateMembers.get(this).options;
        const { configFilePath } = await locateConfigFileToUse(options);

        return configFilePath;
    }

    /**
     * Checks if a given path is ignored by ESLint.
     * @param {string} filePath The path of the file to check.
     * @returns {Promise<boolean>} Whether or not the given path is ignored.
     */
    async isPathIgnored(filePath) {
        const config = await this.calculateConfigForFile(filePath);

        return config === void 0;
    }
}

/**
 * Returns whether flat config should be used.
 * @returns {Promise<boolean>} Whether flat config should be used.
 */
async function shouldUseFlatConfig() {
    switch (process.env.ESLINT_USE_FLAT_CONFIG) {
        case "true":
            return true;
        case "false":
            return false;
        default:

            /*
             * If neither explicitly enabled nor disabled, then use the presence
             * of a flat config file to determine enablement.
             */
            return !!(await findFlatConfigFile(process.cwd()));
    }
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
    FlatESLint,
    shouldUseFlatConfig
};