-
Notifications
You must be signed in to change notification settings - Fork 3
Update react config to whitelist idomatic react patterns #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Something I've noticed is So we can't satisfy both rules. I'd rather know if something is missing from my dep array here than use a readonly type, since it is being passed into React anyway. Perhaps there is some way this rule can be disabled for hook dependency arrays specifically? |
That rule ( I guess that's the long way of saying we should consider disabling it in the default/recommended config. Especially for the react config, but maybe even in the base config too. |
We've added whitelisting for hooks to two rules so far:
It's based on a clumsy function name heuristic ( I'll leave this issue open because there's certainly more work to do yet. |
We should probably whitelist React components and JSX elements from |
Example: functional/no-expression-statement is too noisy in the face of hooks. That rule does have an
ignorePattern
option that could be used to whitelist useFoo statements under the assumption that they're hooks. https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/no-expression-statements.md#ignorepatternThe text was updated successfully, but these errors were encountered: