Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug]: TS error in flat config: reactPlugin.configs.flat is possibly undefined #3875

Closed
2 tasks done
tigrr opened this issue Jan 11, 2025 · 1 comment
Closed
2 tasks done
Labels

Comments

@tigrr
Copy link

tigrr commented Jan 11, 2025

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

When configuring the plugin as per its documentation and using the typescript-eslint package's type helper like so:

export default tsEslint.config(
    reactPlugin.configs.flat.recommended
)

It produces typescript error:

'react.configs.flat' is possibly 'undefined'.ts(18048)
(property) flat?: Record<string, react.ReactFlatConfig> | undefined

Also see #3838

Expected Behavior

No error

eslint-plugin-react version

v7.37.3

eslint version

v9.14.0

node version

v22.11.0

@tigrr tigrr added the bug label Jan 11, 2025
@ljharb
Copy link
Member

ljharb commented Jan 11, 2025

Duplicate of #3874.

@ljharb ljharb closed this as completed Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants