feat: 添加 ESLint 配置并优化代码风格,移除未使用的功能

This commit is contained in:
Elysia
2026-02-12 18:31:09 +08:00
parent b43c6117ec
commit e11740ad4c
14 changed files with 65 additions and 114 deletions

17
eslint.config.ts Normal file
View File

@@ -0,0 +1,17 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import { defineConfig, globalIgnores } from "eslint/config";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
export default defineConfig([
globalIgnores(["**/3rdparty/**", "**/node_modules/**", "**/dist/**", "**/dist-electron/**"]),
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,vue}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: { ...globals.browser, ...globals.node } } },
tseslint.configs.recommended,
pluginVue.configs["flat/essential"],
{ files: ["**/*.vue"], languageOptions: { parserOptions: { parser: tseslint.parser } } },
eslintConfigPrettier,
eslintPluginPrettierRecommended,
]);