{"id":19894,"library":"eslint-plugin-react-hook-form","title":"eslint-plugin-react-hook-form","description":"ESLint plugin for react-hook-form that enforces best practices and catches common mistakes during development. Current stable version is 0.3.1, with irregular release cadence (latest release May 2023). Provides rules like 'destructuring-formstate', 'no-access-control', 'no-nested-object-setvalue', and 'no-use-watch'. Differentiators: specifically targets react-hook-form API misuse (e.g., formState destructuring, control property access, nested objects in setValue, watch usage). Integrates via plugins and extends in ESLint config.","status":"active","version":"0.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/andykao1213/eslint-plugin-react-hook-form","tags":["javascript","react","react-hook-form","eslint","eslintplugin","eslint-plugin"],"install":[{"cmd":"npm install eslint-plugin-react-hook-form","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-react-hook-form","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-react-hook-form","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to use the plugin","package":"eslint","optional":false}],"imports":[{"note":"In ESLint config, do not include 'eslint-plugin-' prefix; use 'plugin:react-hook-form/recommended'.","wrong":"extends: ['eslint-plugin-react-hook-form/recommended']","symbol":"configs.recommended","correct":"extends: ['plugin:react-hook-form/recommended']"},{"note":"Use string severity ('error','warn','off') rather than numeric values. Prefix rule name with 'react-hook-form/'.","wrong":"rules: {'react-hook-form/destructuring-formstate': 2}","symbol":"rules","correct":"rules: {'react-hook-form/destructuring-formstate': 'error'}"},{"note":"ESLint automatically strips 'eslint-plugin-' prefix when specifying plugins.","wrong":"plugins: ['eslint-plugin-react-hook-form']","symbol":"Plugin import (ESLint config)","correct":"plugins: ['react-hook-form']"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"react-hook-form\"],\n  \"rules\": {\n    \"react-hook-form/destructuring-formstate\": \"error\",\n    \"react-hook-form/no-access-control\": \"warn\",\n    \"react-hook-form/no-nested-object-setvalue\": \"error\",\n    \"react-hook-form/no-use-watch\": \"warn\"\n  }\n}\n\n// Alternatively, use recommended config:\n{\n  \"extends\": \"plugin:react-hook-form/recommended\"\n}","lang":"javascript","description":"Shows how to configure the ESLint plugin in .eslintrc.json, either by specifying individual rules or extending the recommended config."},"warnings":[{"fix":"Ensure ESLint is run on files that import react-hook-form and that the plugin is included in the ESLint configuration.","message":"Rules only apply to files using react-hook-form; the plugin does not detect if react-hook-form is installed.","severity":"gotcha","affected_versions":"all"},{"fix":"Disable the rule or add inline exceptions using eslint-disable comments.","message":"Rule 'no-access-control' may report false positives if control is used legitimately (e.g., custom register).","severity":"deprecated","affected_versions":">=0.2.1"},{"fix":"Manually review calls to setValue with array arguments.","message":"The 'no-nested-object-setvalue' rule only flags nested objects in the second argument of setValue, but does not catch deep nesting in arrays.","severity":"gotcha","affected_versions":">=0.2.1"},{"fix":"Override rules in your config if different severity is desired.","message":"The recommended config sets 'destructuring-formstate' and 'no-nested-object-setvalue' as errors, 'no-access-control' as warning, and does not include 'no-use-watch'.","severity":"gotcha","affected_versions":">=0.2.1"}],"env_vars":null,"search_vec":"'0.3.1':28 '2023':36 'access':45,71 'api':64 'best':16 'cadenc':32 'catch':19 'common':20 'config':85 'control':46,69 'current':24 'destructur':41,68 'destructuring-formst':40 'develop':23 'differenti':57 'e.g':66 'enforc':15 'eslint':2,7,84,92,95 'eslint-plugin':94 'eslint-plugin-react-hook-form':1 'eslintplugin':93 'extend':82 'form':6,13,63,91 'formstat':42,67 'hook':5,12,62,90 'integr':78 'irregular':30 'javascript':86 'latest':33 'like':39 'may':35 'mistak':21 'misus':65 'nest':49,72 'no-access-control':43 'no-nested-object-setvalu':47 'no-use-watch':53 'object':50,73 'plugin':3,8,80,96 'practic':17 'properti':70 'provid':37 'react':4,11,61,87,89 'react-hook-form':10,60,88 'releas':31,34 'rule':38 'setvalu':51,75 'specif':58 'stabl':25 'target':59 'usag':77 'use':55 'version':26 'via':79 'watch':56,76","created_at":"2026-04-25T11:20:14.452029+00:00","updated_at":"2026-04-25T11:20:14.452029+00:00","problems":[{"fix":"Run npm install eslint-plugin-react-hook-form --save-dev and ensure plugins array contains 'react-hook-form' (not 'eslint-plugin-react-hook-form').","cause":"Plugin not installed or incorrectly referenced in ESLint config.","error":"Error: Failed to load plugin 'react-hook-form' declared in '...'"},{"fix":"Check that plugin is listed in plugins array and rule name is correct. Verify plugin version supports the rule.","cause":"Rule name misspelled or plugin not loaded properly.","error":"Definition for rule 'react-hook-form/destructuring-formstate' was not found"},{"fix":"Run npm install eslint-plugin-react-hook-form --save-dev.","cause":"npm package not installed in the project.","error":"Cannot find module 'eslint-plugin-react-hook-form'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/andykao1213/eslint-plugin-react-hook-form","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-react-hook-form","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}