Configuration
This guide explains how to configure the Hyper Fetch ESLint plugin to match your project's needs.
Basic Configuration
After installing the plugin, you have two options for configuration:
-
Using the Recommended Configuration
The recommended configuration enables all rules with their suggested severity levels:
{
"plugins": [
// ... your other plugins
"hyper-fetch"
]
}
-
Manual Configuration
For more control, you can manually configure each rule:
{
"plugins": [
// ... your other plugins
"hyper-fetch"
],
"rules": {
// ... your other rules
"hyper-fetch/client-generic-types": "error",
"hyper-fetch/request-generic-types": "error"
}
}
Rule Severity Levels
Each rule can be set to one of these severity levels:
"off"or0- Turn the rule off"warn"or1- Turn the rule on as a warning (doesn't affect exit code)"error"or2- Turn the rule on as an error (exit code will be 1)
Example of setting different severity levels:
{
"plugins": ["hyper-fetch"],
"rules": {
"hyper-fetch/client-generic-types": "error",
"hyper-fetch/request-generic-types": "warn"
}
}
Next Steps
Now that you've configured the plugin, proceed to the Rules section to learn about the specific rules and what issues they help you identify.
