Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add oxlint linting

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript

調査の方向性

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.

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

説明

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 two useLayoutEffect calls. 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 state object from useState(() => …) 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.json based on react-live's, with the compiler-style rules off
  • Fix the two cheap issues
  • Suppress :519 inline with a comment
  • Leave the noise as warnings
  • Wire check:lint into check and oxlint --fix into format

Since there are no tests yet, verify the hooks-order change by hand in a browser.

主要言語
TypeScript
スター
620
フォーク
16
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

FormidableLabs/use-editable のほかの issue

FormidableLabs/use-editable の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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