From 863f61d908a182496b954cfe6827307393570863 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 03:30:19 +0800 Subject: [PATCH] chore(deps): update dependency eslint to v9 (#50690) Co-authored-by: afc163 --- .depslintrc.js | 6 +- .dumi/hooks/useThemeAnimation.ts | 2 +- .dumi/loading.js | 2 +- .../index/components/BannerRecommends.tsx | 4 +- .../index/components/Theme/ColorPicker.tsx | 1 - .../index/components/Theme/ThemePicker.tsx | 1 - .dumi/pages/index/components/Theme/index.tsx | 1 + .dumi/rehypeAntd.ts | 2 +- .dumi/scripts/mirror-modal.js | 8 +- .dumi/theme/SiteThemeProvider.tsx | 1 - .../theme/builtins/IconSearch/IconSearch.tsx | 2 +- .dumi/theme/builtins/IconSearch/index.tsx | 16 +- .../theme/builtins/ResourceArticles/index.tsx | 1 - .../ComponentChangelog/ComponentChangelog.tsx | 1 - .dumi/theme/common/ThemeSwitch/ThemeIcon.tsx | 30 ++- .dumi/theme/plugin.ts | 1 - .dumi/theme/slots/Header/index.tsx | 1 - .eslintignore | 24 -- .eslintrc.js | 231 ------------------ .github/dependabot.yml | 34 +-- .github/workflows/issue-check-inactive.yml | 4 +- .github/workflows/issue-close-require.yml | 8 +- .github/workflows/issue-labeled.yml | 8 +- .github/workflows/issue-open-check.yml | 12 +- .github/workflows/issue-remove-inactive.yml | 2 +- .github/workflows/issue-schedule.yml | 2 +- .github/workflows/mock-project-build.yml | 4 +- .github/workflows/pr-check-ci.yml | 8 +- .github/workflows/pr-check-merge.yml | 2 +- .github/workflows/pr-contributor-welcome.yml | 2 +- .github/workflows/pr-open-check.yml | 4 +- .github/workflows/preview-build.yml | 2 +- .github/workflows/preview-deploy.yml | 6 +- .github/workflows/preview-start.yml | 2 +- .github/workflows/release-dingtalk.yml | 10 +- .github/workflows/site-deploy.yml | 4 +- .github/workflows/size-limit.yml | 2 +- .github/workflows/test.yml | 14 +- .github/workflows/verify-files-modify.yml | 14 +- .github/workflows/verify-package-version.yml | 2 +- .../visual-regression-diff-build.yml | 4 +- .../visual-regression-diff-finish.yml | 6 +- .../visual-regression-diff-start.yml | 2 +- .../visual-regression-persist-finish.yml | 2 +- .../visual-regression-persist-start.yml | 2 +- .lintstagedrc.json | 2 +- .npmrc | 3 +- alias/cssinjs.js | 4 +- components/__tests__/node.test.tsx | 4 +- components/_util/__tests__/type.test.tsx | 4 - components/_util/__tests__/util.test.tsx | 1 - components/_util/__tests__/wave.test.tsx | 1 - components/_util/easings.ts | 1 - components/_util/motion.ts | 5 +- components/_util/placements.ts | 1 - components/_util/statusUtils.ts | 6 +- components/_util/warning.ts | 1 - components/alert/Alert.tsx | 1 - components/alert/__tests__/index.test.tsx | 1 - .../auto-complete/__tests__/index.test.tsx | 4 +- components/button/__tests__/index.test.tsx | 2 - components/button/button.tsx | 1 - components/button/buttonHelpers.tsx | 27 +- components/calendar/__tests__/index.test.tsx | 6 +- components/carousel/__tests__/index.test.tsx | 1 - components/checkbox/Checkbox.tsx | 2 +- components/collapse/__tests__/index.test.tsx | 1 - components/color-picker/color.ts | 3 +- .../config-provider/__tests__/nonce.test.tsx | 1 - components/config-provider/cssVariables.ts | 2 - components/config-provider/style/index.ts | 1 - components/date-picker/demo/disabled-date.tsx | 1 - .../design/demo/date-extra-info.tsx | 4 +- .../date-picker/generatePicker/interface.ts | 5 +- .../descriptions/__tests__/index.test.tsx | 4 - components/drawer/index.tsx | 5 +- components/dropdown/dropdown.tsx | 5 +- components/float-button/FloatButton.tsx | 1 - components/form/FormItem/index.tsx | 5 +- components/form/__tests__/index.test.tsx | 5 +- components/form/__tests__/list.test.tsx | 2 +- components/form/demo/nest-messages.tsx | 2 - components/grid/row.tsx | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 8 - .../__tests__/__snapshots__/demo.test.ts.snap | 8 - components/input-number/index.tsx | 2 +- components/input/__tests__/index.test.tsx | 1 - components/input/utils.ts | 1 - components/locale/__tests__/index.test.tsx | 1 - components/locale/ar_EG.ts | 1 - components/locale/az_AZ.ts | 1 - components/locale/bn_BD.ts | 1 - components/locale/by_BY.ts | 1 - components/locale/ca_ES.ts | 1 - components/locale/cs_CZ.ts | 1 - components/locale/de_DE.ts | 1 - components/locale/en_GB.ts | 1 - components/locale/en_US.ts | 1 - components/locale/es_ES.ts | 1 - components/locale/et_EE.ts | 1 - components/locale/eu_ES.ts | 1 - components/locale/fa_IR.ts | 1 - components/locale/fr_BE.ts | 1 - components/locale/fr_CA.ts | 1 - components/locale/fr_FR.ts | 1 - components/locale/ga_IE.ts | 1 - components/locale/gl_ES.ts | 1 - components/locale/he_IL.ts | 1 - components/locale/hi_IN.ts | 1 - components/locale/hr_HR.ts | 1 - components/locale/id_ID.ts | 1 - components/locale/it_IT.ts | 1 - components/locale/ja_JP.ts | 1 - components/locale/ka_GE.ts | 1 - components/locale/kk_KZ.ts | 2 - components/locale/km_KH.ts | 1 - components/locale/ko_KR.ts | 1 - components/locale/lt_LT.ts | 1 - components/locale/ml_IN.ts | 1 - components/locale/ms_MY.ts | 1 - components/locale/my_MM.ts | 1 - components/locale/nb_NO.ts | 1 - components/locale/nl_BE.ts | 1 - components/locale/nl_NL.ts | 1 - components/locale/pl_PL.ts | 1 - components/locale/pt_BR.ts | 1 - components/locale/pt_PT.ts | 1 - components/locale/ro_RO.ts | 1 - components/locale/ru_RU.ts | 2 - components/locale/si_LK.ts | 1 - components/locale/sk_SK.ts | 1 - components/locale/sr_RS.ts | 1 - components/locale/sv_SE.ts | 1 - components/locale/th_TH.ts | 1 - components/locale/tk_TK.ts | 1 - components/locale/tr_TR.ts | 1 - components/locale/uk_UA.ts | 1 - components/locale/ur_PK.ts | 1 - components/locale/uz_UZ.ts | 2 - components/locale/zh_CN.ts | 1 - components/locale/zh_HK.ts | 1 - components/locale/zh_TW.ts | 1 - components/mentions/index.tsx | 3 +- components/menu/__tests__/index.test.tsx | 3 - components/message/__tests__/hooks.test.tsx | 1 - components/message/__tests__/util.ts | 1 - components/modal/PurePanel.tsx | 2 - components/modal/__tests__/confirm.test.tsx | 4 +- components/modal/__tests__/hook.test.tsx | 3 +- components/modal/confirm.tsx | 2 - components/modal/useModal/index.tsx | 1 - .../notification/__tests__/config.test.tsx | 2 - components/notification/__tests__/util.ts | 1 - components/notification/demo/stack.tsx | 2 +- components/notification/index.tsx | 1 - components/radio/radio.tsx | 2 +- components/skeleton/Paragraph.tsx | 2 +- components/space/__tests__/index.test.tsx | 3 - .../space/__tests__/space-compact.test.tsx | 1 - components/spin/index.tsx | 5 +- components/steps/__tests__/index.test.tsx | 3 +- components/style/compact-item-vertical.ts | 1 - components/style/compact-item.ts | 1 - components/style/index.tsx | 1 - components/style/motion/motion.ts | 1 - components/style/operationUnit.ts | 1 - components/style/roundedArrow.ts | 1 - components/table/Column.ts | 2 +- components/table/ColumnGroup.ts | 2 +- .../table/__tests__/Table.expand.test.tsx | 1 - .../table/__tests__/Table.filter.test.tsx | 3 - .../table/__tests__/Table.pagination.test.tsx | 1 - .../table/__tests__/Table.sorter.test.tsx | 1 - components/table/__tests__/Table.test.tsx | 1 - components/table/hooks/useLazyKVMap.ts | 2 - components/table/interface.ts | 6 +- components/table/util.ts | 2 - components/theme/index.tsx | 1 - components/theme/util/genPresetColor.ts | 1 - components/timeline/TimelineItem.tsx | 2 +- components/timeline/TimelineItemList.tsx | 1 - components/tooltip/__tests__/util.ts | 1 - components/tooltip/util.ts | 2 - components/tour/__tests__/index.test.tsx | 1 - components/tree/demo/drag-debug.tsx | 1 - .../__tests__/enter-key-callback.test.tsx | 33 --- .../typography/__tests__/index.test.tsx | 31 ++- components/typography/style/mixins.ts | 2 - components/upload/__tests__/dragger.test.tsx | 1 - components/upload/__tests__/upload.test.tsx | 4 +- eslint.config.mjs | 138 +++++++++++ package.json | 78 ++---- scripts/check-cssinjs.tsx | 1 - scripts/check-repo.ts | 1 - scripts/check-site.ts | 6 +- scripts/check-version-md.ts | 1 - scripts/collect-token-statistic.ts | 1 - scripts/generate-component-changelog.ts | 1 - scripts/generate-token-meta.ts | 3 +- scripts/post-publish.ts | 2 - scripts/pre-publish.ts | 1 - scripts/print-changelog.ts | 2 - scripts/tsconfig.json | 24 +- scripts/visual-regression/build.ts | 2 - scripts/visual-regression/convert.ts | 2 - scripts/visual-regression/upload.js | 5 +- tests/changelog.test.ts | 1 - tests/dekko/dist.test.js | 1 - tests/dekko/lib-es.test.js | 2 - tests/dekko/use-client.test.js | 1 - tests/index.test.ts | 5 - tests/setup.ts | 3 - tests/shared/demoTest.tsx | 5 +- tests/shared/demoTestContext.ts | 1 - tests/shared/excludeWarning.ts | 1 - tests/shared/imageTest.tsx | 1 - tests/shared/rootPropsTest.tsx | 3 +- tests/utils.tsx | 1 - tsconfig.json | 26 +- 219 files changed, 406 insertions(+), 776 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js delete mode 100644 components/typography/__tests__/enter-key-callback.test.tsx create mode 100644 eslint.config.mjs diff --git a/.depslintrc.js b/.depslintrc.js index e763e9d5ed..122f41fd75 100644 --- a/.depslintrc.js +++ b/.depslintrc.js @@ -11,15 +11,15 @@ module.exports = { ], modulePattern: [ { - pattern: /ConfigContext.*renderEmpty/ms, + pattern: /ConfigContext.*renderEmpty/s, module: '../empty', }, { - pattern: /ConfigConsumer.*renderEmpty/ms, + pattern: /ConfigConsumer.*renderEmpty/s, module: '../empty', }, { - pattern: /config-provider\/context.*renderEmpty/ms, + pattern: /config-provider\/context.*renderEmpty/s, module: '../empty', }, ], diff --git a/.dumi/hooks/useThemeAnimation.ts b/.dumi/hooks/useThemeAnimation.ts index 9e0f421633..53a3502514 100644 --- a/.dumi/hooks/useThemeAnimation.ts +++ b/.dumi/hooks/useThemeAnimation.ts @@ -89,7 +89,6 @@ const useThemeAnimation = () => { .startViewTransition(async () => { // wait for theme change end while (colorBgElevated === animateRef.current.colorBgElevated) { - // eslint-disable-next-line no-await-in-loop await new Promise((resolve) => { setTimeout(resolve, 1000 / 60); }); @@ -99,6 +98,7 @@ const useThemeAnimation = () => { root.classList.add(isDark ? 'light' : 'dark'); }) .ready.then(() => { + // eslint-disable-next-line no-console console.log(`Theme transition finished in ${Date.now() - time}ms`); const clipPath = [ `circle(0px at ${x}px ${y}px)`, diff --git a/.dumi/loading.js b/.dumi/loading.js index 23b84ea095..811f63354e 100644 --- a/.dumi/loading.js +++ b/.dumi/loading.js @@ -1,3 +1,3 @@ // must be .js file, can't modify to be .ts file! -// eslint-disable-next-line no-restricted-exports + export { default } from './theme/common/Loading'; diff --git a/.dumi/pages/index/components/BannerRecommends.tsx b/.dumi/pages/index/components/BannerRecommends.tsx index cc223f3b44..d80d886f91 100644 --- a/.dumi/pages/index/components/BannerRecommends.tsx +++ b/.dumi/pages/index/components/BannerRecommends.tsx @@ -112,7 +112,7 @@ export const BannerRecommendsFallback: React.FC = () => { const { isMobile } = useContext(SiteContext); const { styles } = useStyle(); - const list = Array(3).fill(1); + const list = new Array(3).fill(1); return isMobile ? ( @@ -140,7 +140,7 @@ const BannerRecommends: React.FC = () => { const data = useSiteData(); const extras = data?.extras?.[lang]; const icons = data?.icons || []; - const first3 = !extras || extras.length === 0 ? Array(3).fill(null) : extras.slice(0, 3); + const first3 = !extras || extras.length === 0 ? new Array(3).fill(null) : extras.slice(0, 3); if (!data) { return ; diff --git a/.dumi/pages/index/components/Theme/ColorPicker.tsx b/.dumi/pages/index/components/Theme/ColorPicker.tsx index f41295a9e5..4db445a449 100644 --- a/.dumi/pages/index/components/Theme/ColorPicker.tsx +++ b/.dumi/pages/index/components/Theme/ColorPicker.tsx @@ -102,7 +102,6 @@ const ThemeColorPicker: React.FC = ({ value, onChange, id {matchColors.map(({ color, active, picker }) => { const colorNode = ( - // eslint-disable-next-line jsx-a11y/label-has-associated-control