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

Đang mở
#8,066 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug: unconfirmed
Ngôn ngữ chính
JavaScript
Star
11.8k
Fork
7.9k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
11

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

So sánh tài liệu của eslint-plugin-react-hooks tại react.dev/reference/eslint-plugin-react-hooks với cấu hình được tham chiếu trong packages/eslint-plugin-react-hooks/src/index.ts quanh các dòng 49-52. Xác định xem cấu hình được khuyến nghị hay tài liệu không nhất quán, sau đó cập nhật nguồn liên quan và xác minh rằng hành vi được tài liệu hóa của rule khớp với cấu hình.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
eslint, javascript, react
Lĩnh vực
documentation, tooling
Loại issue
Tài liệu
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.