Skip to content
← Back to rules

react/todo Restriction

What it does

Reports code that React Compiler cannot yet analyze because it uses features the compiler has not implemented. These are skipped optimizations (bail-outs), not rule violations.

Powered by the React Compiler, which runs once per file and is shared with the other React Compiler rules. Port of react-hooks/todo.

Why is this bad?

The affected component or hook is left unoptimized. Enable this rule only when you want visibility into what the compiler skips; upstream ships it as an off-by-default hint.

How to use

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["react"],
  "rules": {
    "react/todo": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["react"],
  rules: {
    "react/todo": "error",
  },
});
bash
oxlint --deny react/todo --react-plugin

Version

This rule was added in vnext.

References