All Projects → andykao1213 → eslint-plugin-react-hook-form

andykao1213 / eslint-plugin-react-hook-form

Licence: MIT license
ESLint plugin for react-hook-form

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to eslint-plugin-react-hook-form

Eslint Plugin Boundaries
Eslint plugin checking architecture boundaries between elements
Stars: ✭ 157 (+481.48%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Ember
An ESlint plugin that provides set of rules for Ember Applications based on commonly known good practices.
Stars: ✭ 240 (+788.89%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Lodash
ESLint rules for lodash
Stars: ✭ 208 (+670.37%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Css Modules
Project status: NOT MAINTAINED; Checks that you are using the existent css/scss classes, no more no less
Stars: ✭ 115 (+325.93%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-rulesdir
An ESLint plugin to load project-specific ESLint rules
Stars: ✭ 28 (+3.7%)
Mutual labels:  eslint, eslint-plugin
Eslint Import Resolver Alias
a simple Node behavior import resolution plugin for eslint-plugin-import, supporting module alias
Stars: ✭ 121 (+348.15%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Eslint Comments
Additional ESLint rules for directive comments of ESLint.
Stars: ✭ 221 (+718.52%)
Mutual labels:  eslint, eslint-plugin
Sowing Machine
🌱A React UI toolchain & JSX alternative
Stars: ✭ 64 (+137.04%)
Mutual labels:  eslint, eslint-plugin
html-eslint
ESLint plugin for linting HTML
Stars: ✭ 72 (+166.67%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-pug
An ESLint plugin for linting inline scripts in Pug files
Stars: ✭ 17 (-37.04%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin I18n Json
Fully extendable eslint plugin for JSON i18n translation files.
Stars: ✭ 101 (+274.07%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-disable
Disable ESLint plugins using file path patterns and inline comments
Stars: ✭ 51 (+88.89%)
Mutual labels:  eslint, eslint-plugin
Typescript Eslint
✨ Monorepo for all the tooling which enables ESLint to support TypeScript
Stars: ✭ 10,831 (+40014.81%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Unicorn
Various awesome ESLint rules
Stars: ✭ 2,157 (+7888.89%)
Mutual labels:  eslint, eslint-plugin
Eslint Mdx
ESLint Parser/Plugin for MDX
Stars: ✭ 89 (+229.63%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Ava
ESLint rules for AVA
Stars: ✭ 209 (+674.07%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Lwc
Official ESLint rules for LWC
Stars: ✭ 51 (+88.89%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Monorepo
ESLint Plugin for monorepos
Stars: ✭ 56 (+107.41%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Mocha
ESLint rules for mocha
Stars: ✭ 249 (+822.22%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-editorconfig
An ESLint plugin to enforce EditorConfig rules
Stars: ✭ 22 (-18.52%)
Mutual labels:  eslint, eslint-plugin

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

Rule Description Recommended Fixable
destructuring-formState Use destructuring assignment to access the properties of formState. ⛔️
no-access-control Avoid accessing the properties of control ⛔️
no-nested-object-setvalue Avoid nested object in second argument of setValue ⛔️ 🔧

Key

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

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].