Skip to content

Commit

Permalink
style: use eslint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Apr 21, 2024
1 parent fb732ac commit 32f21b5
Show file tree
Hide file tree
Showing 63 changed files with 10,943 additions and 8,657 deletions.
16 changes: 8 additions & 8 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"dev": "vuepress dev src"
},
"devDependencies": {
"@fancyapps/ui": "5.0.35",
"@fancyapps/ui": "5.0.36",
"@vuepress/bundler-vite": "2.0.0-rc.9",
"@vuepress/helper": "2.0.0-rc.21",
"@vuepress/plugin-docsearch": "2.0.0-rc.21",
"@vuepress/plugin-redirect": "2.0.0-rc.21",
"@vuepress/helper": "2.0.0-rc.26",
"@vuepress/plugin-docsearch": "2.0.0-rc.26",
"@vuepress/plugin-redirect": "2.0.0-rc.26",
"@waline/client": "workspace:*",
"marked": "12.0.1",
"marked": "12.0.2",
"mathjax-full": "3.2.2",
"vue": "3.4.21",
"vue": "3.4.23",
"vuepress": "2.0.0-rc.9",
"vuepress-shared": "2.0.0-rc.32",
"vuepress-theme-hope": "2.0.0-rc.32"
"vuepress-shared": "2.0.0-rc.37",
"vuepress-theme-hope": "2.0.0-rc.37"
}
}
18 changes: 8 additions & 10 deletions docs/src/.vuepress/components/NormalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export default defineComponent({
const themeLocale = useThemeLocaleData();

const tocEnable = computed(
() =>
frontmatter.value.toc ||
(frontmatter.value.toc !== false && themeLocale.value.toc !== false),
() => frontmatter.value.toc ?? themeLocale.value.toc ?? false,
);

return (): VNode =>
Expand All @@ -44,10 +42,10 @@ export default defineComponent({
{ class: 'vp-page', id: 'main-content' },
h(
hasGlobalComponent('LocalEncrypt')
? <ComponentOptions>resolveComponent('LocalEncrypt')
? (resolveComponent('LocalEncrypt') as ComponentOptions)
: RenderDefault,
() => [
slots['top']?.(),
slots.top?.(),
h(BreadCrumb),
h(PageTitle),
tocEnable.value
Expand All @@ -60,14 +58,14 @@ export default defineComponent({
2,
},
{
before: () => slots['tocBefore']?.(),
after: () => slots['tocAfter']?.(),
before: () => slots.tocBefore?.(),
after: () => slots.tocAfter?.(),
},
)
: null,
slots['contentBefore']?.(),
slots.contentBefore?.(),
h(MarkdownContent),
slots['contentAfter']?.(),
slots.contentAfter?.(),
h(PageMeta),
h(PageNav),
h(WalineTips),
Expand All @@ -76,7 +74,7 @@ export default defineComponent({
darkmode: isDarkmode.value,
})
: null,
slots['bottom']?.(),
slots.bottom?.(),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/.vuepress/components/WalineTips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineComponent({
>();
const routeLocale = useRouteLocale();

const isHome = computed(() => frontmatter.value.home || false);
const isHome = computed(() => frontmatter.value.home ?? false);
const text = computed(() => i18n[routeLocale.value]);

return (): VNode =>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { viteBundler } from '@vuepress/bundler-vite';
import { redirectPlugin } from '@vuepress/plugin-redirect';
import { type UserConfig, defineUserConfig } from 'vuepress';
import { defineUserConfig } from 'vuepress';
import { path } from 'vuepress/utils';

import theme from './theme.js';

export default <UserConfig>defineUserConfig({
export default defineUserConfig({
locales: {
'/': {
lang: 'zh-CN',
Expand Down
3 changes: 3 additions & 0 deletions docs/src/.vuepress/shims-fancy-box.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module '@fancyapps/ui/dist/fancybox/fancybox.esm.js' {
export * from '@fancyapps/ui';
}
3 changes: 2 additions & 1 deletion docs/src/.vuepress/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue';
import { type DefineComponent } from 'vue';

const component: DefineComponent;
export default component;
}
9 changes: 0 additions & 9 deletions docs/src/.vuepress/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
@use 'fancybox';

.waline-wrapper {
// FIXME: FIX in theme
--waline-bg-color: var(--bg-color);
--waline-bg-color-light: var(--bg-color-secondary);
--waline-text-color: var(--text-color);
--waline-border: 1px solid var(--border-color);
--waline-border-color: var(--border-color);
--waline-theme-color: var(--theme-color);
--waline-active-color: var(--theme-color-light);

// fancybox
img {
cursor: zoom-in;
Expand Down
8 changes: 2 additions & 6 deletions docs/src/.vuepress/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export default hopeTheme(
{
hostname: 'https://waline.js.org',
favicon: '/favicon.ico',
iconAssets: '//at.alicdn.com/t/c/font_3180165_u7vein90ekb.css',

logo: '/logo.png',
repo: 'walinejs/waline',
docsDir: 'docs/src',
docsBranch: 'main',

pageInfo: ['ReadingTime', 'PageView'],

contributors: false,

locales: {
Expand All @@ -35,11 +35,7 @@ export default hopeTheme(
},
},

iconAssets: '//at.alicdn.com/t/c/font_3180165_u7vein90ekb.css',

plugins: {
blog: false,

comment: {
provider: 'Waline',
login: 'force',
Expand All @@ -57,7 +53,7 @@ export default hopeTheme(
level4: '元婴',
level5: '化神',
},
'/en': {
'/en/': {
admin: 'GM',
level0: 'Dwarves',
level1: 'Hobbits',
Expand Down
1 change: 1 addition & 0 deletions docs/src/.vuepress/utils/csv.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
var CSV = {};
!(function (p) {
'use strict';
Expand Down
3 changes: 1 addition & 2 deletions docs/src/.vuepress/utils/exportRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ const fakeClick = (element: HTMLElement): void => {

export const exportRaw = (name: string, data: BlobPart): void => {
const urlObject = window.URL || window.webkitURL || window;
const export_blob = new Blob([data]);
const saveAnchor = document.createElementNS(
'http://www.w3.org/1999/xhtml',
'a',
) as HTMLAnchorElement;

saveAnchor.href = urlObject.createObjectURL(export_blob);
saveAnchor.href = urlObject.createObjectURL(new Blob([data]));
saveAnchor.download = name;

fakeClick(saveAnchor);
Expand Down
8 changes: 3 additions & 5 deletions docs/src/.vuepress/utils/transform/tk2lc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ export const tk2lc = (input: string) => {
insertedAt: {
__type: 'Date',
iso: new Date(
created && created.$numberLong
? Number(created.$numberLong)
: created,
created?.$numberLong ? Number(created.$numberLong) : created,
).toISOString(),
},
createdAt: new Date(
created && created.$numberLong ? Number(created.$numberLong) : created,
created?.$numberLong ? Number(created.$numberLong) : created,
).toISOString(),
updatedAt: new Date(
updated && updated.$numberLong ? Number(updated.$numberLong) : updated,
updated?.$numberLong ? Number(updated.$numberLong) : updated,
).toISOString(),
ip,
link,
Expand Down
Loading

0 comments on commit 32f21b5

Please sign in to comment.