Files
ledgerly/frontend/package.json
T
rosercode 6439d336d4 chore: 前后端引入代码检查工具并整改存量问题
为统一前后端代码规范与质量,前端引入 ESLint + Prettier,后端在 Spotless 之外新增 Checkstyle 与 SpotBugs,检查接入构建与打包流程并失败即阻断,同时一次性整改全部存量告警,检查范围为后端主源码与前端源码。

变更内容:
- 前端新增 ESLint(flat config)与 Prettier 配置及 lint / lint:fix / format / format:check 脚本,并新增对应开发依赖
- 后端 build.gradle 应用 checkstyle 与 com.github.spotbugs 插件,新增 gradle/checkstyle/checkstyle.xml、suppressions.xml 与 gradle/spotbugs/exclude.xml
- 新增 Gradle frontendLint 任务并作为 frontendBuild 前置,新增 lint 聚合任务(Spotless + Checkstyle + SpotBugs + 前端 ESLint)
- 修复后端 Checkstyle 1 处(补花括号)与 SpotBugs 17 处(getParent() 判空、拆装箱冗余、异常捕获与日志、volatile 同步等),并按设计豁免值对象引用暴露等告警
- 修复前端规则问题(未使用变量、无意义赋值、v-for key、v-html 安全提示)并格式化存量文件
- README 补充依赖安装、代码检查与打包说明

说明:
- SpotBugs 工具版本固定为 4.8.6,规避其 BCEL 与 Spring Boot BOM 选定 commons-lang3 3.14.0 的 NoSuchMethodError
- 检查范围仅主源码,src/test/ 本地测试不纳入 Checkstyle/SpotBugs
- 前端格式化统一为无分号、单引号、行宽 120、LF,与 .gitattributes 保持一致
2026-10-12 13:06:10 +08:00

48 lines
1.2 KiB
JSON

{
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"dependencies": {
"@fontsource/jetbrains-mono": "^5.3.0",
"@vicons/ionicons5": "^0.13.0",
"axios": "^1.20.0",
"echarts": "^6.1.0",
"highlight.js": "^11.12.0",
"naive-ui": "^2.45.2",
"node-forge": "^1.3.1",
"pinia": "^4.0.3",
"sql-formatter": "^15.9.0",
"vue": "^3.5.41",
"vue-echarts": "^8.1.0",
"vue-i18n": "^11.4.12",
"vue-router": "^4.6.4",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^24.13.3",
"@types/node-forge": "^1.3.11",
"@vitejs/plugin-vue": "^6.0.8",
"@vue/tsconfig": "^0.9.1",
"eslint": "^10.12.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-vue": "^10.11.1",
"globals": "^17.13.0",
"prettier": "^3.9.10",
"typescript": "~6.0.2",
"typescript-eslint": "^8.71.1",
"vite": "^8.2.2",
"vue-tsc": "^3.3.11"
}
}