Add oxlint linting
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- developer-experience
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 620
- Fork
- 16
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di FormidableLabs/use-editable
-
Add browser test suiteAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
cmd + / Keyboard ShortcutAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
FormidableLabs/use-editable#36 · 1 commento · 1 reazione ·
-
Identifier "b" has already been declaredForse già presa @haneetsingh l’ha presa 634 giorni fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Defocus every first typingAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
FormidableLabs/use-editable#30 · 3 commenti · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
Tutte le issue di FormidableLabs/use-editable
Issue simili
-
area:workflow bug ready-for-human
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fil-donadoni/tolaria#6108 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/rocketmq-dashboard#7234 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vitest-dev/vitest#11656 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ehmpathy/rhachet-roles-bhrain#655 ·
I maintainer di solito rispondono entro 1 giorno