Skip to content

Bug: eprh README eslint.config.js examples cause parsing errors #34779

@mdj-uk

Description

@mdj-uk

The sample eslint.config.js in the eprh readme doesn't work out of the box. It errors with

Parsing error: Unexpected token ...

either due to not recognising jsx syntax (in a js project) or not recognising typescript syntax (ts project)

I realise that providing a fully functional eslint setup is outside the scope of react, and much will depend on framework/bundler. But I think having an absolutely minimal example which works if you copy-paste would be helpful, both for people not yet using eslint who want to start using the linter, and also for folks having problems updating to the latest version.

eslint-plugin-react-hooks version: 6.1.1
update: version 7.0.0 also has a problem, see comment below

Steps To Reproduce

  1. clone repros / open sandboxes
  2. try running npm run lint

Link to code example:

The current behavior

Parsing error when trying to lint

The expected behavior

Linting should work if you copy-paste example configs from readme

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