New
Introducing React Bench, see how different models perform on React code

react-doctor/no-indeterminate-attribute

Indeterminate checkbox state set as an attribute

  • Category: Bugs
  • Severity: warn
  • Source: oxlint-plugin-react-doctor
  • Framework: global
  • Enabled when: always
  • Default: Enabled

Validation prompt

Use this to decide whether a fired diagnostic is real or a false positive.

Confirm the reported code matches Indeterminate checkbox state set as an attribute. Check the framework context and diagnostic message before suppressing it.

Fix prompt

Use this once validation confirms the diagnostic is real.

Assign the checkbox element's indeterminate DOM property, usually through a ref, because the HTML attribute does not control its visual state.

More Bugs rules from the rules reference:

  • react-doctor/no-initialize-state: Disallow initializing state in an effect.
  • react-doctor/no-is-mounted: Disallow the removed legacy isMounted() API — cancel async work instead of guarding setState.
  • react-doctor/no-jsx-element-type: Widen the return type from JSX.Element to React.ReactNode: function App(): React.ReactNode
  • react-doctor/no-legacy-class-lifecycles: Move side effects in `componentWillMount` to `componentDidMount`; replace `componentWillReceiveProps` with `componentDidUpdate` (compare prevProps) or the static `getDerivedStateFromProps` for pure state derivation; replace `componentWillUpdate` with `getSnapshotBeforeUpdate` paired with `componentDidUpdate`. The `UNSAFE_` prefix only silences the warning — React 19 removes both forms.
  • react-doctor/no-legacy-context-api: Replace `childContextTypes` + `getChildContext` with `const MyContext = createContext(...)` + `<MyContext.Provider value={...}>`; replace `contextTypes` with `static contextType = MyContext` (single context) or `useContext()` / `use()` from a function component. The provider and every consumer must migrate together — partial migrations leave consumers reading the wrong context.