Home

Awesome

<div align="center"> <h1>eslint-plugin-react-form-fields</h1> <h3>React Form Fields specific linting rules for ESLint</h3>

License Actions Status NPM Version Downloads Month Downloads Total Dependencies Status Semantic Release Commitizen Friendly PRs Welcome

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

All Contributors

<!-- ALL-CONTRIBUTORS-BADGE:END --> </div>

Installation

Install ESLint either locally or globally. (Note that locally, per project, is strongly preferred)

$ npm install eslint --save-dev

If you installed ESLint globally, you have to install React plugin globally too. Otherwise, install it locally.

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

Configuration

Use our preset to get reasonable defaults:

  "extends": [
    "eslint:recommended",
    "plugin:react-form-fields/recommended"
  ]

If you do not use a preset you will need to specify individual rules and add extra configuration.

Add "react-form-fields" to the plugins section.

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

Enable the rules that you would like to use.

  "rules": {
    "react-form-fields/no-mix-controlled-with-uncontrolled": "error",
    "react-form-fields/no-only-value-prop": "error"
  }

See also Configuring ESLint.

Rules

<!--RULE_TABLE_BEGIN-->

Possible Errors

Rule IDDescription
react-form-fields/no-mix-controlled-with-uncontrolledForbid to specify both value/checked and defaultValue/defaultChecked props to form fields⭐️
react-form-fields/no-only-value-propForbid to specify only value/checked without onChange and readOnly props to form fields⭐️
react-form-fields/styled-no-mix-controlled-with-uncontrolledForbid to specify both value/checked and defaultValue/defaultChecked props to form fields
react-form-fields/styled-no-only-value-propForbid to specify only value/checked without onChange and readOnly props to form fields
<!--RULE_TABLE_END-->

Semantic Versioning Policy

This plugin follows Semantic Versioning and ESLint's Semantic Versioning Policy.

Contributing

Welcome your contribution!

See also ESLint Contribution Guide.

Development Tools

Contributors

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://qiita.com/kotarella1110"><img src="https://avatars.githubusercontent.com/u/12913947?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kotaro Sugawara</b></sub></a><br /><a href="https://github.com/kotarella1110/eslint-plugin-react-form-fields/commits?author=kotarella1110" title="Code">💻</a> <a href="https://github.com/kotarella1110/eslint-plugin-react-form-fields/commits?author=kotarella1110" title="Documentation">📖</a> <a href="#ideas-kotarella1110" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-kotarella1110" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/kotarella1110/eslint-plugin-react-form-fields/commits?author=kotarella1110" title="Tests">⚠️</a></td> </tr> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © Kotaro Sugawara