Skip to content

Commit

Permalink
style: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Feb 8, 2025
1 parent 3bacc63 commit f8e6246
Show file tree
Hide file tree
Showing 28 changed files with 60 additions and 30 deletions.
3 changes: 2 additions & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { UserConfig } from 'vuepress'
import fs from 'node:fs'
import path from 'node:path'
import { viteBundler } from '@vuepress/bundler-vite'
import { addViteOptimizeDepsInclude, addViteSsrExternal } from '@vuepress/helper'
import { defineUserConfig, type UserConfig } from 'vuepress'
import { defineUserConfig } from 'vuepress'
import { theme } from './theme.js'

const pnpmWorkspace = fs.readFileSync(path.resolve(__dirname, '../../pnpm-workspace.yaml'), 'utf-8')
Expand Down
3 changes: 2 additions & 1 deletion docs/.vuepress/themes/composables/caniuse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Ref } from 'vue'
import { onClickOutside, useDebounceFn, useEventListener, useLocalStorage } from '@vueuse/core'
import { computed, onMounted, readonly, type Ref, ref, watch } from 'vue'
import { computed, onMounted, readonly, ref, watch } from 'vue'

interface Feature {
label: string
Expand Down
3 changes: 2 additions & 1 deletion docs/.vuepress/themes/composables/theme-colors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { InjectionKey, Ref } from 'vue'
import { useSessionStorage, useStyleTag } from '@vueuse/core'
import { inject, type InjectionKey, provide, type Ref, watch } from 'vue'
import { inject, provide, watch } from 'vue'

export interface ThemeColor {
name: string
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-content-update/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, type Options } from 'tsup'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'
import { argv } from '../../scripts/tsup-args.js'

const clientExternal: (string | RegExp)[] = [
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-fonts/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, type Options } from 'tsup'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'
import { argv } from '../../scripts/tsup-args.js'

const clientExternal: (string | RegExp)[] = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { DemoConfig } from '../composables/demo.js'
import { useTemplateRef } from 'vue'
import { type DemoConfig, useExpand, useFence, useNormalDemo, useResources } from '../composables/demo.js'
import { useExpand, useFence, useNormalDemo, useResources } from '../composables/demo.js'
import '../styles/demo.css'
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-md-power/src/client/composables/audio.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type MaybeRef, onMounted, onUnmounted, ref, toValue, watch } from 'vue'
import type { MaybeRef } from 'vue'
import { onMounted, onUnmounted, ref, toValue, watch } from 'vue'

const mimeTypes = {
'audio/flac': ['flac', 'fla'],
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-md-power/src/client/composables/codeRepl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { onMounted, type Ref, ref } from 'vue'
import type { Ref } from 'vue'
import { onMounted, ref } from 'vue'
import { http } from '../utils/http.js'
import { sleep } from '../utils/sleep.js'
import { rustExecute } from './rustRepl.js'
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-md-power/src/node/demo/watcher.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { FSWatcher } from 'chokidar'
import type { App } from 'vuepress'
import fs from 'node:fs'
import path from 'node:path'
import { type FSWatcher, watch } from 'chokidar'
import { watch } from 'chokidar'
import { compileCode, parseEmbedCode } from './normal.js'
import { readFileSync } from './supports/file.js'

Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-md-power/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, type Options } from 'tsup'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'
import { argv } from '../../scripts/tsup-args.js'

