
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
eslint-plugin-react-hook-form
Advanced tools
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.
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
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"
}
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 | ⛔️ | 🔧 |
Icon | Description |
---|---|
⛔️ | Reports as error in recommended configuration |
⚠️ | Reports as warning in recommended configuration |
🔧 | Rule is fixable with eslint --fix |
FAQs
ESLint plugin for react-hook-form
The npm package eslint-plugin-react-hook-form receives a total of 6,440 weekly downloads. As such, eslint-plugin-react-hook-form popularity was classified as popular.
We found that eslint-plugin-react-hook-form demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.