diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1a37dd8 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,10 @@ +/lambda/ +/scripts +/config +.history +public +dist +.umi +mock +node_modules +coverage diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 09c2e42..0000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@antfu" -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..59ca770 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: 🔀 Checkout Git Source + uses: actions/checkout@v4 + + - name: 📦 Install pnpm + uses: pnpm/action-setup@v2 + + - name: 🚀 Use Node.js lts/* + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: 📦 Install Dependencies + run: pnpm i + + - name: ✅ Lint + run: pnpm lint + + buildWeb: + runs-on: ubuntu-latest + + steps: + - name: 🔀 Checkout Git Source + uses: actions/checkout@v4 + + - name: 📦 Install pnpm + uses: pnpm/action-setup@v2 + + - name: 🚀 Use Node.js lts/* + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: 📦 Install Dependencies + run: pnpm i + + - name: 🚧 Set up project + run: pnpm postinstall + + - name: 🚧 Build + run: pnpm build + + - name: 💪 Typecheck + run: pnpm typecheck diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..92332e1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +permissions: + contents: write + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [lts/*] + steps: + - name: 🔀 Checkout Git Source + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: 🚀 Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - name: 🔖 Release + run: npx changelogithub + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.nvmrc b/.nvmrc index 860cc50..7ea6a59 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.17.1 +v20.11.0 diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 4a2da08..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recommendations": [ - "antfu.iconify", - "antfu.unocss", - "antfu.goto-alias", - "csstools.postcss", - "dbaeumer.vscode-eslint", - "vue.volar" - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 2610620..9a631a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,42 @@ { + // 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": true + "source.fixAll": "explicit", + "source.organizeImports": "never" }, - "files.associations": { - "*.css": "postcss" - }, - "editor.formatOnSave": false + + // 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" + ] } diff --git a/app.vue b/app.vue index 6deeeb1..9be0cf6 100644 --- a/app.vue +++ b/app.vue @@ -3,9 +3,9 @@ useHead({ title: 'Ding Xiao Hui', link: [ { - rel: 'icon', type: 'image/png', href: '/nuxt.png', - }, - ], + rel: 'icon', type: 'image/png', href: '/nuxt.png' + } + ] }) @@ -18,7 +18,9 @@ useHead({