Add oxlint linting
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
Start with src/useEditable.ts at the lines the issue cites (about 284, 325 and 519) and with the check and format scripts in package.json, which the new lint step has to join. Add a .oxlintrc.json modelled on react-live's, and decide which findings to suppress or disable. Done means npm run check runs oxlint and passes, the two cheap fixes are in, and the hooks-order change has been checked by hand in a browser since there are no tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Add oxlint linting, following react-live's setup (.oxlintrc.json, check:lint in npm run check, oxlint --fix in npm run format).
Findings
Running react-live's .oxlintrc.json against src/useEditable.ts gives about 17 findings:
Real issues, cheap to fix
- Hooks after an early return (
src/useEditable.ts:284):if (typeof navigator !== 'object') return edit;runs before twouseLayoutEffectcalls. Harmless in practice (the condition is fixed per environment) but violates the rules of hooks. Move the guard into the effects, or drop it, since layout effects don't run on the server anyway. - Unused catch binding (
:325):catch (_error)→catch {}.
Real smell, but fixing it changes behavior
[elementRef.current!, …]deps (:519): reads a ref during render, and the hook relies on that to reattach when the element changes. A proper fix needs a callback ref or an API change. Suggest suppressing inline with an explanatory comment.
React Compiler-style rules (immutability, refs, about 8 findings)
- These conflict with the hook's design: a mutable
stateobject fromuseState(() => …)that is never set, only mutated from effects and handlers. Suggest turning these rules off for this repo.
Noise / intentional
exhaustive-deps/memo-dependencies: the dependency arrays are deliberately partial.no-shadow(state),no-underscore-dangle(_trackStateTimestamp).
Proposal
- Add
oxlint+.oxlintrc.jsonbased on react-live's, with the compiler-style rules off - Fix the two cheap issues
- Suppress
:519inline with a comment - Leave the noise as warnings
- Wire
check:lintintocheckandoxlint --fixintoformat
Since there are no tests yet, verify the hooks-order change by hand in a browser.
- Ngôn ngữ chính
- TypeScript
- Star
- 620
- Fork
- 16
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FormidableLabs/use-editable
-
Add browser test suiteĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
cmd + / Keyboard ShortcutĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
FormidableLabs/use-editable#36 · 1 bình luận · 1 reaction ·
-
Identifier "b" has already been declaredCó thể đã có người làm @haneetsingh đã nhận 634 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Defocus every first typingĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
FormidableLabs/use-editable#30 · 3 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
Tất cả issue của FormidableLabs/use-editable
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
getsentry/sentry-conventions#732 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:in-linear status:team-assigned team:nodes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
n8n-io/n8n#41548 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
motiondivision/motion#3955 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DQ assisgnment closing at CRĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
equinor/prisma-decision-web#919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
自荐 / Suggestion: Prisma ComputeĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100