Repository: eslint/eslint
File: lib/linter/linter.js (JavaScript)

Code before:
 * @name Linter
 */
class Linter {

    /**
     * Initialize the Linter.
     * @param {Object} [config] the config object
     * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined.
     * @param {Array<string>} [config.flags] the feature flags to enable.
     * @param {"flat"|"eslintrc"} [config.configType="flat"] the type of config used.
     */
    constructor({ cwd, configType = "flat", flags = [] } = {}) {

        const processedFlags = [];

        flags.forEach(flag => {
            if (inactiveFlags.has(flag)) {
                const inactiveFlagData = inactiveFlags.get(flag);
                const inactivityReason = getInactivityReasonMessage(inactiveFlagData);

                if (typeof inactiveFlagData.replacedBy === "undefined") {
                    throw new Error(`The flag '${flag}' is inactive: ${inactivityReason}`);
                }

                if (typeof inactiveFlagData.replacedBy === "string") {
                    processedFlags.push(inactiveFlagData.replacedBy);
                }

                globalThis.process?.emitWarning?.(
                    `The flag '${flag}' is inactive: ${inactivityReason}`,
                    `ESLintInactiveFlag_${flag}`
                );

                return;
            }

            if (!activeFlags.has(flag)) {
                throw new Error(`Unknown flag '${flag}'.`);
            }

            processedFlags.push(flag);
        });

        internalSlotsMap.set(this, {
            cwd: normalizeCwd(cwd),
            flags: processedFlags,
            lastConfigArray: null,
            lastSourceCode: null,
            lastSuppressedMessages: [],
            configType, // TODO: Remove after flat config conversion
            parserMap: new Map([["espree", espree]]),

Review comment (suggestion):
Just to add a bit of clarity.

```suggestion
                // if there's a replacement, enable it instead of original
                if (typeof inactiveFlagData.replacedBy === "string") {
```

Code after:
 * @name Linter
 */
class Linter {

    /**
     * Initialize the Linter.
     * @param {Object} [config] the config object
     * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined.
     * @param {Array<string>} [config.flags] the feature flags to enable.
     * @param {"flat"|"eslintrc"} [config.configType="flat"] the type of config used.
     */
    constructor({ cwd, configType = "flat", flags = [] } = {}) {

        const processedFlags = [];

        flags.forEach(flag => {
            if (inactiveFlags.has(flag)) {
                const inactiveFlagData = inactiveFlags.get(flag);
                const inactivityReason = getInactivityReasonMessage(inactiveFlagData);

                if (typeof inactiveFlagData.replacedBy === "undefined") {
                    throw new Error(`The flag '${flag}' is inactive: ${inactivityReason}`);
                }

                // if there's a replacement, enable it instead of original
                if (typeof inactiveFlagData.replacedBy === "string") {
                    processedFlags.push(inactiveFlagData.replacedBy);
                }

                globalThis.process?.emitWarning?.(
                    `The flag '${flag}' is inactive: ${inactivityReason}`,
                    `ESLintInactiveFlag_${flag}`
                );

                return;
            }

            if (!activeFlags.has(flag)) {
                throw new Error(`Unknown flag '${flag}'.`);
            }

            processedFlags.push(flag);
        });

        internalSlotsMap.set(this, {
            cwd: normalizeCwd(cwd),
            flags: processedFlags,
            lastConfigArray: null,
            lastSourceCode: null,
            lastSuppressedMessages: [],
            configType, // TODO: Remove after flat config conversion