Skip to content

Bug: eslint-plugin-react-hooks@6.1.1 TypeError: Converting circular structure to JSON #34733

@mikaelbalin

Description

@mikaelbalin

After updating eslint-plugin-react-hooks to version 6.1.1, running eslint . throws an error caused by a circular reference inside the configuration object.

React version: 19.2.0

Steps To Reproduce

  1. git clone https://github.com/mikaelbalin/mikaelbalin.github.io
  2. cd mikaelbalin.github.io
  3. pnpm i
  4. pnpm lint

Link to code example: https://github.com/mikaelbalin/mikaelbalin.github.io

The current behavior

Running eslint . fails with the following error:

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'configs' -> object with constructor 'Object'
    |     property 'flat/recommended' -> object with constructor 'Array'
    |     ...
    |     property 'plugins' -> object with constructor 'Object'
    --- property 'react-hooks' closes the circle

The expected behavior

ESLint should run normally and display linting warnings/errors without crashing. Including or extending the react-hooks plugin or its recommended config should not introduce a circular reference in the ESLint configuration 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