Try @eslint-react/kit@beta
logoESLint React

hook

Reports all React Hooks in JSON format. Useful for debugging. This rule should be used only for debugging purposes; otherwise, leave it off.

Full Name in eslint-plugin-react-debug

react-debug/hook

Features

🐞

Rule Details

This rule reports all React Hooks in JSON format. It detects built-in Hooks (such as useState, useEffect) as well as custom Hooks that follow the use prefix naming convention.

Examples

Built-in hook used inside a custom hook

import React, { useState } from "react";

// This rule reports calls to built-in React Hooks.
function useToggle() {
  const [value, setValue] = useState(false);

  return [value, () => setValue((x) => !x)] as const;
}

Versions

Resources


See Also

On this page