From 77ea4038d169d033dcd4d29da1df9ab21b23ebb9 Mon Sep 17 00:00:00 2001 From: Tom Xu Date: Sat, 19 Nov 2022 13:47:33 +0800 Subject: [PATCH] chore: remo format and remove prettierrc arrowParens (#38722) --- .dumi/hooks/useMenu.tsx | 8 +- .../index/components/Theme/ColorPicker.tsx | 9 +- .../index/components/Theme/RadiusPicker.tsx | 4 +- .../index/components/Theme/ThemePicker.tsx | 2 +- .../pages/index/components/Theme/colorUtil.ts | 2 +- .dumi/pages/index/components/util.tsx | 6 +- .dumi/pages/theme-editor/index.tsx | 2 +- .../builtins/ComponentOverview/index.tsx | 20 ++-- .dumi/theme/builtins/IconSearch/Category.tsx | 4 +- .../builtins/IconSearch/IconPicSearcher.tsx | 24 ++-- .dumi/theme/builtins/IconSearch/fields.ts | 4 +- .dumi/theme/builtins/IconSearch/index.tsx | 16 +-- .../theme/builtins/IconSearch/themeIcons.tsx | 6 +- .dumi/theme/builtins/ImagePreview/index.jsx | 20 ++-- .../builtins/Previewer/fromDumiProps.tsx | 4 +- .dumi/theme/builtins/Previewer/index.jsx | 12 +- .../theme/builtins/ResourceArticles/index.tsx | 6 +- .dumi/theme/builtins/ResourceCards/index.tsx | 2 +- .dumi/theme/common/CodePenIcon.jsx | 2 +- .dumi/theme/common/CodePreview.jsx | 2 +- .dumi/theme/common/CodeSandboxIcon.jsx | 2 +- .../common/Color/ColorPaletteToolDark.jsx | 2 +- .dumi/theme/common/Color/ColorPalettes.jsx | 4 +- .dumi/theme/common/Color/Palette.jsx | 8 +- .dumi/theme/common/ExternalLinkIcon.jsx | 2 +- .dumi/theme/common/RiddleIcon.jsx | 2 +- .dumi/theme/layouts/DocLayout/index.tsx | 4 +- .dumi/theme/layouts/GlobalLayout.tsx | 2 +- .../layouts/ResourceLayout/AffixTabs.tsx | 4 +- .dumi/theme/slots/Header/More.tsx | 6 +- .dumi/theme/utils.tsx | 20 ++-- .prettierrc | 1 - components/__tests__/node.test.tsx | 6 +- components/_util/ActionButton.tsx | 2 +- components/_util/PurePanel.tsx | 2 +- components/_util/hooks/useForceUpdate.ts | 2 +- components/_util/hooks/usePatchElement.tsx | 4 +- components/_util/motion.tsx | 4 +- components/_util/placements.tsx | 2 +- components/_util/responsiveObserve.ts | 2 +- components/_util/transButton.tsx | 4 +- components/_util/wave/style.ts | 2 +- components/affix/__tests__/Affix.test.tsx | 16 +-- components/affix/demo/on-change.tsx | 2 +- components/affix/style/index.tsx | 2 +- components/affix/utils.ts | 16 +-- components/alert/index.tsx | 6 +- components/anchor/AnchorLink.tsx | 2 +- components/auto-complete/demo/options.tsx | 2 +- components/auto-complete/index.tsx | 2 +- components/avatar/SizeContext.tsx | 2 +- components/avatar/avatar.tsx | 4 +- components/avatar/group.tsx | 2 +- components/avatar/style/index.tsx | 6 +- components/badge/SingleNumber.tsx | 2 +- components/badge/demo/colorful.tsx | 2 +- components/badge/index.tsx | 2 +- .../breadcrumb/__tests__/router.test.tsx | 6 +- components/breadcrumb/demo/react-router.tsx | 2 +- .../button/__tests__/delay-timer.test.tsx | 4 +- components/button/__tests__/index.test.tsx | 2 +- components/button/__tests__/wave.test.tsx | 2 +- components/button/button-group.tsx | 2 +- components/button/button.tsx | 4 +- components/button/style/group.tsx | 2 +- components/calendar/Header.tsx | 4 +- components/calendar/__tests__/index.test.tsx | 5 +- components/calendar/demo/customize-header.tsx | 6 +- components/calendar/demo/notice-calendar.tsx | 2 +- components/calendar/generateCalendar.tsx | 4 +- components/calendar/style/index.tsx | 2 +- components/card/Card.tsx | 2 +- components/card/Meta.tsx | 2 +- components/card/demo/tabs.tsx | 4 +- components/carousel/__tests__/index.test.tsx | 2 +- components/carousel/style/index.tsx | 8 +- components/cascader/__tests__/index.test.tsx | 4 +- components/cascader/demo/custom-render.tsx | 2 +- components/cascader/demo/custom-trigger.tsx | 2 +- components/cascader/demo/search.tsx | 4 +- components/checkbox/Group.tsx | 14 +-- components/checkbox/__tests__/group.test.tsx | 6 +- components/collapse/Collapse.tsx | 2 +- components/collapse/CollapsePanel.tsx | 2 +- components/collapse/__tests__/index.test.tsx | 4 +- components/collapse/demo/extra.tsx | 2 +- components/config-provider/SizeContext.tsx | 2 +- .../__tests__/components.test.tsx | 106 +++++++++--------- .../__tests__/container.test.tsx | 8 +- .../config-provider/__tests__/icon.test.tsx | 2 +- .../config-provider/__tests__/memo.test.tsx | 4 +- components/config-provider/cssVariables.tsx | 16 +-- components/config-provider/demo/direction.tsx | 2 +- components/config-provider/demo/size.tsx | 2 +- .../date-picker/__tests__/DatePicker.test.tsx | 7 +- .../date-picker/__tests__/type.test.tsx | 8 +- components/date-picker/__tests__/utils.ts | 2 +- components/date-picker/demo/date-render.tsx | 4 +- components/date-picker/demo/disabled-date.tsx | 2 +- components/date-picker/demo/format.tsx | 4 +- .../date-picker/demo/select-in-range.tsx | 4 +- components/date-picker/demo/switchable.tsx | 2 +- .../generatePicker/generateRangePicker.tsx | 2 +- .../generatePicker/generateSinglePicker.tsx | 2 +- components/descriptions/Row.tsx | 2 +- .../descriptions/__tests__/index.test.tsx | 2 +- components/descriptions/demo/border.tsx | 3 +- components/descriptions/demo/size.tsx | 3 +- components/descriptions/demo/style.tsx | 4 +- components/descriptions/demo/text.tsx | 3 +- .../descriptions/demo/vertical-border.tsx | 3 +- components/descriptions/index.tsx | 4 +- components/descriptions/style/index.tsx | 2 +- components/divider/index.tsx | 2 +- components/divider/style/index.tsx | 2 +- .../drawer/__tests__/DrawerEvent.test.tsx | 2 +- components/drawer/demo/form-in-drawer.tsx | 2 +- components/drawer/demo/user-profile.tsx | 2 +- components/drawer/index.tsx | 2 +- components/dropdown/__tests__/index.test.tsx | 4 +- components/dropdown/demo/basic.tsx | 2 +- components/dropdown/demo/custom-dropdown.tsx | 4 +- components/dropdown/demo/deprecated.tsx | 2 +- components/dropdown/demo/dropdown-button.tsx | 2 +- components/dropdown/demo/event.tsx | 2 +- components/dropdown/demo/item.tsx | 2 +- components/dropdown/demo/loading.tsx | 4 +- components/dropdown/demo/menu-full.tsx | 2 +- components/dropdown/demo/overlay-open.tsx | 4 +- components/dropdown/demo/sub-menu.tsx | 2 +- components/dropdown/demo/trigger.tsx | 2 +- components/dropdown/style/button.tsx | 2 +- components/dropdown/style/status.tsx | 2 +- components/empty/demo/basic.tsx | 4 +- components/empty/demo/config-provider.tsx | 2 +- components/empty/demo/description.tsx | 4 +- components/empty/demo/simple.tsx | 4 +- components/empty/style/index.tsx | 2 +- .../float-button/FloatButtonContent.tsx | 2 +- components/form/ErrorList.tsx | 4 +- components/form/FormItemInput.tsx | 2 +- components/form/FormList.tsx | 2 +- .../form/__tests__/list-noStyle.test.tsx | 2 +- components/form/__tests__/list.test.tsx | 12 +- components/form/__tests__/ref.test.tsx | 4 +- components/form/__tests__/type.test.tsx | 4 +- components/form/context.tsx | 2 +- components/form/demo/disabled.tsx | 5 +- .../form/demo/dynamic-form-items-complex.tsx | 4 +- .../form/demo/dynamic-form-items-no-style.tsx | 2 +- components/form/demo/form-context.tsx | 2 +- components/form/demo/form-in-modal.tsx | 4 +- components/form/demo/global-state.tsx | 2 +- components/form/demo/ref-item.tsx | 4 +- components/form/demo/register.tsx | 4 +- components/form/hooks/useFrameState.ts | 4 +- components/form/style/index.tsx | 12 +- components/grid/__tests__/index.test.tsx | 16 +-- components/grid/col.tsx | 2 +- components/grid/demo/flex-align.tsx | 2 +- components/grid/demo/playground.tsx | 6 +- components/grid/demo/useBreakpoint.tsx | 4 +- components/grid/hooks/useBreakpoint.tsx | 2 +- components/grid/row.tsx | 2 +- components/grid/style/index.tsx | 4 +- components/image/demo/controlled-preview.tsx | 4 +- .../image/demo/preview-group-top-progress.tsx | 4 +- .../image/demo/preview-group-visible.tsx | 2 +- components/image/style/index.tsx | 6 +- components/input-number/demo/debug-token.tsx | 4 +- components/input-number/demo/formatter.tsx | 8 +- components/input/ClearableLabeledInput.tsx | 4 +- components/input/Group.tsx | 2 +- components/input/Password.tsx | 2 +- components/input/TextArea.tsx | 4 +- components/input/__tests__/index.test.tsx | 12 +- components/input/__tests__/textarea.test.tsx | 14 +-- components/input/demo/autosize-textarea.tsx | 2 +- components/input/demo/password-input.tsx | 4 +- components/layout/demo/responsive.tsx | 2 +- components/layout/demo/side.tsx | 2 +- components/layout/demo/top-side-2.tsx | 2 +- components/layout/demo/top-side.tsx | 2 +- components/layout/layout.tsx | 4 +- components/layout/style/index.tsx | 6 +- components/layout/style/light.ts | 2 +- components/list/__tests__/index.test.tsx | 2 +- components/list/__tests__/pagination.test.tsx | 2 +- components/list/demo/basic.tsx | 2 +- components/list/demo/grid-test.tsx | 2 +- components/list/demo/grid.tsx | 2 +- components/list/demo/infinite-load.tsx | 6 +- components/list/demo/loadmore.tsx | 10 +- components/list/demo/responsive.tsx | 2 +- components/list/demo/simple.tsx | 6 +- components/list/demo/vertical.tsx | 4 +- components/list/demo/virtual-list.tsx | 4 +- components/list/style/index.tsx | 4 +- .../locale-provider/__tests__/index.test.tsx | 4 +- components/locale-provider/index.tsx | 2 +- components/mentions/demo/async.tsx | 2 +- components/mentions/demo/prefix.tsx | 2 +- components/mentions/demo/readonly.tsx | 2 +- components/mentions/index.tsx | 2 +- components/mentions/style/index.tsx | 6 +- components/menu/__tests__/index.test.tsx | 24 ++-- components/menu/demo/horizontal.tsx | 2 +- components/menu/demo/inline.tsx | 2 +- components/menu/demo/sider-current.tsx | 4 +- components/menu/demo/style-debug.tsx | 6 +- components/menu/demo/submenu-theme.tsx | 2 +- components/menu/demo/theme.tsx | 2 +- components/menu/demo/vertical.tsx | 2 +- components/menu/hooks/useItems.tsx | 2 +- components/menu/index.tsx | 2 +- components/menu/style/horizontal.tsx | 2 +- components/message/__tests__/hooks.test.tsx | 8 +- components/message/__tests__/util.ts | 2 +- components/message/demo/render-panel.tsx | 4 +- components/message/style/index.tsx | 6 +- components/message/useMessage.tsx | 4 +- components/message/util.ts | 2 +- components/modal/ConfirmDialog.tsx | 2 +- components/modal/PurePanel.tsx | 2 +- components/modal/__tests__/confirm.test.tsx | 40 +++---- components/modal/__tests__/hook.test.tsx | 8 +- components/modal/confirm.tsx | 2 +- components/modal/demo/dark.tsx | 24 ++-- components/modal/demo/hooks.tsx | 4 +- components/modal/demo/modal-render.tsx | 2 +- components/modal/useModal/HookModal.tsx | 6 +- .../notification/__tests__/hooks.test.tsx | 4 +- .../notification/__tests__/index.test.tsx | 12 +- .../notification/__tests__/placement.test.tsx | 2 +- components/notification/__tests__/util.ts | 2 +- components/notification/demo/render-panel.tsx | 4 +- components/notification/style/placement.ts | 2 +- components/notification/useNotification.tsx | 4 +- components/pagination/Pagination.tsx | 2 +- components/pagination/Select.tsx | 4 +- components/pagination/demo/all.tsx | 2 +- components/pagination/demo/controlled.tsx | 2 +- components/pagination/demo/jump.tsx | 2 +- components/pagination/demo/mini.tsx | 2 +- components/pagination/demo/total.tsx | 2 +- components/popconfirm/PurePanel.tsx | 4 +- .../popconfirm/__tests__/index.test.tsx | 4 +- components/popconfirm/demo/promise.tsx | 2 +- components/popconfirm/style/index.tsx | 6 +- components/popover/style/index.tsx | 8 +- components/progress/Circle.tsx | 2 +- components/progress/Line.tsx | 4 +- components/progress/Steps.tsx | 2 +- components/progress/demo/circle-micro.tsx | 2 +- components/progress/demo/format.tsx | 2 +- components/progress/style/index.tsx | 6 +- components/radio/__tests__/group.test.tsx | 8 +- .../radio/__tests__/radio-button.test.tsx | 4 +- components/radio/group.tsx | 2 +- components/result/style/index.tsx | 8 +- components/segmented/__tests__/index.test.tsx | 18 +-- components/segmented/demo/basic.tsx | 4 +- components/segmented/demo/block.tsx | 4 +- components/segmented/demo/controlled-two.tsx | 2 +- components/segmented/demo/custom.tsx | 4 +- components/segmented/demo/disabled.tsx | 4 +- components/segmented/demo/icon-only.tsx | 4 +- components/segmented/demo/size-consistent.tsx | 4 +- components/segmented/demo/size.tsx | 4 +- components/segmented/demo/with-icon.tsx | 4 +- components/segmented/index.tsx | 2 +- components/select/__tests__/index.test.tsx | 2 +- components/select/demo/coordinate.tsx | 4 +- .../select/demo/custom-dropdown-menu.tsx | 4 +- components/select/demo/hide-selected.tsx | 4 +- components/select/demo/search-box.tsx | 4 +- components/select/demo/select-users.tsx | 8 +- components/select/style/dropdown.tsx | 4 +- components/skeleton/Avatar.tsx | 2 +- components/skeleton/Button.tsx | 2 +- components/skeleton/Element.tsx | 2 +- components/skeleton/Image.tsx | 2 +- components/skeleton/Input.tsx | 2 +- components/skeleton/Node.tsx | 2 +- components/skeleton/Paragraph.tsx | 2 +- components/skeleton/Skeleton.tsx | 2 +- components/skeleton/demo/list.tsx | 2 +- components/slider/__tests__/index.test.tsx | 6 +- components/slider/demo/icon-slider.tsx | 2 +- components/space/Compact.tsx | 2 +- components/space/__tests__/index.test.tsx | 2 +- .../space/__tests__/space-compact.test.tsx | 2 +- components/space/demo/customize.tsx | 2 +- components/space/demo/size.tsx | 2 +- components/space/index.tsx | 4 +- components/space/style/compact.tsx | 2 +- components/space/style/index.tsx | 4 +- components/spin/index.tsx | 4 +- components/spin/style/index.tsx | 2 +- components/statistic/Countdown.tsx | 2 +- components/statistic/Number.tsx | 2 +- components/statistic/Statistic.tsx | 2 +- components/statistic/style/index.tsx | 2 +- components/statistic/utils.tsx | 2 +- components/steps/demo/inline.tsx | 2 +- components/steps/demo/step-next.tsx | 2 +- components/steps/demo/steps-in-steps.tsx | 2 +- components/steps/style/custom-icon.ts | 2 +- components/steps/style/index.tsx | 8 +- components/steps/style/label-placement.ts | 2 +- components/steps/style/nav.ts | 2 +- components/steps/style/progress-dot.ts | 2 +- components/steps/style/progress.ts | 2 +- components/steps/style/rtl.ts | 2 +- components/steps/style/small.ts | 2 +- components/steps/style/vertical.ts | 2 +- components/steps/useLegacyItems.ts | 2 +- components/style/motion/collapse.tsx | 2 +- components/style/placementArrow.tsx | 2 +- components/table/ExpandIcon.tsx | 2 +- components/table/Table.tsx | 12 +- .../table/__tests__/Table.filter.test.tsx | 26 ++--- .../table/__tests__/Table.order.test.tsx | 2 +- .../__tests__/Table.rowSelection.test.tsx | 40 +++---- components/table/__tests__/Table.test.tsx | 10 +- components/table/demo/ajax.tsx | 6 +- components/table/demo/basic.tsx | 4 +- components/table/demo/bordered.tsx | 2 +- components/table/demo/colspan-rowspan.tsx | 2 +- components/table/demo/custom-filter-panel.tsx | 8 +- components/table/demo/drag-sorting.tsx | 4 +- components/table/demo/dynamic-settings.tsx | 6 +- components/table/demo/edit-cell.tsx | 6 +- components/table/demo/edit-row.tsx | 4 +- .../table/demo/ellipsis-custom-tooltip.tsx | 10 +- components/table/demo/ellipsis.tsx | 2 +- components/table/demo/expand.tsx | 4 +- components/table/demo/jsx.tsx | 2 +- .../table/demo/nest-table-border-debug.tsx | 4 +- components/table/demo/order-column.tsx | 2 +- components/table/demo/pagination.tsx | 8 +- components/table/demo/resizable-column.tsx | 5 +- components/table/demo/responsive.tsx | 2 +- .../table/demo/row-selection-custom.tsx | 4 +- components/table/demo/summary.tsx | 2 +- components/table/demo/virtual-list.tsx | 2 +- .../table/hooks/useFilter/FilterDropdown.tsx | 12 +- components/table/hooks/useFilter/index.tsx | 8 +- components/table/hooks/usePagination.ts | 6 +- components/table/hooks/useSelection.tsx | 50 ++++----- components/table/hooks/useSorter.tsx | 6 +- components/table/hooks/useTitleColumns.tsx | 2 +- components/table/style/bordered.tsx | 2 +- components/table/style/ellipsis.tsx | 2 +- components/table/style/empty.tsx | 2 +- components/table/style/expand.tsx | 2 +- components/table/style/filter.tsx | 2 +- components/table/style/fixed.tsx | 2 +- components/table/style/index.tsx | 4 +- components/table/style/pagination.tsx | 2 +- components/table/style/radius.tsx | 2 +- components/table/style/rtl.tsx | 2 +- components/table/style/selection.tsx | 2 +- components/table/style/size.tsx | 2 +- components/table/style/sorter.tsx | 2 +- components/table/style/sticky.tsx | 2 +- components/table/style/summary.tsx | 2 +- components/tabs/demo/custom-add-trigger.tsx | 4 +- components/tabs/demo/custom-tab-bar-node.tsx | 10 +- components/tabs/demo/editable-card.tsx | 2 +- components/tabs/demo/extra.tsx | 2 +- components/tabs/demo/nest.tsx | 12 +- components/tabs/hooks/useLegacyItems.ts | 2 +- components/tabs/index.tsx | 2 +- components/tabs/style/index.tsx | 4 +- components/tabs/style/motion.tsx | 2 +- components/tag/demo/animation.tsx | 6 +- components/tag/demo/checkable.tsx | 8 +- components/tag/demo/control.tsx | 4 +- components/theme/themes/compact/index.ts | 4 +- .../theme/themes/shared/genCommonMapToken.ts | 4 +- .../theme/themes/shared/genFontSizes.ts | 2 +- components/theme/util/alias.ts | 2 +- components/theme/util/statistic.ts | 4 +- components/timeline/__tests__/index.test.tsx | 2 +- components/timeline/style/index.tsx | 4 +- components/tooltip/__tests__/tooltip.test.tsx | 2 +- .../tooltip/demo/auto-adjust-overflow.tsx | 4 +- components/tooltip/demo/colorful.tsx | 4 +- components/tooltip/index.tsx | 4 +- components/tooltip/style/index.tsx | 6 +- components/tour/PurePanel.tsx | 2 +- components/tour/index.tsx | 2 +- components/tour/panelRender.tsx | 2 +- components/transfer/ListItem.tsx | 2 +- .../transfer/__tests__/customize.test.tsx | 2 +- components/transfer/__tests__/index.test.tsx | 26 ++--- components/transfer/__tests__/search.test.tsx | 4 +- components/transfer/demo/advanced.tsx | 6 +- components/transfer/demo/basic.tsx | 4 +- .../demo/custom-select-all-labels.tsx | 4 +- components/transfer/demo/large-data.tsx | 2 +- components/transfer/demo/oneWay.tsx | 4 +- components/transfer/demo/search.tsx | 2 +- components/transfer/demo/table-transfer.tsx | 10 +- components/transfer/demo/tree-transfer.tsx | 4 +- components/transfer/index.tsx | 22 ++-- components/transfer/list.tsx | 18 +-- components/transfer/style/index.tsx | 2 +- components/tree-select/demo/async.tsx | 2 +- components/tree-select/style/index.tsx | 4 +- components/tree/__tests__/directory.test.tsx | 2 +- components/tree/__tests__/index.test.tsx | 2 +- components/tree/demo/drag-debug.tsx | 14 +-- components/tree/demo/draggable.tsx | 8 +- components/tree/demo/dynamic.tsx | 6 +- components/tree/demo/search.tsx | 6 +- components/typography/Base/Ellipsis.tsx | 2 +- .../typography/__tests__/index.test.tsx | 10 +- components/typography/demo/interactive.tsx | 2 +- .../typography/demo/paragraph-debug.tsx | 3 +- components/typography/demo/suffix.tsx | 2 +- components/typography/style/mixins.tsx | 10 +- components/upload/Upload.tsx | 20 ++-- components/upload/UploadList/ListItem.tsx | 10 +- components/upload/UploadList/index.tsx | 4 +- components/upload/__tests__/type.test.tsx | 6 +- components/upload/__tests__/upload.test.tsx | 32 +++--- components/upload/demo/avatar.tsx | 2 +- components/upload/demo/crop-image.tsx | 2 +- .../upload/demo/customize-progress-bar.tsx | 2 +- components/upload/demo/drag-sorting.tsx | 4 +- components/upload/demo/file-type.tsx | 4 +- components/upload/demo/fileList.tsx | 4 +- components/upload/demo/picture-card.tsx | 2 +- components/upload/demo/preview-file.tsx | 2 +- components/upload/demo/transform-file.tsx | 4 +- .../upload/demo/upload-custom-action-icon.tsx | 2 +- components/upload/demo/upload-manually.tsx | 8 +- components/upload/demo/upload-png-only.tsx | 4 +- .../upload/demo/upload-with-aliyun-oss.tsx | 6 +- components/upload/style/dragger.tsx | 2 +- components/upload/style/index.tsx | 4 +- components/upload/style/list.tsx | 2 +- components/upload/style/motion.tsx | 2 +- components/upload/style/picture.tsx | 4 +- components/upload/style/rtl.tsx | 2 +- components/upload/utils.tsx | 6 +- index-style-only.js | 2 +- index-with-locales.js | 2 +- scripts/argos-upload.js | 4 +- scripts/check-ts-demo.js | 4 +- scripts/collect-token-statistic.js | 2 +- scripts/css-variable-sync.js | 6 +- scripts/generate-authors.js | 2 +- scripts/generateLegacyLocale.js | 2 +- scripts/tmp-mv-dumi-site.js | 2 +- scripts/update-rc.js | 2 +- tests/setup.js | 2 +- tests/setupAfterEnv.ts | 10 +- tests/shared/demoTest.tsx | 4 +- tests/shared/imageTest.tsx | 4 +- tests/utils.tsx | 4 +- webpack.config.js | 2 +- 464 files changed, 1113 insertions(+), 1086 deletions(-) diff --git a/.dumi/hooks/useMenu.tsx b/.dumi/hooks/useMenu.tsx index a537adac3b..0c5bbc8928 100644 --- a/.dumi/hooks/useMenu.tsx +++ b/.dumi/hooks/useMenu.tsx @@ -58,7 +58,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => }, {}); const childItems = []; childItems.push( - ...childrenGroup.default.map(item => ({ + ...childrenGroup.default.map((item) => ({ label: ( {before} @@ -75,7 +75,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => type: 'group', label: type, key: type, - children: children?.map(item => ({ + children: children?.map((item) => ({ label: ( {before} @@ -98,7 +98,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => type: 'group', label: group.title, key: group.title, - children: group.children?.map(item => ({ + children: group.children?.map((item) => ({ label: ( {before} @@ -115,7 +115,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => } } else { result.push( - ...group.children?.map(item => ({ + ...group.children?.map((item) => ({ label: ( {before} diff --git a/.dumi/pages/index/components/Theme/ColorPicker.tsx b/.dumi/pages/index/components/Theme/ColorPicker.tsx index 2d8479f6f0..c35fa8524e 100644 --- a/.dumi/pages/index/components/Theme/ColorPicker.tsx +++ b/.dumi/pages/index/components/Theme/ColorPicker.tsx @@ -54,7 +54,7 @@ export default function ColorPicker({ value, onChange }: RadiusPickerProps) { const valueStr = new TinyColor(value).toRgbString(); let existActive = false; - const colors = PRESET_COLORS.map(color => { + const colors = PRESET_COLORS.map((color) => { const colorStr = new TinyColor(color).toRgbString(); const active = colorStr === valueStr; existActive = existActive || active; @@ -80,7 +80,7 @@ export default function ColorPicker({ value, onChange }: RadiusPickerProps) { { + onChange={(event) => { onChange?.(event.target.value); }} style={{ width: 120 }} @@ -109,7 +109,10 @@ export default function ColorPicker({ value, onChange }: RadiusPickerProps) { key={color} overlayInnerStyle={{ padding: 0 }} content={ - onChange?.(color)} /> + onChange?.(color)} + /> } trigger="click" showArrow={false} diff --git a/.dumi/pages/index/components/Theme/RadiusPicker.tsx b/.dumi/pages/index/components/Theme/RadiusPicker.tsx index 73999de985..589938130f 100644 --- a/.dumi/pages/index/components/Theme/RadiusPicker.tsx +++ b/.dumi/pages/index/components/Theme/RadiusPicker.tsx @@ -14,8 +14,8 @@ export default function RadiusPicker({ value, onChange }: RadiusPickerProps) { onChange={onChange} style={{ width: 120 }} min={0} - formatter={val => `${val}px`} - parser={str => (str ? parseFloat(str) : (str as any))} + formatter={(val) => `${val}px`} + parser={(str) => (str ? parseFloat(str) : (str as any))} /> - {Object.keys(THEMES).map(theme => { + {Object.keys(THEMES).map((theme) => { const url = THEMES[theme as THEME]; return ( diff --git a/.dumi/pages/index/components/Theme/colorUtil.ts b/.dumi/pages/index/components/Theme/colorUtil.ts index 042e52ffcc..90d5f376cb 100644 --- a/.dumi/pages/index/components/Theme/colorUtil.ts +++ b/.dumi/pages/index/components/Theme/colorUtil.ts @@ -73,7 +73,7 @@ export function getAvatarURL(color?: string | null) { } return ( - COLOR_IMAGES.find(obj => obj.color === closestColor)?.url || + COLOR_IMAGES.find((obj) => obj.color === closestColor)?.url || 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*CLp0Qqc11AkAAAAAAAAAAAAAARQnAQ' ); } diff --git a/.dumi/pages/index/components/util.tsx b/.dumi/pages/index/components/util.tsx index d7fb6410fb..e2f9cfef28 100644 --- a/.dumi/pages/index/components/util.tsx +++ b/.dumi/pages/index/components/util.tsx @@ -72,7 +72,7 @@ export function preLoad(list: string[]) { const div = document.createElement('div'); div.style.display = 'none'; document.body.appendChild(div); - list.forEach(src => { + list.forEach((src) => { const img = new Image(); img.src = src; div.appendChild(img); @@ -88,8 +88,8 @@ export function useSiteData(): [Partial, boolean] { if (Object.keys(data ?? {}).length === 0 && typeof fetch !== 'undefined') { setLoading(true); fetch(`https://render.alipay.com/p/h5data/antd4-config_website-h5data.json`) - .then(res => res.json()) - .then(result => { + .then((res) => res.json()) + .then((result) => { setData(result); setLoading(false); }); diff --git a/.dumi/pages/theme-editor/index.tsx b/.dumi/pages/theme-editor/index.tsx index 35d1e25ad2..3e812826f6 100644 --- a/.dumi/pages/theme-editor/index.tsx +++ b/.dumi/pages/theme-editor/index.tsx @@ -24,7 +24,7 @@ const CustomTheme = () => { theme={{ name: 'test', key: 'test', config: theme }} simple style={{ height: 'calc(100vh - 64px)' }} - onThemeChange={newTheme => { + onThemeChange={(newTheme) => { setTheme(newTheme.config); }} /> diff --git a/.dumi/theme/builtins/ComponentOverview/index.tsx b/.dumi/theme/builtins/ComponentOverview/index.tsx index f20464eecd..94bb7e7237 100644 --- a/.dumi/theme/builtins/ComponentOverview/index.tsx +++ b/.dumi/theme/builtins/ComponentOverview/index.tsx @@ -68,7 +68,7 @@ const onClickCard = (pathname: string) => { } }; -const reportSearch = debounce<(value: string) => void>(value => { +const reportSearch = debounce<(value: string) => void>((value) => { if (window.gtag) { window.gtag('event', '搜索', { event_category: '组件总览卡片', @@ -91,7 +91,7 @@ const Overview: React.FC = () => { const sectionRef = React.useRef(null); - const onKeyDown: React.KeyboardEventHandler = event => { + const onKeyDown: React.KeyboardEventHandler = (event) => { if (event.keyCode === 13 && search.trim().length) { sectionRef.current?.querySelector('.components-overview-card')?.click(); } @@ -99,11 +99,11 @@ const Overview: React.FC = () => { const groups = useMemo<{ title: string; children: Component[] }[]>(() => { return data - .filter(item => item.title) - .map<{ title: string; children: Component[] }>(item => { + .filter((item) => item.title) + .map<{ title: string; children: Component[] }>((item) => { return { title: item.title!, - children: item.children.map(child => ({ + children: item.children.map((child) => ({ title: child.frontmatter.title, subtitle: child.frontmatter.subtitle, cover: child.frontmatter.cover, @@ -126,7 +126,7 @@ const Overview: React.FC = () => { value={search} placeholder={formatMessage({ id: 'app.components.overview.search' })} css={style.componentsOverviewSearch} - onChange={e => { + onChange={(e) => { setSearch(e.target.value); reportSearch(e.target.value); }} @@ -136,10 +136,10 @@ const Overview: React.FC = () => { /> {groups - .filter(i => i.title) - .map(group => { + .filter((i) => i.title) + .map((group) => { const components = group?.children?.filter( - component => + (component) => !search.trim() || component.title.toLowerCase().includes(search.trim().toLowerCase()) || (component?.subtitle || '').toLowerCase().includes(search.trim().toLowerCase()), @@ -153,7 +153,7 @@ const Overview: React.FC = () => { - {components.map(component => { + {components.map((component) => { const url = `${component.link}/`; /** Link 不能跳转到外链 */ diff --git a/.dumi/theme/builtins/IconSearch/Category.tsx b/.dumi/theme/builtins/IconSearch/Category.tsx index 06813736a7..f697fa01a6 100644 --- a/.dumi/theme/builtins/IconSearch/Category.tsx +++ b/.dumi/theme/builtins/IconSearch/Category.tsx @@ -12,7 +12,7 @@ interface CategoryProps { newIcons: string[]; } -const Category: React.FC = props => { +const Category: React.FC = (props) => { const { icons, title, newIcons, theme } = props; const intl = useIntl(); const [justCopied, setJustCopied] = React.useState(null); @@ -40,7 +40,7 @@ const Category: React.FC = props => {

{intl.formatMessage({ id: `app.docs.components.icon.category.${title}` })}