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

Code before:
                    configForRecursive,
                    { ...options, filename: block.path, physicalFilename: block.physicalPath }
                );
            }

            slots.lastSourceCode = null;

            // Does lint.
            return this.#flatVerifyWithoutProcessors(
                block,
                config,
                { ...options, filename: block.path, physicalFilename: block.physicalPath }
            );
        });

        return postprocess(messageLists, filenameToExpose);
    }

    /**
     * Verify using flat config and without any processors.
     * @param {VFile} file The file to lint.
     * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything.
     * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
     * @throws {Error} If during rule execution.
     * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
     */
    #flatVerifyWithoutProcessors(file, providedConfig, providedOptions) {

        const slots = internalSlotsMap.get(this);
        const config = providedConfig || {};
        const options = normalizeVerifyOptions(providedOptions, config);
        const languageOptions = config.languageOptions;

        languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(
            languageOptions.ecmaVersion
        );

        // double check that there is a parser to avoid mysterious error messages
        if (!languageOptions.parser) {
            throw new TypeError(`No parser specified for ${options.filename}`);
        }

        // Espree expects this information to be passed in
        if (isEspree(languageOptions.parser)) {
            const parserOptions = languageOptions.parserOptions;

            if (languageOptions.sourceType) {

                parserOptions.sourceType = languageOptions.sourceType;

                if (

Review comment (suggestion):
Same here. Wanted to avoid creating two `VFile`s for the same block.

Code after:

            // Does lint.
            return this.#flatVerifyWithoutProcessors(
                block,
                config,
                { ...options, filename: block.path, physicalFilename: block.physicalPath }
            );
        });

        return processorService.postprocessSync(file, messageLists, {
            processor: {
                preprocess,
                postprocess
            }
        });
    }

    /**
     * Verify using flat config and without any processors.
     * @param {VFile} file The file to lint.
     * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything.
     * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
     * @throws {Error} If during rule execution.
     * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
     */
    #flatVerifyWithoutProcessors(file, providedConfig, providedOptions) {

        const slots = internalSlotsMap.get(this);
        const config = providedConfig || {};
        const options = normalizeVerifyOptions(providedOptions, config);
        const languageOptions = config.languageOptions;

        languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(
            languageOptions.ecmaVersion
        );

        // double check that there is a parser to avoid mysterious error messages
        if (!languageOptions.parser) {
            throw new TypeError(`No parser specified for ${options.filename}`);
        }

        // Espree expects this information to be passed in
        if (isEspree(languageOptions.parser)) {
            const parserOptions = languageOptions.parserOptions;

            if (languageOptions.sourceType) {

                parserOptions.sourceType = languageOptions.sourceType;

                if (
                    parserOptions.sourceType === "module" &&