Skip to content

[Bug]: incorrect type for Flat Config #3867

Closed as duplicate of#3838
Closed as duplicate of#3838
@renchris

Description

@renchris

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

The eslint-config-airbnb plugin does not have the correct type for the Flat Config whether it be using the tselint config helper from typescript-eslint or using the Linter type from eslint

import reactPlugin from "eslint-plugin-react";
import tseslint from 'typescript-eslint';
import { type Linter } from "eslint";

const reactConfigRecommended = reactPlugin.configs.flat!.recommended

const tsEslintConfig = tseslint.config(
    reactConfigRecommended,
);
// error: Argument of type ReactFlagConfig is not assignable to parameter of type InfiniteDepthConfigWithExtends

const linterConfig: Linter.Config[] = [
    reactConfigRecommended,
}];
// error: Type ReactFlagConfig is not assignable to type Config<RulesRecord>

### Expected Behavior

I would expect there not to be a type conflict error.

### eslint-plugin-react version

7.37.2

### eslint version

8.57.1

### node version

18.20.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions