reactjs / reactjs/react.dev

[Bug]: eslint-plugin-react-hooks documentation says that 2 rules are recommended and all others are opt-in but that's not true

オープン
#8,066 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug: unconfirmed
主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
1日 11時間
マージ済み PR(30日)
11

説明

Summary

https://react.dev/reference/eslint-plugin-react-hooks says:

Starting in version 6.0, these rules are available to opt-in:
...

According to that page only exhaustive-deps and rules-of-hooks are recommended.

But if you look are the source code for 7.0, you can see that extending configs.flat.recommended will more or less enable ALL the rules, including the ones related to the compiler:

https://github.com/facebook/react/blob/4b3e662e4ce54eb54a8701c48a967cc84a389501/packages/eslint-plugin-react-hooks/src/index.ts#L49-L52

Either the documentation needs to be updated or there is a bug in eslint-plugin-react-hooks where the recommended flat configs enabled too many rules. I am not in a position to decide who is wrong here :).

Page

https://react.dev/reference/eslint-plugin-react-hooks

Details

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

react.dev/reference/eslint-plugin-react-hooks にある eslint-plugin-react-hooks のドキュメントと、packages/eslint-plugin-react-hooks/src/index.ts の 49-52 行付近で参照されている設定を比較します。推奨設定とドキュメントのどちらに一貫性がないのかを判断し、その後、該当するソースを更新して、ドキュメントに記載されたルールの動作が設定と一致することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
eslint, javascript, react
領域
documentation, tooling
issue の種類
ドキュメント
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。