Skip to content

[Compiler Bug]: eslint plugin rule only applied to first instance inside a file #31545

@miachenmtl

Description

@miachenmtl

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://playground.react.dev/#N4Igzg9grgTgxgUxALhHCA7MAXABAMwglwF5cAKASlID4LqS7gBfAHQ3YQA8AHCGPABME+AIZQANnnxQMcbAEtMuALIBPAII8eVXMHa5c6LNKIBhURIkAjUXADWpXACUEd7ADooYBBau2HckIIKkoDI0wcXFsYPxs7RzJXdy8fOID7IKJQ9nCYBGxYDFwAHkEFADcaAAkEK2IAdX4JQRKAenKqgG52NgwQZiA

Repro steps

For the rule 'Expected the first argument to be an inline function expression', it is only applied to the first violation even if there is more than one violation. (Example in playground link.) Moreover, on my setup if I eslint-disable the first violation and then eslint-enable after, then subsequent violations still aren't shown. I couldn't get eslint-disable to work in the playground though.

How often does this bug happen?

Every time

What version of React are you using?

18.3.1

What version of React Compiler are you using?

n/a eslint-plugin issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions