eslint-plugin-replace-hooks
v1.0.3
Published
replace some hooks by other hooks
Maintainers
Readme
eslint-plugin-replace-hooks
replace some hooks by other hooks
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-replace-hooks:
npm install eslint-plugin-replace-hooks --save-devUsage
Add replace-hooks to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"replace-hooks" // this must be placed before `import`
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"replace-hooks/no-forbidden-hooks": [
"error",
{ "useState": { "tip": "your custom hooks", "dependency": "your module" } }
]
}
}Supported Rules
- no-forbidden-hooks
Caution
this plugin should work with
eslint-plugin-import, especially the rulesimport/no-duplicatesto help merge import from same modules.the plugin must be placed before
eslint-plugin-importplugins: [ // other plugins, 'replace-hooks', 'import', ]
