From 7a248529bb6407e1b59e06303f3c0a0853988e6a Mon Sep 17 00:00:00 2001 From: timongh <46739861+timongh@users.noreply.github.com> Date: Sun, 29 Jan 2023 00:49:17 +0800 Subject: [PATCH 1/4] Add ts config: `importsNotUsedAsValues` with corresponding eslint rule --- .eslintrc.js | 1 + dev-tools/dev-server/config.ts | 2 +- dev-tools/dev-server/core-watcher.ts | 5 ++-- dev-tools/dev-server/index.ts | 2 +- dev-tools/dev-server/registry-watcher.ts | 6 ++-- dev-tools/dev-server/server.ts | 10 ++++--- dev-tools/dev-server/watcher-common.ts | 2 +- dev-tools/dev-server/web-socket-server.ts | 5 ++-- .../lib/components/feeds/copy-link/index.ts | 2 +- .../components/feeds/disable-details/index.ts | 3 +- .../feeds/filter/FeedsFilterCard.vue | 16 +++++----- registry/lib/components/feeds/filter/index.ts | 8 ++--- .../lib/components/feeds/filter/plugin.ts | 8 +++-- .../components/feeds/fold-comments/index.ts | 6 ++-- .../live/badge-helper/BadgeHelper.vue | 4 ++- .../lib/components/live/badge-helper/index.ts | 1 + .../live/danmaku-sendbar/DanmakuSendbar.vue | 1 + .../components/live/danmaku-sendbar/index.ts | 3 +- .../live/download-records/DownloadRecords.vue | 2 +- .../lib/components/live/gift-box/index.ts | 3 +- .../style/always-show-duration/index.ts | 2 +- .../style/custom-navbar/CustomNavbar.vue | 3 +- .../style/custom-navbar/CustomNavbarItem.vue | 3 +- .../style/custom-navbar/built-in-items.ts | 22 +++++++------- .../style/custom-navbar/custom-navbar-item.ts | 9 ++++-- .../components/style/custom-navbar/entry.ts | 2 +- .../favorites/FavoritesFolderSelect.vue | 8 +++-- .../favorites/NavbarFavorites.vue | 13 ++++---- .../custom-navbar/favorites/favorites.ts | 3 +- .../style/custom-navbar/feeds/NavbarFeeds.vue | 3 +- .../style/custom-navbar/feeds/feeds.ts | 2 +- .../custom-navbar/feeds/tabs/BangumiFeeds.vue | 5 ++-- .../custom-navbar/feeds/tabs/ColumnFeeds.vue | 5 ++-- .../custom-navbar/feeds/tabs/LiveFeeds.vue | 7 +++-- .../custom-navbar/feeds/tabs/VideoFeeds.vue | 7 +++-- .../custom-navbar/feeds/tabs/next-page.ts | 14 ++++----- .../style/custom-navbar/feeds/tabs/tabs.ts | 2 +- .../flexible-blank/flexible-blank.ts | 2 +- .../custom-navbar/history/NavbarHistory.vue | 14 +++++---- .../style/custom-navbar/history/history.ts | 2 +- .../style/custom-navbar/history/types.ts | 2 +- .../style/custom-navbar/home/NavbarHome.vue | 4 ++- .../style/custom-navbar/home/home.ts | 2 +- .../style/custom-navbar/iframe/iframe.ts | 2 +- .../components/style/custom-navbar/index.ts | 14 ++++----- .../style/custom-navbar/logo/NavbarLogo.vue | 2 +- .../style/custom-navbar/logo/logo.ts | 2 +- .../custom-navbar/messages/NavbarMessages.vue | 1 + .../style/custom-navbar/messages/messages.ts | 2 +- .../style/custom-navbar/ranking/ranking.ts | 2 +- .../style/custom-navbar/search/search.ts | 2 +- .../custom-navbar/settings/ExtraOptions.vue | 5 ++-- .../custom-navbar/settings/NavbarSettings.vue | 8 +++-- .../simple-links/simple-links.ts | 2 +- .../subscriptions/NavbarSubscriptions.vue | 5 ++-- .../subscriptions/SubscriptionsList.vue | 5 ++-- .../subscriptions/subscriptions.ts | 3 +- .../style/custom-navbar/upload/upload.ts | 2 +- .../custom-navbar/user-info/UserInfoPopup.vue | 7 +++-- .../custom-navbar/user-info/user-info.ts | 3 +- .../watchlater/NavbarWatchlater.vue | 11 +++---- .../custom-navbar/watchlater/watchlater.ts | 2 +- .../style/dark-mode/follow-system/index.ts | 1 + .../lib/components/style/dark-mode/index.ts | 1 + .../style/dark-mode/schedule/index.ts | 13 ++++---- .../style/home-redesign/fresh/VideoList.vue | 5 ++-- .../style/home-redesign/fresh/index.ts | 1 + .../fresh/layouts/areas/Areas.vue | 3 +- .../fresh/layouts/areas/areas.ts | 2 +- .../fresh/layouts/blackboard/Blackboard.vue | 3 +- .../fresh/layouts/blackboard/blackboard.ts | 2 +- .../fresh/layouts/categories/Categories.vue | 5 ++-- .../fresh/layouts/categories/categories.ts | 2 +- .../layouts/categories/content/Bangumi.vue | 5 ++-- .../categories/content/BangumiTimeline.vue | 9 +++--- .../layouts/categories/content/Default.vue | 5 ++-- .../layouts/categories/content/RankList.vue | 5 ++-- .../categories/content/VideoSlides.vue | 5 ++-- .../fresh/layouts/categories/filter.ts | 1 + .../fresh/layouts/feeds/Feeds.vue | 5 ++-- .../fresh/layouts/feeds/feeds.ts | 2 +- .../fresh/layouts/fresh-layout-item.ts | 2 +- .../home-redesign/fresh/layouts/layouts.ts | 1 + .../fresh/layouts/trending/Trending.vue | 5 ++-- .../fresh/layouts/trending/trending.ts | 2 +- .../style/home-redesign/fresh/types.ts | 3 +- .../home-redesign/minimal/MinimalHome.vue | 3 +- .../style/home-redesign/minimal/index.ts | 3 +- .../style/home-redesign/minimal/options.ts | 3 +- .../home-redesign/minimal/tabs/Feeds.vue | 5 ++-- .../home-redesign/minimal/tabs/Trending.vue | 3 +- .../style/home-redesign/trending.ts | 4 +-- .../components/style/simplify/home/index.ts | 3 +- .../components/style/simplify/live/index.ts | 2 +- .../components/style/special-danmaku/index.ts | 11 +++---- .../touch/double-click-control/index.ts | 1 + .../lib/components/touch/mini-player/index.ts | 2 +- .../lib/components/touch/mini-player/video.ts | 1 + .../touch/player-gestures/GesturePreview.vue | 8 +++-- .../components/touch/player-gestures/entry.ts | 3 +- .../components/touch/player-gestures/index.ts | 1 + .../touch/player-gestures/swiper.ts | 1 + .../utils/black-list/BlackListSettings.vue | 2 +- .../components/utils/black-list/Settings.vue | 3 +- .../lib/components/utils/black-list/index.ts | 5 ++-- .../lib/components/utils/black-list/vm.ts | 1 + .../utils/check-in-center/Widget.vue | 4 ++- .../utils/check-in-center/check-in-item.ts | 2 +- .../utils/comments/copy-link/index.ts | 2 +- .../components/utils/dev-client/Action.vue | 5 ++-- .../components/utils/dev-client/Widget.vue | 1 + .../lib/components/utils/dev-client/client.ts | 15 ++++++---- .../lib/components/utils/dev-client/index.ts | 3 +- .../components/utils/dev-client/options.ts | 6 ++-- .../lib/components/utils/dev-client/plugin.ts | 10 +++++-- .../utils/download-audio/DownloadAudio.vue | 5 ++-- .../components/utils/image-exporter/feed.ts | 8 +++-- .../components/utils/image-exporter/index.ts | 8 ++--- .../utils/image-resolution/index.ts | 8 ++--- .../utils/image-resolution/resolution.ts | 3 +- .../components/utils/import-series/index.ts | 1 + .../components/utils/import-series/logic.ts | 4 +-- .../lib/components/utils/keymap/actions.ts | 5 ++-- .../lib/components/utils/keymap/bindings.ts | 3 +- registry/lib/components/utils/keymap/index.ts | 13 ++++---- .../utils/keymap/settings/ExtraOptions.vue | 1 + .../utils/keymap/settings/KeymapSettings.vue | 7 +++-- .../keymap/settings/KeymapSettingsRow.vue | 3 +- .../utils/remove-promotions/index.ts | 2 +- .../utils/url-params-clean/index.ts | 2 +- .../lib/components/utils/v1-migrate/index.ts | 3 +- .../components/utils/v1-migrate/migrate.ts | 7 +++-- .../components/utils/view-cover/ViewCover.vue | 4 +-- .../utils/watchlater-redirect/index.ts | 2 +- .../video/bvid-convert/BvidConvert.vue | 3 +- .../components/video/bvid-convert/index.ts | 7 ++--- .../video/danmaku/airborne/index.ts | 5 ++-- .../video/danmaku/converter/ass-danmaku.ts | 5 ++-- .../danmaku/converter/danmaku-converter.ts | 11 ++++--- .../video/danmaku/converter/danmaku-data.ts | 2 +- .../video/danmaku/converter/danmaku-stack.ts | 5 ++-- .../video/danmaku/converter/xml-danmaku.ts | 4 ++- .../danmaku/download/DownloadDanmaku.vue | 4 ++- .../video/danmaku/download/Plugin.vue | 3 +- .../video/danmaku/download/index.ts | 7 +++-- .../video/danmaku/download/utils.ts | 6 ++-- .../components/video/danmaku/expand/index.ts | 2 +- .../video/default-location/Advanced.vue | 2 +- .../video/default-location/Options.vue | 5 ++-- .../default-location/PageTypeSelector.vue | 1 + .../video/default-location/index.ts | 3 +- .../video/download/DownloadVideo.vue | 24 ++++++++------- .../components/video/download/apis/dash.ts | 12 ++++---- .../lib/components/video/download/apis/flv.ts | 11 +++---- .../lib/components/video/download/error.ts | 3 +- .../video/download/inputs/EpisodesPicker.vue | 5 ++-- .../video/download/inputs/bangumi/batch.ts | 6 ++-- .../video/download/inputs/episode-item.ts | 2 +- .../download/inputs/video/SingleVideoInfo.vue | 2 +- .../video/download/inputs/video/batch.ts | 6 ++-- .../video/download/inputs/video/input.ts | 3 +- .../video/download/outputs/stream-saver.ts | 3 +- .../video/download/outputs/toast.ts | 3 +- .../lib/components/video/download/types.ts | 7 +++-- .../video/full-description/index.ts | 3 +- .../video/full-episode-title/index.ts | 2 +- .../outer-watchlater/OuterWatchlater.vue | 2 +- .../video/outer-watchlater/index.ts | 12 ++++---- .../video/player/common/mini-rxjs/create.ts | 3 +- .../common/mini-rxjs/operators/bufferSet.ts | 2 +- .../mini-rxjs/operators/combineLatest.ts | 3 +- .../mini-rxjs/operators/debounceTime.ts | 2 +- .../operators/distinctUntilChanged.ts | 2 +- .../common/mini-rxjs/operators/filter.ts | 2 +- .../player/common/mini-rxjs/operators/map.ts | 2 +- .../common/mini-rxjs/operators/observeOn.ts | 2 +- .../common/mini-rxjs/operators/pairwise.ts | 2 +- .../common/mini-rxjs/operators/startWith.ts | 2 +- .../player/common/mini-rxjs/operators/tap.ts | 3 +- .../common/mini-rxjs/operators/util/index.ts | 2 +- .../video/player/common/mini-rxjs/utils.ts | 2 +- .../common/mini-rxjs/utils/firstValueFrom.ts | 2 +- .../components/video/player/common/speed.ts | 19 ++++++------ .../video/player/common/speed/context.ts | 4 ++- .../video/player/control-background/index.ts | 9 ++---- .../video/player/default-mode/index.ts | 9 ++---- .../player/double-click-fullscreen/index.ts | 9 ++---- .../video/player/extend-speed/component.ts | 12 +++++--- .../video/player/extend-speed/index.ts | 4 ++- .../components/video/player/focus/index.ts | 3 +- .../video/player/remember-speed/component.ts | 7 +++-- .../video/player/remember-speed/index.ts | 4 ++- .../screenshot/VideoScreenshotContainer.vue | 5 ++-- .../video/player/screenshot/index.ts | 8 +++-- .../video/player/seek-by-frames/index.ts | 5 ++-- .../video/player/show-cover/index.ts | 3 +- .../video/player/show-upload-time/index.ts | 6 ++-- .../video/quick-favorite/QuickFavorite.vue | 6 ++-- .../components/video/quick-favorite/index.ts | 12 ++++---- .../subtitle/download/DownloadSubtitle.vue | 10 ++++--- .../video/subtitle/download/Plugin.vue | 3 +- .../video/subtitle/download/index.ts | 8 +++-- .../video/subtitle/download/utils.ts | 3 +- .../lib/deprecated/auto-continue/index.ts | 9 ++---- .../lib/deprecated/feeds-translate/index.ts | 2 +- registry/lib/deprecated/i18n/en-US/data.ts | 2 +- registry/lib/deprecated/i18n/en-US/index.ts | 2 +- registry/lib/deprecated/i18n/ja-JP/data.ts | 2 +- registry/lib/deprecated/i18n/ja-JP/index.ts | 2 +- .../deprecated/live-default-quality/index.ts | 9 ++---- .../record-danmaku/DanmakuRecorder.vue | 10 +++---- .../lib/deprecated/restore-floors/index.ts | 2 +- .../deprecated/video-default-quality/index.ts | 9 ++---- registry/lib/docs/components-doc.ts | 5 ++-- registry/lib/docs/index.ts | 1 + registry/lib/docs/packages-doc.ts | 3 +- registry/lib/docs/plugins-doc.ts | 5 ++-- registry/lib/docs/third-party.ts | 3 +- .../launch-bar/trending-search/index.ts | 2 +- .../settings-panel/recent-components/index.ts | 6 ++-- .../style/custom-navbar-channel/index.ts | 6 ++-- .../NavbarDarkMode.vue | 2 +- .../style/custom-navbar-dark-mode/index.ts | 5 ++-- .../plugins/utils/keymap-dark-mode/index.ts | 5 ++-- .../utils/keymap-empty-action.ts/index.ts | 5 ++-- .../utils/keymap-toggle-danmaku-list/index.ts | 5 ++-- .../utils/keymap-toggle-subtitle/index.ts | 5 ++-- registry/lib/plugins/v-loading/reimu/index.ts | 4 +-- .../video/download/aria2-output/RpcConfig.vue | 6 ++-- .../download/aria2-output/aria2-input.ts | 3 +- .../video/download/aria2-output/aria2-rpc.ts | 5 ++-- .../video/download/aria2-output/index.ts | 5 ++-- .../video/download/idm-output/index.ts | 5 ++-- .../video/download/manual-input/index.ts | 5 ++-- .../video/download/motrix-output/index.ts | 5 ++-- .../download/mpv-output-playlist/index.ts | 5 ++-- .../mpv-output-playlist/mpv-playlist.ts | 3 +- .../video/download/mpv-output/index.ts | 5 ++-- .../lib/plugins/video/player/speed/index.ts | 11 +++---- registry/webpack/build.ts | 1 + registry/webpack/config.ts | 5 ++-- registry/webpack/docs.ts | 1 + src/components/SwitchOptions.vue | 3 +- src/components/api.ts | 30 +++++++++---------- src/components/auto-update/ExtraOptions.vue | 1 + src/components/auto-update/checker.ts | 17 +++++------ src/components/auto-update/index.ts | 20 ++++++------- src/components/built-in-components.ts | 8 ++--- src/components/component.ts | 11 +++---- src/components/define.ts | 2 +- src/components/description.ts | 6 ++-- src/components/feeds/VideoCard.vue | 4 +-- src/components/feeds/api/index.ts | 14 +++++---- src/components/feeds/api/manager/adaptor.ts | 5 ++-- src/components/feeds/api/manager/base.ts | 6 ++-- src/components/feeds/api/manager/index.ts | 3 +- src/components/feeds/api/manager/v1.ts | 4 ++- src/components/feeds/api/manager/v2.ts | 8 +++-- src/components/feeds/api/types.ts | 2 +- src/components/feeds/notify.ts | 3 +- src/components/i18n/dom-translator.ts | 7 +++-- src/components/i18n/helpers.ts | 10 +++++-- src/components/i18n/index.ts | 5 ++-- .../machine-translator/MachineTranslator.vue | 4 ++- .../i18n/machine-translator/translators.ts | 7 +++-- src/components/i18n/types.ts | 4 +-- src/components/launch-bar/GlobalLaunchBar.vue | 1 + src/components/launch-bar/LaunchBar.vue | 15 +++++----- src/components/launch-bar/history-provider.ts | 2 +- src/components/launch-bar/index.ts | 3 +- .../launch-bar/launch-bar-action.ts | 2 +- src/components/launch-bar/plugin.ts | 5 ++-- src/components/launch-bar/search-provider.ts | 5 ++-- src/components/launch-bar/toggle.ts | 1 + src/components/live/live-socket.ts | 4 +-- src/components/notify-new-version/index.ts | 1 + .../settings-panel/ComponentDescription.vue | 1 + .../settings-panel/ComponentDetail.vue | 10 ++++--- .../settings-panel/ComponentOption.vue | 10 ++++--- .../settings-panel/ComponentSettings.vue | 12 ++++---- .../settings-panel/ComponentTags.vue | 9 ++++-- .../settings-panel/SettingsContainer.vue | 2 +- .../settings-panel/SettingsPanel.vue | 15 ++++++---- .../settings-panel/WidgetsPanel.vue | 5 ++-- .../component-actions/component-actions.ts | 7 +++-- .../settings-panel/external-actions.ts | 4 ++- src/components/settings-panel/index.en-US.ts | 2 +- src/components/settings-panel/index.ts | 17 ++++++----- src/components/settings-panel/mixins.ts | 3 +- .../settings-panel/search-bar-actions.ts | 3 +- .../settings-panel/sub-pages/AboutPage.vue | 4 ++- .../sub-pages/UserComponentsPage.vue | 6 ++-- .../sub-pages/UserPluginsPage.vue | 6 ++-- .../sub-pages/UserStylesPage.vue | 6 ++-- .../settings-panel/sub-pages/index.ts | 2 +- .../sub-pages/manage-panel/ManagePanel.vue | 9 +++--- .../online-registry/OnlineRegistry.vue | 8 +++-- .../online-registry/OnlineRegistryButton.vue | 1 + .../online-registry/RegistryItem.vue | 10 +++++-- .../sub-pages/online-registry/vm.ts | 1 + src/components/settings-panel/tag-filter.ts | 3 +- src/components/styled-component.ts | 3 +- src/components/switch-options-old.ts | 7 +++-- src/components/switch-options.ts | 9 +++--- src/components/types.ts | 19 ++++++------ src/components/user-component.ts | 4 ++- src/components/utils/comment-apis.ts | 4 +-- src/components/video/player-agent/bangumi.ts | 2 +- src/components/video/player-agent/base.ts | 9 +++--- src/components/video/player-agent/index.ts | 1 + src/components/video/player-agent/types.ts | 2 +- .../video/player-agent/video-player-mixed.ts | 2 +- .../video/player-agent/video-player-v2.ts | 3 +- src/components/video/player-light.ts | 1 + src/components/video/video-danmaku.ts | 1 + src/components/widget.ts | 5 ++-- src/core/common-types.ts | 4 +-- src/core/core-apis.ts | 16 +++++----- src/core/dialog/Dialog.vue | 2 +- src/core/dialog/index.ts | 2 +- src/core/download.ts | 3 +- .../load-feature-code-all-settled.ts | 3 +- .../external-input/load-feature-code-all.ts | 10 +++---- src/core/external-input/load-feature-code.ts | 6 ++-- .../load-features-from-codes.ts | 8 ++--- src/core/install-feature.ts | 8 +++-- src/core/meta.ts | 1 + src/core/observer.ts | 2 +- src/core/performance/component-trace.ts | 2 +- src/core/performance/plugin-trace.ts | 2 +- src/core/runtime-library.ts | 3 +- src/core/settings/helpers.ts | 14 ++++----- src/core/settings/index.ts | 8 ++--- src/core/settings/internal-state.ts | 3 +- src/core/settings/listener.ts | 2 +- src/core/settings/proxy.ts | 2 +- src/core/settings/types.ts | 6 ++-- src/core/style.ts | 3 +- src/core/theme-color/image-filter.ts | 2 +- src/core/theme-color/index.ts | 5 ++-- src/core/toast/ToastCard.vue | 3 +- src/core/toast/mini.ts | 6 ++-- src/core/utils/index.ts | 14 ++++----- src/core/utils/lazy-panel.ts | 2 +- src/core/utils/log.ts | 3 +- src/core/utils/title.ts | 2 +- src/core/utils/urls.ts | 2 +- src/core/version.ts | 3 +- src/global.d.ts | 8 +++-- src/plugins/ajax-hook/index.ts | 2 +- src/plugins/api.ts | 4 +-- src/plugins/id-search/index.ts | 8 +++-- src/plugins/plugin.ts | 5 ++-- src/ui/ColorPicker.vue | 2 ++ src/ui/ImagePicker.vue | 3 +- src/ui/ImageViewer.vue | 2 +- src/ui/RadioButton.vue | 5 ++-- src/ui/TabControl.vue | 2 +- src/ui/index.ts | 8 ++--- src/ui/tab-mapping.ts | 2 +- tsconfig.json | 3 +- webpack/cdn/github.ts | 2 +- webpack/cdn/jsdelivr.ts | 2 +- webpack/inject-metadata/core-info.ts | 7 +++-- webpack/inject-metadata/description.ts | 7 +++-- webpack/inject-metadata/i18n.ts | 7 +++-- webpack/inject-metadata/index.ts | 5 ++-- webpack/inject-metadata/types.ts | 2 +- webpack/loaders/style-loaders.ts | 4 +-- webpack/loaders/ts-loader.ts | 3 +- webpack/webpack.config.ts | 16 +++++----- webpack/webpack.dev.ts | 6 ++-- webpack/webpack.prod.ts | 6 ++-- 373 files changed, 1056 insertions(+), 801 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 15f3eb686c..9e0f356d29 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,6 +30,7 @@ module.exports = { 'import/no-default-export': 'error', 'import/no-named-default': 'off', + '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/member-delimiter-style': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', diff --git a/dev-tools/dev-server/config.ts b/dev-tools/dev-server/config.ts index 583054b19a..2c3c3d8d5b 100644 --- a/dev-tools/dev-server/config.ts +++ b/dev-tools/dev-server/config.ts @@ -1,4 +1,4 @@ -import { readFileSync, existsSync } from 'fs' +import { existsSync, readFileSync } from 'fs' interface DevServerConfig { port?: number diff --git a/dev-tools/dev-server/core-watcher.ts b/dev-tools/dev-server/core-watcher.ts index 4030b36e34..0635310f73 100644 --- a/dev-tools/dev-server/core-watcher.ts +++ b/dev-tools/dev-server/core-watcher.ts @@ -1,8 +1,9 @@ -import webpack from 'webpack' import exitHook from 'async-exit-hook' +import webpack from 'webpack' + import webpackConfig from '../../webpack/webpack.dev' -import { sendMessage } from './web-socket-server' import { defaultWatcherHandler } from './watcher-common' +import { sendMessage } from './web-socket-server' export const startCoreWatcher = () => new Promise(resolve => { diff --git a/dev-tools/dev-server/index.ts b/dev-tools/dev-server/index.ts index e64b59531c..692ae84c2a 100644 --- a/dev-tools/dev-server/index.ts +++ b/dev-tools/dev-server/index.ts @@ -1,5 +1,5 @@ -import { startDevServer } from './server' import { startCoreWatcher } from './core-watcher' +import { startDevServer } from './server' import { startWebSocketServer } from './web-socket-server' startDevServer().then(server => { diff --git a/dev-tools/dev-server/registry-watcher.ts b/dev-tools/dev-server/registry-watcher.ts index 45d5e5ca16..45a35ee6d6 100644 --- a/dev-tools/dev-server/registry-watcher.ts +++ b/dev-tools/dev-server/registry-watcher.ts @@ -1,9 +1,11 @@ -import { Watching, Configuration, webpack } from 'webpack' import exitHook from 'async-exit-hook' +import type { Configuration, Watching } from 'webpack' +import { webpack } from 'webpack' + import { fromId } from '../../registry/lib/id' +import { devServerConfig } from './config' import { defaultWatcherHandler } from './watcher-common' import { sendMessage } from './web-socket-server' -import { devServerConfig } from './config' export const watchers: { url: string; instance: Watching }[] = [] export const parseRegistryUrl = (url: string) => { diff --git a/dev-tools/dev-server/server.ts b/dev-tools/dev-server/server.ts index 62aab7d711..3143269c60 100644 --- a/dev-tools/dev-server/server.ts +++ b/dev-tools/dev-server/server.ts @@ -1,11 +1,13 @@ -import { createServer, Server } from 'http' -import { Configuration } from 'webpack' import exitHook from 'async-exit-hook' +import type { Server } from 'http' +import { createServer } from 'http' import handler from 'serve-handler' -import { devServerConfig } from './config' +import type { Configuration } from 'webpack' + import { buildByEntry } from '../../registry/webpack/config' +import { devServerConfig } from './config' +import { parseRegistryUrl, startRegistryWatcher, watchers } from './registry-watcher' import { exitWebSocketServer } from './web-socket-server' -import { watchers, parseRegistryUrl, startRegistryWatcher } from './registry-watcher' export const startDevServer = () => new Promise(resolve => { diff --git a/dev-tools/dev-server/watcher-common.ts b/dev-tools/dev-server/watcher-common.ts index 7de70d68af..1d65a1f120 100644 --- a/dev-tools/dev-server/watcher-common.ts +++ b/dev-tools/dev-server/watcher-common.ts @@ -1,4 +1,4 @@ -import { Stats } from 'webpack' +import type { Stats } from 'webpack' export const defaultWatcherHandler = ( initCallback: (result: Stats) => void, diff --git a/dev-tools/dev-server/web-socket-server.ts b/dev-tools/dev-server/web-socket-server.ts index ef94e585df..ef784dc621 100644 --- a/dev-tools/dev-server/web-socket-server.ts +++ b/dev-tools/dev-server/web-socket-server.ts @@ -1,7 +1,8 @@ import exitHook from 'async-exit-hook' -import { Server } from 'http' +import type { Server } from 'http' import { WebSocketServer } from 'ws' -import { Payload } from './payload' + +import type { Payload } from './payload' import { stopInstance, watchers } from './registry-watcher' let server: WebSocketServer diff --git a/registry/lib/components/feeds/copy-link/index.ts b/registry/lib/components/feeds/copy-link/index.ts index 930384f08f..3125735a4f 100644 --- a/registry/lib/components/feeds/copy-link/index.ts +++ b/registry/lib/components/feeds/copy-link/index.ts @@ -1,5 +1,5 @@ import { defineComponentMetadata } from '@/components/define' -import { FeedsCard } from '@/components/feeds/api' +import type { FeedsCard } from '@/components/feeds/api' import { feedsUrls } from '@/core/utils/urls' const entry = async () => { diff --git a/registry/lib/components/feeds/disable-details/index.ts b/registry/lib/components/feeds/disable-details/index.ts index f361431704..38d7f52288 100644 --- a/registry/lib/components/feeds/disable-details/index.ts +++ b/registry/lib/components/feeds/disable-details/index.ts @@ -1,5 +1,6 @@ import { defineComponentMetadata } from '@/components/define' -import { FeedsCard, feedsCardTypes } from '@/components/feeds/api' +import type { FeedsCard } from '@/components/feeds/api' +import { feedsCardTypes } from '@/components/feeds/api' import { feedsUrls } from '@/core/utils/urls' let enabled = true diff --git a/registry/lib/components/feeds/filter/FeedsFilterCard.vue b/registry/lib/components/feeds/filter/FeedsFilterCard.vue index f67b4289af..713bb9aee8 100644 --- a/registry/lib/components/feeds/filter/FeedsFilterCard.vue +++ b/registry/lib/components/feeds/filter/FeedsFilterCard.vue @@ -50,18 +50,20 @@