Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: incorrect type for Flat Config #3867

Closed
2 tasks done
renchris opened this issue Dec 12, 2024 · 1 comment
Closed
2 tasks done

[Bug]: incorrect type for Flat Config #3867

renchris opened this issue Dec 12, 2024 · 1 comment
Labels

Comments

@renchris
Copy link

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
@renchris renchris added the bug label Dec 12, 2024
@ljharb
Copy link
Member

ljharb commented Dec 12, 2024

I believe this will be fixed by #3840, which makes this a duplicate of #3838.

@ljharb ljharb closed this as completed Dec 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

No branches or pull requests

2 participants