You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-react-hook-form

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-hook-form

ESLint plugin for react-hook-form

0.2.4
Source
npmnpm
Version published
Weekly downloads
6.9K
-1.98%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-react-hook-form

npm version GitHub

react-hook-form is an awsome library which provide a neat solution for building forms. However, there are many rules for the API which may be missed by the developer. This plugin aims to check those rules automatically thourgh ESLint. Thus brings better DX for react-hook-form.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-react-hook-form:

$ npm install eslint-plugin-react-hook-form --save-dev

Usage

Add react-hook-form to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["react-hook-form"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "react-hook-form/destructuring-formState": "error"
  }
}

or start with the recommended rule set:

{
  "extends": "plugin:react-hook-form/recommended"
}

Supported Rules

RuleDescriptionRecommendedFixable
destructuring-formStateUse destructuring assignment to access the properties of formState.⛔️
no-access-controlAvoid accessing the properties of control⛔️
no-nested-object-setvalueAvoid nested object in second argument of setValue⛔️🔧

Key

IconDescription
⛔️Reports as error in recommended configuration
⚠️Reports as warning in recommended configuration
🔧Rule is fixable with eslint --fix

License

MIT

Keywords

react

FAQs

Package last updated on 26 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.