diff --git a/.dumi/scripts/mirror-notify.js b/.dumi/scripts/mirror-notify.js index d66ec48b90..88c604ec44 100644 --- a/.dumi/scripts/mirror-notify.js +++ b/.dumi/scripts/mirror-notify.js @@ -20,7 +20,9 @@ const isEnabled = always || enabledCondition.every(Boolean); - if (!isEnabled) return; + if (!isEnabled) { + return; + } const prefixCls = 'antd-mirror-notify'; const primaryColor = '#1677ff'; diff --git a/.github/workflows/issue-inactivity-reminder.yml b/.github/workflows/issue-inactivity-reminder.yml index ffc1b8f060..1d0a1cc15a 100644 --- a/.github/workflows/issue-inactivity-reminder.yml +++ b/.github/workflows/issue-inactivity-reminder.yml @@ -39,7 +39,9 @@ jobs: const now = new Date(); for (const issue of issues) { - if (issue.pull_request) continue; + if (issue.pull_request) { + continue; + } const updatedAt = new Date(issue.updated_at); const daysInactive = (now - updatedAt) / (1000 * 60 * 60 * 24); diff --git a/components/alert/Alert.tsx b/components/alert/Alert.tsx index 51fd514714..5d3610bc59 100644 --- a/components/alert/Alert.tsx +++ b/components/alert/Alert.tsx @@ -176,7 +176,9 @@ const Alert = React.forwardRef((props, ref) => { // closeable when closeText or closeIcon is assigned const isClosable = React.useMemo(() => { - if (typeof closable === 'object' && closable.closeIcon) return true; + if (typeof closable === 'object' && closable.closeIcon) { + return true; + } if (closeText) { return true; } diff --git a/components/calendar/demo/notice-calendar.tsx b/components/calendar/demo/notice-calendar.tsx index d661a126bf..3ec4fe1446 100644 --- a/components/calendar/demo/notice-calendar.tsx +++ b/components/calendar/demo/notice-calendar.tsx @@ -65,8 +65,12 @@ const App: React.FC = () => { }; const cellRender: CalendarProps['cellRender'] = (current, info) => { - if (info.type === 'date') return dateCellRender(current); - if (info.type === 'month') return monthCellRender(current); + if (info.type === 'date') { + return dateCellRender(current); + } + if (info.type === 'month') { + return monthCellRender(current); + } return info.originNode; }; diff --git a/components/date-picker/demo/switchable.tsx b/components/date-picker/demo/switchable.tsx index b32a845c58..02cc2437a5 100644 --- a/components/date-picker/demo/switchable.tsx +++ b/components/date-picker/demo/switchable.tsx @@ -13,8 +13,12 @@ const PickerWithType = ({ type: PickerType; onChange: TimePickerProps['onChange'] | DatePickerProps['onChange']; }) => { - if (type === 'time') return ; - if (type === 'date') return ; + if (type === 'time') { + return ; + } + if (type === 'date') { + return ; + } return ; }; diff --git a/components/form/util.ts b/components/form/util.ts index 1b18bd552c..c5e8f06abc 100644 --- a/components/form/util.ts +++ b/components/form/util.ts @@ -11,8 +11,9 @@ const formItemNameBlackList = ['parentNode']; const defaultItemNamePrefixCls: string = 'form_item'; export function toArray(candidate?: T | T[] | false): T[] { - if (candidate === undefined || candidate === false) return []; - + if (candidate === undefined || candidate === false) { + return []; + } return Array.isArray(candidate) ? candidate : [candidate]; } diff --git a/components/mentions/demo/async.tsx b/components/mentions/demo/async.tsx index 4c29dbd13c..34182fdddf 100644 --- a/components/mentions/demo/async.tsx +++ b/components/mentions/demo/async.tsx @@ -16,8 +16,9 @@ const App: React.FC = () => { fetch(`https://api.github.com/search/users?q=${key}`) .then((res) => res.json()) .then(({ items = [] }) => { - if (ref.current !== key) return; - + if (ref.current !== key) { + return; + } setLoading(false); setUsers(items.slice(0, 10)); }); diff --git a/components/tabs/demo/size.tsx b/components/tabs/demo/size.tsx index 0838274520..a74228b3c2 100644 --- a/components/tabs/demo/size.tsx +++ b/components/tabs/demo/size.tsx @@ -39,7 +39,9 @@ const App: React.FC = () => { }; const remove = (targetKey: TargetKey) => { - if (!items) return; + if (!items) { + return; + } const targetIndex = items.findIndex((item) => item.key === targetKey); const newItems = items.filter((item) => item.key !== targetKey); diff --git a/components/timeline/TimelineItemList.tsx b/components/timeline/TimelineItemList.tsx index 8757781d0f..26db2390e8 100644 --- a/components/timeline/TimelineItemList.tsx +++ b/components/timeline/TimelineItemList.tsx @@ -22,13 +22,23 @@ const TimelineItemList: React.FC { const getPositionCls = (position: string, idx: number) => { if (mode === 'alternate') { - if (position === 'right') return `${prefixCls}-item-right`; - if (position === 'left') return `${prefixCls}-item-left`; + if (position === 'right') { + return `${prefixCls}-item-right`; + } + if (position === 'left') { + return `${prefixCls}-item-left`; + } return idx % 2 === 0 ? `${prefixCls}-item-left` : `${prefixCls}-item-right`; } - if (mode === 'left') return `${prefixCls}-item-left`; - if (mode === 'right') return `${prefixCls}-item-right`; - if (position === 'right') return `${prefixCls}-item-right`; + if (mode === 'left') { + return `${prefixCls}-item-left`; + } + if (mode === 'right') { + return `${prefixCls}-item-right`; + } + if (position === 'right') { + return `${prefixCls}-item-right`; + } return ''; }; const mergedItems = [...(items || [])]; diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index 68e2568f80..b0d74ca261 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -76,8 +76,9 @@ const Editable: React.FC = (props) => { const onKeyDown: React.KeyboardEventHandler = ({ keyCode }) => { // We don't record keyCode when IME is using - if (inComposition.current) return; - + if (inComposition.current) { + return; + } lastKeyCode.current = keyCode; }; diff --git a/docs/react/use-with-umi.en-US.md b/docs/react/use-with-umi.en-US.md index 5e1398ed41..96ef97494c 100644 --- a/docs/react/use-with-umi.en-US.md +++ b/docs/react/use-with-umi.en-US.md @@ -249,7 +249,9 @@ export default function Page() { queryClient.invalidateQueries({ queryKey: ['products'] }); }, }); - if (productsQuery.isLoading) return null; + if (productsQuery.isLoading) { + return null; + } return (

Page products

diff --git a/docs/react/use-with-umi.zh-CN.md b/docs/react/use-with-umi.zh-CN.md index c9526a07d8..66d2d5425d 100644 --- a/docs/react/use-with-umi.zh-CN.md +++ b/docs/react/use-with-umi.zh-CN.md @@ -249,7 +249,9 @@ export default function Page() { queryClient.invalidateQueries({ queryKey: ['products'] }); }, }); - if (productsQuery.isLoading) return null; + if (productsQuery.isLoading) { + return null; + } return (

Page products