mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
feat: bump eslint & oxlint (#14452)
#### PR Dependency Tree * **PR #14452** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved null-safety, dependency tracking, upload validation, and error logging for more reliable uploads, clipboard, calendar linking, telemetry, PDF/theme printing, and preview/zoom behavior. * Tightened handling of all-day calendar events (missing date now reported). * **Deprecations** * Removed deprecated RadioButton and RadioButtonGroup; use RadioGroup. * **Chores** * Unified and upgraded linting/config, reorganized imports, and standardized binary handling for more consistent builds and tooling. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -14,17 +14,15 @@ export const useGuard = <
|
||||
) => {
|
||||
const guardService = useService(GuardService);
|
||||
useEffect(() => {
|
||||
// oxlint-disable-next-line exhaustive-deps
|
||||
guardService.revalidateCan(action, ...args);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
}, [action, guardService, ...args]);
|
||||
|
||||
const livedata$ = useMemo(
|
||||
() => {
|
||||
// oxlint-disable-next-line exhaustive-deps
|
||||
return guardService.can$(action, ...args);
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
[action, guardService, ...args]
|
||||
);
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ export function useAsyncCallback<T extends any[]>(
|
||||
const handleAsyncError = React.useContext(AsyncCallbackContext);
|
||||
return React.useCallback(
|
||||
(...args: any) => {
|
||||
// oxlint-disable-next-line exhaustive-deps
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
callback(...args).catch(e => handleAsyncError(e));
|
||||
},
|
||||
[...deps] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
[...deps] // oxlint-disable-line react/exhaustive-deps
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,9 @@ export const useCatchEventCallback = <
|
||||
cb: (e: E, ...args: Args) => void | Promise<void>,
|
||||
deps: DependencyList
|
||||
) => {
|
||||
return useAsyncCallback(
|
||||
async (e: E, ...args: Args) => {
|
||||
e.stopPropagation();
|
||||
await cb(e, ...args);
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
deps
|
||||
);
|
||||
return useAsyncCallback(async (e: E, ...args: Args) => {
|
||||
e.stopPropagation();
|
||||
await cb(e, ...args);
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
}, deps);
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ const PageOperationCellMenuItem = ({
|
||||
track.$.docInfoPanel.$.open();
|
||||
workspaceDialogService.open('doc-info', { docId: blocksuiteDoc.id });
|
||||
}
|
||||
}, [blocksuiteDoc?.id, workspaceDialogService]);
|
||||
}, [blocksuiteDoc, workspaceDialogService]);
|
||||
|
||||
const onDisablePublicSharing = useCallback(() => {
|
||||
// TODO(@EYHN): implement disable public sharing
|
||||
|
||||
@@ -68,9 +68,7 @@ const DesktopTagEditMenu = ({
|
||||
<MenuItem
|
||||
prefixIcon={<DeleteIcon />}
|
||||
type="danger"
|
||||
onClick={() => {
|
||||
tag?.id ? onTagDelete(tag.id) : null;
|
||||
}}
|
||||
onClick={() => onTagDelete(tag.id)}
|
||||
>
|
||||
{t['Delete']()}
|
||||
</MenuItem>
|
||||
@@ -203,9 +201,7 @@ const MobileTagEditMenu = ({
|
||||
<ConfigModal.RowGroup>
|
||||
<ConfigModal.Row
|
||||
className={styles.mobileTagEditDeleteRow}
|
||||
onClick={() => {
|
||||
onTagDelete(tag.id);
|
||||
}}
|
||||
onClick={() => onTagDelete(tag.id)}
|
||||
>
|
||||
<DeleteIcon />
|
||||
{t['Delete']()}
|
||||
|
||||
@@ -150,6 +150,7 @@ export const TagsEditor = ({
|
||||
const idx = tagColors.findIndex(c => c.value === color);
|
||||
return tagColors[(idx + 1) % tagColors.length].value;
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/purity
|
||||
tagColors[Math.floor(Math.random() * tagColors.length)].value
|
||||
);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ const DesktopTextValue = ({
|
||||
useEffect(() => {
|
||||
ref.current?.addEventListener('blur', handleBlur);
|
||||
return () => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
ref.current?.removeEventListener('blur', handleBlur);
|
||||
};
|
||||
}, [handleBlur]);
|
||||
@@ -108,7 +108,7 @@ const MobileTextValue = ({
|
||||
useEffect(() => {
|
||||
ref.current?.addEventListener('blur', handleBlur);
|
||||
return () => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
ref.current?.removeEventListener('blur', handleBlur);
|
||||
};
|
||||
}, [handleBlur]);
|
||||
|
||||
Reference in New Issue
Block a user