Skip to content

linter: react/react-compiler false positive: "Hooks may not be referenced as normal values" on a hook used as a tagged template #24473

Description

@jfsiii

What version of Oxlint are you using?

1.73.0

What command did you run?

npx oxlint@1.73.0 --config .oxlintrc.json --react-plugin repro.tsx

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "plugins": ["react"],
  "rules": { "react/react-compiler": "error" }
}

What happened?

Running

npx oxlint@1.73.0 --config .oxlintrc.json --react-plugin repro.tsx

in the repro repo yields

repro.tsx:7:23: error react(react-compiler): Hooks: Hooks may not be referenced as normal values, they must be called.
repro.tsx:14:20: error react(react-compiler): Hooks: Hooks may not be referenced as normal values, they must be called.

while

npx oxlint@1.72.0 --config .oxlintrc.json --react-plugin repro.tsx

yields no diagnostics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions