From 288a59a4ccc9f3715dede39dfde53f1ec7402b21 Mon Sep 17 00:00:00 2001 From: fxzer Date: Thu, 4 Jan 2024 11:39:23 +0800 Subject: [PATCH] fix: add @antfu/eslint-config --- .github/workflows/deploy.yml | 16 +- .gitignore | 1 - .vscode/settings.json | 43 + api/index.js | 7 +- docs/.vitepress/theme/UnoCSSLayout.vue | 8 +- docs/.vitepress/theme/components/DemoWrap.vue | 2 +- docs/.vitepress/theme/components/Loading.vue | 19 +- .../theme/components/RegisterSW.vue | 64 +- .../theme/components/ReloadPrompt.vue | 44 +- docs/.vitepress/theme/components/ToolItem.vue | 4 +- docs/.vitepress/theme/components/ToolWrap.vue | 14 +- docs/.vitepress/theme/styles/overrides.css | 32 +- docs/.vitepress/theme/styles/rainbow.css | 736 +++++++- .../MongoDB\347\254\224\350\256\260.md" | 403 ++--- ...07\344\273\266\344\270\212\344\274\240.md" | 4 +- ...46\344\271\240\347\254\224\350\256\260.md" | 596 +++---- ...12\344\274\240\346\226\207\344\273\266.md" | 86 +- ...46\344\271\240\347\254\224\350\256\260.md" | 77 +- ...46\344\271\240\347\254\224\350\256\260.md" | 33 +- ...00\346\200\273\347\273\223\344\270\200.md" | 242 +-- ...00\346\200\273\347\273\223\344\270\211.md" | 127 +- ...00\346\200\273\347\273\223\344\272\214.md" | 241 ++- ...00\346\200\273\347\273\223\344\270\200.md" | 460 ++--- ...13\350\257\225\346\265\201\347\250\213.md" | 23 +- ...37\347\220\206\345\255\246\344\271\240.md" | 3 +- ...7\233\256\350\277\201\347\247\273Vite5.md" | 65 +- ...45\346\274\217\347\254\224\350\256\260.md" | 64 +- ...36\346\230\276\344\274\230\345\214\226.md" | 304 ++-- ...40\351\231\244\345\244\204\347\220\206.md" | 12 +- ...47\253\231\346\267\273\345\212\240 PWA.md" | 20 +- ...46\344\271\240\347\254\224\350\256\260.md" | 179 +- docs/FrontEnd/CSS/demo/GridStar.vue | 20 +- ...50\344\273\243\347\240\201\346\256\265.md" | 44 +- ...73\344\271\246\346\221\230\350\246\201.md" | 340 ++-- ...70\347\224\250\346\223\215\344\275\234.md" | 88 +- ...10\347\253\257\347\276\216\345\214\226.md" | 55 +- ...15\345\257\206\347\231\273\345\275\225.md" | 9 +- ...344\270\252\345\271\263\345\217\260SSH.md" | 46 +- .../JavaScript/async\344\270\216await.md" | 114 +- docs/FrontEnd/JavaScript/demo/FilePicker.vue | 2 +- ...06\346\224\257\344\274\230\345\214\226.md" | 3 +- ...07\346\207\222\345\212\240\350\275\275.md" | 47 +- ...00\345\244\215\344\271\240\344\270\200.md" | 93 +- ...00\345\244\215\344\271\240\344\272\214.md" | 452 +++-- ...70\350\247\201\347\256\227\346\263\225.md" | 702 ++++---- .../\346\211\213\345\206\231Promise.md" | 724 ++++---- ...60\346\215\256\345\216\273\351\207\215.md" | 229 +-- ...04\346\261\202\351\233\206\345\220\210.md" | 52 +- ...07\344\273\266\347\263\273\347\273\237.md" | 46 +- ...15\347\275\256\345\261\236\346\200\247.md" | 9 +- ...31\350\241\250\350\276\276\345\274\217.md" | 49 +- ...56\345\275\225\347\273\223\346\236\204.md" | 27 +- ...30\351\230\266\345\207\275\346\225\260.md" | 307 ++-- ...07\344\273\266\350\257\246\350\247\243.md" | 48 +- ...50\347\275\262\350\204\232\346\234\254.md" | 26 +- ...35\345\255\246\347\254\224\350\256\260.md" | 329 ++-- ...77\347\224\250\346\212\200\345\267\247.md" | 3 +- ...07\344\273\266\350\257\246\350\247\243.md" | 102 +- docs/GoodTool/index.md | 9 +- ...52\347\216\257\346\234\272\345\210\266.md" | 38 +- ...67\346\261\202\350\277\207\347\250\213.md" | 49 +- ...27\346\234\272\347\275\221\347\273\234.md" | 11 +- ...00\351\235\242\350\257\225\351\242\230.md" | 154 +- ...66\351\235\242\350\257\225\351\242\230.md" | 30 +- .../Promise\347\233\270\345\205\263.md" | 222 +-- ...16\345\216\237\345\236\213\351\223\276.md" | 77 +- ...00\351\235\242\350\257\225\351\242\230.md" | 223 +-- ...70\347\224\250\346\226\271\346\263\225.md" | 37 +- ...66\351\235\242\350\257\225\351\242\230.md" | 246 ++- ...47\351\235\242\350\257\225\351\242\230.md" | 35 +- ...24\345\274\217\345\216\237\347\220\206.md" | 3 +- ...ue\345\237\272\347\241\200\347\257\207.md" | 5 +- ...60\346\230\216\345\221\250\346\234\237.md" | 54 +- ...47\350\241\214\350\277\207\347\250\213.md" | 4 +- ...71\347\233\256\344\274\230\345\214\226.md" | 26 +- ...50\247\201Path\345\214\272\345\210\253.md" | 13 +- ...32\344\271\211\346\214\207\344\273\244.md" | 70 +- docs/Interview/index.md | 3 +- ...07\346\256\265\351\233\206\351\224\246.md" | 477 +++-- ...77\347\224\250\346\200\273\347\273\223.md" | 28 +- ...56\351\242\230\346\200\273\347\273\223.md" | 159 +- ...71\347\233\256\350\270\251\345\235\221.md" | 32 +- ...51\345\235\221\350\256\260\345\275\225.md" | 113 +- ...51\345\235\221\350\256\260\345\275\225.md" | 25 +- ...56\350\270\251\345\235\221\344\270\200.md" | 321 ++-- docs/Problem/index.md | 5 +- documate.json | 2 +- eslint.config.js | 5 + package.json | 17 +- pnpm-lock.yaml | 1546 ++++++++++++++++- scripts/auto-update-pages.js | 30 +- scripts/generate-sidebar.cjs | 63 +- tsconfig.json | 16 +- vercel.json | 2 +- 94 files changed, 7039 insertions(+), 5006 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 eslint.config.js diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e0b335d5..7e05a499 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,18 +10,18 @@ on: # 任务 jobs: build-and-deploy: - runs-on: ubuntu-latest #部署运行环境搭建 + runs-on: ubuntu-latest # 部署运行环境搭建 steps: - name: Checkout 🛎️ uses: actions/checkout@main with: persist-credentials: false - fetch-depth: 0 #github代码拉取深度 + fetch-depth: 0 # github代码拉取深度 - name: Setup Node 🎬 uses: actions/setup-node@main with: - node-version: "lts/*" - - name: Build 🔧 + node-version: 'lts/*' + - name: Build 🔧 run: | yarn yarn run build @@ -51,7 +51,7 @@ jobs: # source-repo: 'git@github.com:fxzer/zerdocs.git' # # 注意替换为你的 Gitee 目标仓库地址 # destination-repo: 'git@gitee.com:fxzer/zerdocs.git' - + # - name: ✅ Build Gitee Pages #触发Gitee自动部署 # uses: yanglbme/gitee-pages-action@master # with: @@ -59,12 +59,12 @@ jobs: # gitee-username: fxzer # # 注意在 Settings->Secrets 配置 GITEE_PASSWORD # gitee-password: ${{ secrets.GITEE_PASSWORD }} - # # 注意替换为你的 Gitee 仓库 + # # 注意替换为你的 Gitee 仓库 # # 坑点:https://gitee.com/fxzer/zerdocs -->则填:fxzer/zerdocs,注意仓库名和路径名不一致问题 - # gitee-repo: fxzer/zerdocs + # gitee-repo: fxzer/zerdocs # # 要部署的分支 # branch: gh-pages - + # - name: Deploy 🚀 #把打包后的dist文件部署到master分支 # uses: JamesIves/github-pages-deploy-action@4.1.5 # with: diff --git a/.gitignore b/.gitignore index a8c68379..367ce703 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ node_modules docs/.vitepress/cache docs/.vitepress/dist dist -.vscode components.d.ts .idea # local env files diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..eae23ffc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,43 @@ +{ + // Enable the ESlint flat config support + "eslint.experimental.useFlatConfig": true, + + // Disable the default formatter, use eslint instead + "prettier.enable": false, + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml" + ] +} diff --git a/api/index.js b/api/index.js index 8892efaf..1a6ebd25 100644 --- a/api/index.js +++ b/api/index.js @@ -1,4 +1,5 @@ -const express = require('express'); -const app = express(); +const express = require('express') + +const app = express() app.use(express.static('../dist')) -module.exports = app; \ No newline at end of file +module.exports = app diff --git a/docs/.vitepress/theme/UnoCSSLayout.vue b/docs/.vitepress/theme/UnoCSSLayout.vue index 02574b5f..a564aaf2 100644 --- a/docs/.vitepress/theme/UnoCSSLayout.vue +++ b/docs/.vitepress/theme/UnoCSSLayout.vue @@ -6,7 +6,7 @@ const { isDark } = useData() function enableTransitions() { return 'startViewTransition' in document - && window.matchMedia('(prefers-reduced-motion: no-preference)').matches + && window.matchMedia('(prefers-reduced-motion: no-preference)').matches } provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => { @@ -18,8 +18,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => { const clipPath = [ `circle(0px at ${x}px ${y}px)`, `circle(${Math.hypot( - Math.max(x, innerWidth - x), - Math.max(y, innerHeight - y), + Math.max(x, innerWidth - x), + Math.max(y, innerHeight - y), )}px at ${x}px ${y}px)`, ] @@ -40,5 +40,5 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => { diff --git a/docs/.vitepress/theme/components/DemoWrap.vue b/docs/.vitepress/theme/components/DemoWrap.vue index a85eba04..f3d9623c 100644 --- a/docs/.vitepress/theme/components/DemoWrap.vue +++ b/docs/.vitepress/theme/components/DemoWrap.vue @@ -34,7 +34,7 @@ const URL = `${GITHUB_BLOB_URL}${demoPath.value}` \ No newline at end of file + diff --git a/docs/.vitepress/theme/components/RegisterSW.vue b/docs/.vitepress/theme/components/RegisterSW.vue index e5ab6fbc..65ba8a3e 100644 --- a/docs/.vitepress/theme/components/RegisterSW.vue +++ b/docs/.vitepress/theme/components/RegisterSW.vue @@ -2,10 +2,10 @@ import { onBeforeMount, ref } from 'vue' const offlineReady = ref(false) -const onOfflineReady = () => { +function onOfflineReady() { offlineReady.value = true } -const close = async () => { +async function close() { offlineReady.value = false } @@ -26,19 +26,11 @@ onBeforeMount(async () => {