eslint-plugin-react-hook-form
Version:
ESLint plugin for react-hook-form
38 lines (31 loc) • 1.03 kB
JavaScript
/**
* @fileoverview ESLint for react-hook-form
* @author Andrew Kao
*/
;
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var requireIndex = require("requireindex");
//------------------------------------------------------------------------------
// Plugin Definition
//------------------------------------------------------------------------------
// import all rules in lib/rules
module.exports.rules = requireIndex(__dirname + "/rules");
const plugins = ["react-hook-form"];
module.exports.configs = {
recommended: {
plugins,
rules: {
"react-hook-form/destructuring-formstate": "error",
"react-hook-form/no-access-control": "error",
"react-hook-form/no-nested-object-setvalue": "error",
},
},
"react-compiler": {
plugins,
rules: {
"react-hook-form/no-use-watch": "error",
},
},
};