@10stars/oxlint-plugin-react-hooks
v1.0.5
Published
Oxlint JS plugin for React hooks exhaustive-deps rule with enhanced configuration options.
Downloads
67
Readme
@10stars/oxlint-plugin-react-hooks
Oxlint JS plugin for React hooks exhaustive-deps rule with enhanced configuration options.
Fork of eslint-plugin-react-hooks & eslint-plugin-react-hooks-configurable adapted for oxlint's JS plugin system.
Installation
bun add @10stars/oxlint-plugin-react-hooksOxlint Configuration
{
"jsPlugins": ["@10stars/oxlint-plugin-react-hooks"],
"rules": {
"react/exhaustive-deps": "off",
"@10stars/react-hooks/exhaustive-deps": ["warn", {
"ignoreThisDependency": "always"
}]
}
}Rule Options
ignoreThisDependency
Control how this references (like props.doSomething()) are handled in dependency arrays.
Valid options: "never" (default), "props", "always"
{
"@10stars/react-hooks/exhaustive-deps": ["warn", {
"ignoreThisDependency": "always"
}]
}additionalHooks
Validate dependencies of custom hooks. Supports position configuration for where the callback argument is located.
{
"additionalHooks": {
"(useMyCustomHook|useMyOtherCustomHook)": 0,
"useMyImperativeHandle": 1
}
}additionalStableHooks
Mark custom hooks as returning stable values (fully or partially).
{
"additionalStableHooks": {
"use.+Ref": true,
"useMyCustomUseState": [false, true],
"useMyQuery": { "data": false, "refetch": true }
}
}