eslint-plugin-react-hooks-safe-option
v1.0.4
Published
```js function useCustom() { const ref = useRef(0) return [ref] } ```
Downloads
4
Readme
基于 eslint-plugin-react-hooks 修改,支持添加 safe-hooks-option 选项
function useCustom() {
const ref = useRef(0)
return [ref]
}
/* .eslintrc.js */
"plugins": ["react-hooks-safe-option"],
"rules": {
"react-hooks-safe-option/rules-of-hooks": "error",
"react-hooks-safe-option/exhaustive-deps": [
"error",
{
// "additionalHooks": "useImmer"
"safeHooks": "(useImmer[1]|useCustom[0])",
},
],
},