Flake8 plugin to enforce the rules of hooks for IDOM
Project description
flake8-idom-hooks
A Flake8 plugin that enforces the "rules of hooks" for IDOM.
The implementation is based on React's own ESLint plugin for hooks.
Install
pip install flake8-idom-hooks
Developer Installation
pip install -r requirements.txt
pip install -e .
Run the tests
tox
Errors
ROH2**
errors can be enabled with the --exhaustive-hook-deps
flag or setting
exhaustive_hook_deps = True
in your flake8
config.
Code | Message |
---|---|
ROH100 | Hook is defined as a closure |
ROH101 | Hook was used outside component or hook definition |
ROH102 | Hook was used inside a conditional or loop statement |
ROH200 | A hook's dependency is not destructured - dependencies should be refered to directly, not via an attribute or key of an object |
ROH201 | Hook dependency args should be a literal list, tuple or None |
ROH202 | Hook dependency is not specified |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for flake8_idom_hooks-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e95d066671e7c96b6131155b3311084bfe3b641b938139901fd1e1b4011e9748 |
|
MD5 | 6e3ebdee09866fd4b2f527bdb4492d0e |
|
BLAKE2b-256 | f0a0247f8c8c2f1f8cc4d145d6c2688d5b2daa350a8e6882d83b180ddb380633 |