From f10e259266a65ca383d326f865ed2d97b94fb919 Mon Sep 17 00:00:00 2001 From: viarotel Date: Tue, 16 Apr 2024 15:38:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9E=96=20=E5=8E=BB=E9=99=A4=E5=86=97?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 6 ------ .eslintrc.cjs | 4 ---- eslint.config.js | 16 +++++++++++----- src/components/HomeFeaturesBefore/index.vue | 2 +- src/components/HomeHeroImage/index.vue | 5 +++-- src/components/ViaLottiePlayer/index.vue | 3 ++- 6 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 6c09ddd6..00000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -# user -node_modules -dist -assets -.vitepress/cache -.vitepress/.temp \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 533fe1ce..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - extends: '@viarotel-org', - rules: {}, -} diff --git a/eslint.config.js b/eslint.config.js index 6f6f3f77..2586f2b4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,5 +1,5 @@ -import antfu from '@antfu/eslint-config' import { createRequire } from 'node:module' +import antfu from '@antfu/eslint-config' const require = createRequire(import.meta.url) @@ -9,7 +9,13 @@ export default antfu( { typescript: false, markdown: false, - ignores: ['node_modules', 'src/notes/public', 'dist', 'index.html'], + ignores: [ + 'node_modules', + 'dist', + 'index.html', + 'src/notes/public', + '.vitepress/cache', + ], }, { languageOptions: { @@ -25,8 +31,8 @@ export default antfu( 'node/prefer-global/process': 'off', 'no-console': 'off', - curly: 'off', - eqeqeq: 'off', + 'curly': 'off', + 'eqeqeq': 'off', 'no-unused-vars': 'off', 'unused-imports/no-unused-vars': 'off', @@ -34,5 +40,5 @@ export default antfu( 'vue/html-self-closing': 'off', 'vue/block-order': 'off', }, - } + }, ) diff --git a/src/components/HomeFeaturesBefore/index.vue b/src/components/HomeFeaturesBefore/index.vue index a0c58432..285a5920 100644 --- a/src/components/HomeFeaturesBefore/index.vue +++ b/src/components/HomeFeaturesBefore/index.vue @@ -8,7 +8,7 @@ const { lang } = useData() const features = computed(() => { const repos = data.repos || [] // console.log('repos', repos) - return repos.map((item) => ({ + return repos.map(item => ({ ...item, title: item.name, details: item.description, diff --git a/src/components/HomeHeroImage/index.vue b/src/components/HomeHeroImage/index.vue index 32941407..cd4de475 100644 --- a/src/components/HomeHeroImage/index.vue +++ b/src/components/HomeHeroImage/index.vue @@ -20,14 +20,15 @@ const lottieIndex = ref(sample(arrayLotties)[2]) const currentLottie = computed(() => arrayLotties[lottieIndex.value]) const currentLottieJSON = computed( - () => currentLottie.value?.[1]?.default || null + () => currentLottie.value?.[1]?.default || null, ) const lottiePlayer = ref(null) function loadNextLottie() { if (lottieIndex.value < lengthLotties - 1) { ++lottieIndex.value - } else { + } + else { lottieIndex.value = 0 } // console.log('lottiePlayer', lottiePlayer) diff --git a/src/components/ViaLottiePlayer/index.vue b/src/components/ViaLottiePlayer/index.vue index 190df420..c8a0a627 100644 --- a/src/components/ViaLottiePlayer/index.vue +++ b/src/components/ViaLottiePlayer/index.vue @@ -14,7 +14,8 @@ if (!import.meta.env.SSR) { await import('@lottiefiles/lottie-player') renderLottie.value = true - } catch (error) { + } + catch (error) { console.warn('error') } })()