Skip to content

Bug: eslint-plugin-react-hooks Typescript types are broken #36016

@krutoo

Description

@krutoo

React version:

Steps To Reproduce

  1. npm i eslint-plugin-react-hooks
  2. configure TypeScript to strict mode,
  3. use plugin in eslint.config.ts like pluginReact.configs.flat.recommended
  4. See error:
Type 'ReactFlatConfig | undefined' is not assignable to type 'InfiniteArray<ConfigWithExtends>'.
  Type 'undefined' is not assignable to type 'InfiniteArray<ConfigWithExtends>'.

Link to code example:

The current behavior

Forced to use non-null assertion but it is banned in my eslint config =)

The expected behavior

Types can declare each existing property of flat object

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions