diff --git a/.github/workflows/bun.yml b/.github/workflows/bun.yml index 76fef51..bb1713a 100644 --- a/.github/workflows/bun.yml +++ b/.github/workflows/bun.yml @@ -5,7 +5,7 @@ name: Bun CI on: push: - branches: [ "master" ] + branches: [master] env: DOCKERHUB_SLUG: megghy/vtsuru_live @@ -21,47 +21,47 @@ jobs: packages: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Use bun - uses: oven-sh/setup-bun@v2 + - name: Use bun + uses: oven-sh/setup-bun@v2 - - name: 📥 Install dependencies - run: bun install + - name: 📥 Install dependencies + run: bun install - - name: 📦 Build - run: bun run build + - name: 📦 Build + run: bun run build - - name: 📦 Upload SourceMap - run: bunx @hyperdx/cli upload-sourcemaps --serviceKey ${{ secrets.HYPERDX_SERVICE_KEY }} --path dist/assets - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: 📦 Upload SourceMap + run: bunx @hyperdx/cli upload-sourcemaps --serviceKey ${{ secrets.HYPERDX_SERVICE_KEY }} --path dist/assets - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.DOCKERHUB_SLUG }} - ${{ env.GHCR_SLUG }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Get current time - uses: josStorer/get-current-time@v2 - id: time - with: - format: YYYYMMDD_HHmmss - utcOffset: "+08:00" + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.DOCKERHUB_SLUG }} + ${{ env.GHCR_SLUG }} - - name: Build Docker image and push - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: | - ${{ env.GHCR_SLUG }}:latest - ${{ env.GHCR_SLUG }}:${{ steps.time.outputs.formattedTime }} + - name: Get current time + uses: josStorer/get-current-time@v2 + id: time + with: + format: YYYYMMDD_HHmmss + utcOffset: '+08:00' + + - name: Build Docker image and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: | + ${{ env.GHCR_SLUG }}:latest + ${{ env.GHCR_SLUG }}:${{ steps.time.outputs.formattedTime }} diff --git a/.oxlintrc.json b/.oxlintrc.json index f7dcf8d..a82973a 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,43 +1,9 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", - "plugins": [ - "typescript" - ], - "categories": { - "correctness": "off" - }, + "plugins": ["typescript", "vue"], "env": { "builtin": true, "browser": true }, - "rules": { - - }, - - "overrides": [ - { - "files": [ - "**/*.js", - "**/*.jsx" - ], - "rules": { - "no-console": "off", - "no-debugger": "off", - "vue/no-mutating-props": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-var-requires": "warn" - } - }, - { - "files": [ - "**/*.ts", - "**/*.tsx", - "**/*.vue" - ], - "rules": { - "@typescript-eslint/no-explicit-any": "off", - "vue/no-mutating-props": "off" - } - } - ] -} \ No newline at end of file + "rules": {} +} diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index a5c69cf..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "tabWidth": 2, - "semi": false, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 80 -} \ No newline at end of file diff --git a/README.md b/README.md index 166f220..5d7f760 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,4 @@ bun run lint ``` ### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/). \ No newline at end of file +See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/bun.lockb b/bun.lockb index 9f11ac5..3fa5256 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/default.d.ts b/default.d.ts index 39c2151..391c8cf 100644 --- a/default.d.ts +++ b/default.d.ts @@ -1,4 +1,3 @@ - import type { DialogProviderInst, LoadingBarProviderInst, MessageProviderInst, ModalProviderInst, NotificationProviderInst } from 'naive-ui' import type { useRoute } from 'vue-router' diff --git a/eslint.config.mjs b/eslint.config.mjs index 617605f..dfe33ff 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,5 +1,6 @@ import antfu from '@antfu/eslint-config' import VueVine from '@vue-vine/eslint-config' +import oxlint from 'eslint-plugin-oxlint' export default antfu( { @@ -64,7 +65,7 @@ export default antfu( // 通用规则 'no-console': 'off', 'unused-imports/no-unused-vars': 'warn', - + // 关闭一些过于严格的规则 'antfu/if-newline': 'off', 'style/brace-style': ['error', '1tbs'], @@ -72,4 +73,6 @@ export default antfu( }, // 集成 VueVine 配置 ...VueVine(), + // 集成 oxlint 配置 - 必须放在最后以禁用与 oxlint 冲突的 ESLint 规则 + oxlint.buildFromOxlintConfigFile('./.oxlintrc.json'), ) diff --git a/package.json b/package.json index 35e3f74..8583ae5 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "vtsuru.live", + "type": "module", "version": "0.1.0", "private": true, - "type": "module", "scripts": { "dev": "bunx --bun vite", "build": "vite build", - "lint": "vite lint", + "lint": "oxlint && eslint .", + "lint:fix": "oxlint --fix && eslint . --fix", "knip": "knip" }, "dependencies": { @@ -63,7 +64,7 @@ "unplugin-vue-components": "^29.1.0", "unplugin-vue-markdown": "^29.2.0", "uuid": "^13.0.0", - "vite": "7.1.7", + "vite": "npm:rolldown-vite@latest", "vite-svg-loader": "^5.1.0", "vue": "3.5.22", "vue-cropperjs": "^5.0.0", @@ -87,6 +88,8 @@ "@vitejs/plugin-vue-jsx": "^5.1.1", "@vue-vine/eslint-config": "^1.1.9", "eslint": "^9.36.0", + "eslint-plugin-oxlint": "^1.19.0", + "oxlint": "^1.19.0", "stylus": "^0.64.0", "typescript": "^5.9.2", "vue-vine": "^1.7.6" diff --git a/src/App.vue b/src/App.vue index 9bfa454..4a66542 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,4 @@ diff --git a/src/client/ClientLayout.vue b/src/client/ClientLayout.vue index 92adfc3..7c05da7 100644 --- a/src/client/ClientLayout.vue +++ b/src/client/ClientLayout.vue @@ -1,134 +1,134 @@ \ No newline at end of file + diff --git a/src/client/ClientSettings.vue b/src/client/ClientSettings.vue index 6d06e6b..eac1d6c 100644 --- a/src/client/ClientSettings.vue +++ b/src/client/ClientSettings.vue @@ -1,122 +1,123 @@ \ No newline at end of file + diff --git a/src/client/ClientTest.vue b/src/client/ClientTest.vue index 16df4d3..5b74a33 100644 --- a/src/client/ClientTest.vue +++ b/src/client/ClientTest.vue @@ -1,11 +1,10 @@ @@ -30,9 +29,9 @@ async function testNotification() { - 弹幕机 + 弹幕机 - \ No newline at end of file + diff --git a/src/client/DanmakuWindowManager.vue b/src/client/DanmakuWindowManager.vue index 4e0391f..ad28013 100644 --- a/src/client/DanmakuWindowManager.vue +++ b/src/client/DanmakuWindowManager.vue @@ -1,19 +1,19 @@