const config = [
Expand Down
6 changes: 4 additions & 2 deletions plugins/plugin-search/src/client/components/SearchBox.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { SearchResult } from 'minisearch'
import type { Ref } from 'vue'
import type { SearchBoxLocales, SearchOptions } from '../../shared/index.js'
import {
computedAsync,
Expand All @@ -10,14 +12,14 @@ import {
} from '@vueuse/core'
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
import Mark from 'mark.js/src/vanilla.js'
import MiniSearch, { type SearchResult } from 'minisearch'
import MiniSearch from 'minisearch'
import {
computed,
markRaw,
nextTick,
onBeforeUnmount,
onMounted,
type Ref,
ref,
shallowRef,
toRef,
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-search/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, type Options } from 'tsup'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'
import { argv } from '../../scripts/tsup-args.js'

const sharedExternal: (string | RegExp)[] = [
Expand Down
3 changes: 2 additions & 1 deletion plugins/plugin-shikiji/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, type Options } from 'tsup'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'
import { argv } from '../../scripts/tsup-args.js'

export default defineConfig(() => {
Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/blog-extract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { BlogCategory } from './blog-category.js'
import { computed } from 'vue'
import { type BlogCategory, useBlogCategory } from './blog-category.js'
import { useBlogCategory } from './blog-category.js'
import { useLocalePostList } from './blog-data.js'
import { useTags } from './blog-tags.js'
import { useData } from './data.js'
Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/blog-post-list.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Ref } from 'vue'
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
import { useMediaQuery } from '@vueuse/core'
import { computed, type Ref } from 'vue'
import { computed } from 'vue'
import { useLocalePostList } from './blog-data.js'
import { useData } from './data.js'
import { useRouteQuery } from './route-query.js'
Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/copyright.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ComputedRef } from 'vue'
import type { CopyrightFrontmatter, CopyrightLicense, CopyrightOptions, GitContributor, KnownCopyrightLicense } from '../../shared/index.js'
import { computed, type ComputedRef } from 'vue'
import { computed } from 'vue'
import { useRoute, useRouteLocale } from 'vuepress/client'
import { useContributors } from './contributors.js'
import { useData } from './data.js'
Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/data.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Ref } from 'vue'
import type {
PageDataRef,
PageFrontmatterRef,
Expand All @@ -13,7 +14,7 @@ import type {
PlumeThemePostFrontmatter,
} from '../../shared/index.js'
import type { ThemeLocaleDataRef } from './theme-data.js'
import { computed, type Ref } from 'vue'
import { computed } from 'vue'
import {
usePageData,
usePageFrontmatter,
Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/encrypt.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { InjectionKey, Ref } from 'vue'
import type { EncryptDataRule } from './encrypt-data.js'
import { hasOwn, useSessionStorage } from '@vueuse/core'
import { compare, genSaltSync } from 'bcrypt-ts/browser'
import { computed, inject, provide } from 'vue'
import { useRoute } from 'vuepress/client'
import { useData } from './data.js'
import { type EncryptDataRule, useEncryptData } from './encrypt-data.js'
import { useEncryptData } from './encrypt-data.js'

export interface Encrypt {
hasPageEncrypt: Ref<boolean>
Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/link.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { MaybeRefOrGetter } from 'vue'
import { isLinkExternal } from '@vuepress/helper/client'
import { computed, type MaybeRefOrGetter, toValue } from 'vue'
import { computed, toValue } from 'vue'
import { resolveRouteFullPath, useRoute } from 'vuepress/client'
import { useData } from './data.js'

Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/tag-colors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Ref } from 'vue'
import { articleTagColors } from '@internal/articleTagColors'
import { type Ref, ref } from 'vue'
import { ref } from 'vue'

export type TagColors = Record<string, string>

Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/composables/theme-data.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { App, ComputedRef, InjectionKey, Ref } from 'vue'
import type { ClientData, RouteLocale } from 'vuepress/client'
import type { PlumeThemeData } from '../../shared/index.js'
import { themeData as themeDataRaw } from '@internal/themePlumeData'
import { computed, inject, ref } from 'vue'
import { type ClientData, clientDataSymbol, type RouteLocale } from 'vuepress/client'
import { clientDataSymbol } from 'vuepress/client'

declare const __VUE_HMR_RUNTIME__: Record<string, any>

Expand Down
3 changes: 2 additions & 1 deletion theme/src/client/globalComponents.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { App } from 'vue'
import VPBadge from '@theme/global/VPBadge.vue'
import VPCard from '@theme/global/VPCard.vue'
import VPCardGrid from '@theme/global/VPCardGrid.vue'
Expand All @@ -8,7 +9,7 @@ import VPHomeBox from '@theme/Home/VPHomeBox.vue'
import VPButton from '@theme/VPButton.vue'
import VPIcon from '@theme/VPIcon.vue'
import { hasGlobalComponent } from '@vuepress/helper/client'
import { type App, h, resolveComponent } from 'vue'
import { h, resolveComponent } from 'vue'

export function globalComponents(app: App) {
app.component('Badge', VPBadge)
Expand Down
3 changes: 2 additions & 1 deletion theme/src/node/config/templateBuildRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { TemplateRendererContext } from 'vuepress/utils'
import type { PlumeThemeLocaleOptions } from '../../shared/index.js'
import { templateRenderer, type TemplateRendererContext } from 'vuepress/utils'
import { templateRenderer } from 'vuepress/utils'
import { getThemePackage } from '../utils/index.js'

export function templateBuildRenderer(
Expand Down
6 changes: 4 additions & 2 deletions theme/src/node/plugins/getPlugins.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { SeoPluginOptions } from '@vuepress/plugin-seo'
import type { SitemapPluginOptions } from '@vuepress/plugin-sitemap'
import type { App, PluginConfig } from 'vuepress/core'
import type { PlumeThemeLocaleOptions, PlumeThemePluginOptions } from '../../shared/index.js'
import { contentUpdatePlugin } from '@vuepress-plume/plugin-content-update'
Expand All @@ -16,8 +18,8 @@ import { markdownMathPlugin } from '@vuepress/plugin-markdown-math'
import { nprogressPlugin } from '@vuepress/plugin-nprogress'
import { photoSwipePlugin } from '@vuepress/plugin-photo-swipe'
import { readingTimePlugin } from '@vuepress/plugin-reading-time'
import { seoPlugin, type SeoPluginOptions } from '@vuepress/plugin-seo'
import { sitemapPlugin, type SitemapPluginOptions } from '@vuepress/plugin-sitemap'
import { seoPlugin } from '@vuepress/plugin-seo'
import { sitemapPlugin } from '@vuepress/plugin-sitemap'
import { watermarkPlugin } from '@vuepress/plugin-watermark'
import { mdEnhancePlugin } from 'vuepress-plugin-md-enhance'
import { markdownPowerPlugin } from 'vuepress-plugin-md-power'
Expand Down
3 changes: 2 additions & 1 deletion theme/src/node/prepare/prepareEncrypt.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { App } from 'vuepress'
import type { Page } from 'vuepress/core'
import type { EncryptOptions, PlumeThemePageData } from '../../shared/index.js'
import type { FsCache } from '../utils/index.js'
import { isNumber, isString, random, toArray } from '@pengzhanbo/utils'
import { genSaltSync, hashSync } from 'bcrypt-ts'
import { createFsCache, type FsCache, hash, perfLog, perfMark, resolveContent, writeTemp } from '../utils/index.js'
import { createFsCache, hash, perfLog, perfMark, resolveContent, writeTemp } from '../utils/index.js'

export type EncryptConfig = readonly [
boolean, // global
Expand Down
3 changes: 2 additions & 1 deletion theme/src/node/prepare/prepareIcons.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { App, Page } from 'vuepress'
import type { NavItem, PlumeThemeHomeConfig, PlumeThemeLocaleOptions, Sidebar } from '../../shared/index.js'
import type { FsCache } from '../utils/index.js'
import { getIconContentCSS, getIconData } from '@iconify/utils'
import { isArray, uniq } from '@pengzhanbo/utils'
import { entries, isLinkAbsolute, isLinkHttp, isPlainObject } from '@vuepress/helper'
import { isPackageExists } from 'local-pkg'
import { fs } from 'vuepress/utils'
import { createFsCache, type FsCache, interopDefault, logger, nanoid, perfLog, perfMark, resolveContent, writeTemp } from '../utils/index.js'
import { createFsCache, interopDefault, logger, nanoid, perfLog, perfMark, resolveContent, writeTemp } from '../utils/index.js'

interface IconData {
className: string
Expand Down
3 changes: 2 additions & 1 deletion theme/src/node/prepare/prepareThemeData.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { FSWatcher } from 'chokidar'
import type { App } from 'vuepress'
import type { PlumeThemeData, PlumeThemeLocaleOptions, PlumeThemePluginOptions } from '../../shared/index.js'
import fs from 'node:fs/promises'
import process from 'node:process'
import { type FSWatcher, watch } from 'chokidar'
import { watch } from 'chokidar'
import { resolveImageSize } from 'vuepress-plugin-md-power'
import { hash } from 'vuepress/utils'
import { resolveThemeData } from '../config/resolveThemeData.js'
Expand Down
3 changes: 2 additions & 1 deletion theme/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { Options } from 'tsup'
import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import { defineConfig, type Options } from 'tsup'
import { defineConfig } from 'tsup'
import { argv } from '../scripts/tsup-args.js'

const sharedExternal: (string | RegExp)[] = [
Expand Down

0 comments on commit f8e6246

Please sign in to comment.