diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index dc3bc09..0000000 --- a/.browserslistrc +++ /dev/null @@ -1,4 +0,0 @@ -> 1% -last 2 versions -not dead -not ie 11 diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 5a345e1..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - '@vue/typescript/recommended', - 'plugin:vue/vue3-essential', - 'prettier', - '@vue/eslint-config-typescript', - 'plugin:oxlint/recommended', - ], - parserOptions: { - ecmaVersion: 'latest', - }, - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'vue/component-name-in-template-casing': ['error', 'PascalCase'], - 'vue/no-mutating-props': ['off'], - '@typescript-eslint/no-explicit-any': ['off'], - '@typescript-eslint/no-var-requires': ['warn'], - }, - overrides: [ - { - files: ['**/*.ts', '**/*.tsx'], - parser: '@typescript-eslint/parser', - extends: [ - '@vue/typescript/recommended', - // other TypeScript specific configurations... - ], - rules: { - // TypeScript specific rules... - '@typescript-eslint/no-explicit-any': ['off'], - }, - }, - ], -} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..f7dcf8d --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,43 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "typescript" + ], + "categories": { + "correctness": "off" + }, + "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 diff --git a/bun.lockb b/bun.lockb index 8dab163..87fc19c 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/default.d.ts b/default.d.ts index 32671c5..f666223 100644 --- a/default.d.ts +++ b/default.d.ts @@ -1,5 +1,6 @@ -import { LoadingBarProviderInst, MessageProviderInst } from 'naive-ui' -import { useRoute } from 'vue-router' + +import type { LoadingBarProviderInst, MessageProviderInst } from 'naive-ui' +import type { useRoute } from 'vue-router' declare module 'vue3-aplayer' { const content: any diff --git a/eslint.config.cjs b/eslint.config.cjs deleted file mode 100644 index 9bcbb91..0000000 --- a/eslint.config.cjs +++ /dev/null @@ -1,61 +0,0 @@ -// eslint.config.js -module.exports = [ - { - name: 'base', - root: true, - env: { - node: true, - }, - languageOptions: { - ecmaVersion: 'latest', - parser: '@typescript-eslint/parser', - sourceType: 'module', // Assumed based on the usage of TypeScript and modules - }, - globals: {}, // Define any global variables if needed - linterOptions: { - reportUnusedDisableDirectives: 'error', // Adjust based on preference - }, - plugins: { - vue: require('eslint-plugin-vue'), - '@typescript-eslint': require('@typescript-eslint/eslint-plugin'), - prettier: require('eslint-plugin-prettier'), - oxlint: require('eslint-plugin-oxlint'), - }, - settings: {}, // Add shared settings here if necessary - ignores: [ - // Patterns for files to ignore, adjust as necessary - ], - files: ['**/*.js', '**/*.jsx'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'vue/component-name-in-template-casing': ['error', 'PascalCase'], - 'vue/no-mutating-props': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-var-requires': 'warn', - }, - extends: [ - '@vue/typescript/recommended', - 'plugin:vue/vue3-essential', - 'prettier', - '@vue/eslint-config-typescript', - 'plugin:oxlint/recommended', - ], - }, - { - name: 'TypeScript', - files: ['**/*.ts', '**/*.tsx'], - languageOptions: { - parser: '@typescript-eslint/parser', - sourceType: 'module', // Explicitly defined for TypeScript files - }, - rules: { - // TypeScript specific rules overwrites or additions - '@typescript-eslint/no-explicit-any': 'off', - }, - extends: [ - '@vue/typescript/recommended', - // TypeScript specific extended configurations... - ], - }, -] diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..70a4b80 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,28 @@ +import oxlint from 'eslint-plugin-oxlint'; +import vue from 'eslint-plugin-vue'; +import ts from 'typescript-eslint'; + +// `VueVine()` 返回一个 ESLint flat config +import VueVine from '@vue-vine/eslint-config' + +export default [ + { + languageOptions: { + ecmaVersion: 'latest', + }, + }, + ...vue.configs['flat/recommended'], + { + // files: ['*.vue', '**/*.vue'], + languageOptions: { + parserOptions: { + parser: ts.parser, + }, + }, + rules: { + "vue/no-mutating-props": "off", + }, + }, + ...VueVine(), + ...oxlint.configs['flat/recommended'], // oxlint should be the last one +] diff --git a/package.json b/package.json index a88a298..ddea64d 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,13 @@ "lint": "vite lint" }, "dependencies": { + "@antfu/ni": "^24.3.0", "@hyperdx/browser": "^0.21.2", "@hyperdx/cli": "^0.1.0", "@microsoft/signalr": "^8.0.7", "@microsoft/signalr-protocol-msgpack": "^8.0.7", "@mixer/postmessage-rpc": "^1.1.4", - "@typescript-eslint/eslint-plugin": "^8.26.1", + "@typescript-eslint/eslint-plugin": "^8.27.0", "@vicons/fluent": "^0.13.0", "@vitejs/plugin-basic-ssl": "^2.0.0", "@vitejs/plugin-vue": "^5.2.3", @@ -28,10 +29,9 @@ "date-fns": "^4.1.0", "easy-speech": "^2.4.0", "echarts": "^5.6.0", - "eslint": "^9.22.0", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-oxlint": "^0.16.0", - "eslint-plugin-prettier": "^5.2.3", + "eslint-plugin-oxlint": "^0.16.2", + "eslint-plugin-prettier": "^5.2.4", "fast-xml-parser": "^5.0.9", "file-saver": "^2.0.5", "grapheme-splitter": "^1.0.4", @@ -40,15 +40,19 @@ "mitt": "^3.0.1", "monaco-editor": "^0.52.2", "music-metadata-browser": "^2.5.11", + "oxlint": "^0.16.2", "peerjs": "^1.5.4", "pinia": "^3.0.1", "prettier": "^3.5.3", "qrcode.vue": "^3.6.0", "queue-typescript": "^1.0.1", + "unplugin-auto-import": "^19.1.1", + "unplugin-vue-components": "^28.4.1", "unplugin-vue-markdown": "^28.3.1", "uuid": "^11.1.0", "vite": "6.2.2", "vite-plugin-monaco-editor": "^1.1.0", + "vite-plugin-oxlint": "^1.3.0", "vite-svg-loader": "^5.1.0", "vue": "3.5.13", "vue-echarts": "^7.0.3", @@ -62,19 +66,23 @@ "xlsx": "^0.18.5" }, "devDependencies": { - "@eslint/eslintrc": "^3.3.0", + "@eslint/eslintrc": "^3.3.1", "@types/bun": "^1.2.5", "@types/eslint": "^9.6.1", + "@types/file-saver": "^2.0.7", "@types/obs-studio": "^2.17.2", "@types/uuid": "^10.0.0", - "@typescript-eslint/parser": "^8.26.1", + "@typescript-eslint/parser": "^8.27.0", "@vicons/ionicons5": "^0.13.0", "@vitejs/plugin-vue-jsx": "^4.1.2", + "@vue-vine/eslint-config": "^0.2.19", "@vue/eslint-config-typescript": "^14.5.0", + "eslint": "^9.23.0", "eslint-config-prettier": "^10.1.1", "eslint-plugin-vue": "^10.0.0", "naive-ui": "^2.41.0", "stylus": "^0.64.0", - "typescript": "^5.8.2" + "typescript": "^5.8.2", + "vue-vine": "^0.3.19" } -} \ No newline at end of file +} diff --git a/src/App.vue b/src/App.vue index a7088f7..710cba0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,65 @@ + + - - diff --git a/src/views/manage/BiliVerifyView.vue b/src/views/manage/BiliVerifyView.vue index dd4b71b..2cf9752 100644 --- a/src/views/manage/BiliVerifyView.vue +++ b/src/views/manage/BiliVerifyView.vue @@ -86,55 +86,115 @@ onMounted(async () => {