chore(lint): clear the four lint warnings and fail on warnings #6
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lint-warnings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #5
Changes
hooks/useObjectUrl.ts(new): makes an object URL for a blob and revokes it when the blob changes or the component unmounts. This is the one place allowed to set state in an effect, with a comment saying why: an object URL is an external resource that must live and die with the component.components/ImagePicker.tsx: each preview is a small component using the hook. Adding or removing one image no longer recreates every preview URL.pages/Profile.tsx: the new-picture preview uses the hook.useObjectUrl), not a list (useObjectUrls). A list would change identity on every render and need extra care to avoid re-running the effect.postWithImagesmoved frompages/Diary.tsxtomatrix/diary.ts, next touploadImageandpostEntry. Diary and Notes import it from there, and page files export only components again.matrix/koto.test.ts: removed the unusedbeforeAllimport.package.json:lintis nowoxlint --deny-warnings, so warnings fail locally and in CI.Verification
npm run lintexit 1; removing it brings it back to 0.LGTM!