final-form / final-form/react-final-form
RFC: eslint form behavior rules
- Dominant language
- JavaScript
- Stars
- 7.4k
- Forks
- 497
- PR merge metrics
- No merged PRs in 30d
Description
### This is an RFC for a new feature
### What is the current behavior?
Nothing currently relevant. Also, this functionality would probably be in a new repo.
### What is the expected behavior?
Eslint rules that help enforce/encourage usage of form and field errors and state.
Might look like a rule that enforces using various parts of the form state, such as submitError, hasSubmitError, hasSubmitErrors and having their use enforced in specific children. Example: requiring that a Form has an Alert element child that takes submitError as it's child.
Rules like this will likely be pretty brittle, but I think that may be ok, since even if you have to disable them, they serve to remind you do implement the functionality in your form.
I don't immediately have the knowledge for writing such an eslint rule, but I thought it might be helpful to throw the idea out there, and if someone has a good idea for implementing it maybe it takes off.
Contributor guide
Assessment
This issue has not been assessed yet.