-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: enable rule "useHookAtTopLevel" #37
Conversation
recommendedに含まれていなかったので追加 see: https://biomejs.dev/linter/rules/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かにこちらのルールは有効化した方がよさそうです!
サンプルで上げていただいたようなコードは僕も以前気になり、hooksでなくただの関数で定義するか、それぞれのhooksに分割する方がよいというレビューをしていて気になっているところでした 🙇
有効になっていないことに気づいていなかったので防げるようになるとよさそうです!
マージして、ReleasesのDraftに反映されたら「Publish release」を押すとjsrに反映されます 👌 |
なるほど!ありがとうございます! |
Publish releaseどこ… 😭 |
あった!できました! |
ありがとうございます! ちょっとjsrへのpushが |
@schiughi |
@susiyaki |
@schiughi |
ありがとうございますー!:tada: |
oven-webappでreact hooks をトップレベル以外で使用してもlintエラーになっていないようでした
see usePublicEventByUserStatus
biomeのrecommendedの設定に
useExhaustiveDependencies
は含まれているのに対しuseHookAtTopLevel
が含まれていないのが原因のようですsee https://biomejs.dev/linter/rules/
(☑がついてるやつがrecommendedのもの)
React以外のプロジェクトでこのエラーを検知してしまう煩わしさより、Reactプロジェクトで検知漏れが起きるリスクの方が大きそうなのでこちらで対応しました!
何か追加してない理由があれば教えてください 🙇