ESLint: +29 条 P1/P2 规则 + 12 条 TS 专属规则(含 no-shadow/no-array-constructor 冲突处理) Stylelint: 集成 stylelint-config-recommended + 27 条额外规则 PMD: 排除 20 弃用 + 17 噪音规则,补启 Security/Multithreading,274+12 条精选 SQL-lint: 内置精选 57 条规则配置 + 按 tier 分级 severity + 无项目配置时自动注入临时配置 模板导出: export-service.ts 导出 2-sheet xlsx(复用 xlsx 零新依赖) 模板导入: template-converter.ts 固定列映射解析 + dedup-prompt.ts AI 语义去重 导入预览增强: 错误规则分组置顶只读、跳过行提示、空数据提示 i18n: 新增 18 条模板导入/导出相关翻译 WebView: 静态分析/自定义规则项默认可展开显示 suggestion
295 lines
8.3 KiB
JSON
295 lines
8.3 KiB
JSON
{
|
|
"name": "vscode-code-reviewer",
|
|
"displayName": "净码特工 · Code Purifier",
|
|
"description": "AI 驱动的代码审查与规范检查一体化 VSCode 插件",
|
|
"version": "1.2.0",
|
|
"engines": {
|
|
"vscode": "^1.120.0"
|
|
},
|
|
"categories": [
|
|
"Other"
|
|
],
|
|
"activationEvents": [],
|
|
"main": "./out/extension.js",
|
|
"contributes": {
|
|
"commands": [
|
|
{
|
|
"command": "codeReviewer.review",
|
|
"title": "Code Purifier: 运行代码审查"
|
|
},
|
|
{
|
|
"command": "codeReviewer.reviewSelection",
|
|
"title": "Code Purifier: 审查选中代码"
|
|
},
|
|
{
|
|
"command": "codeReviewer.openPanel",
|
|
"title": "Code Purifier: 打开审查面板"
|
|
},
|
|
{
|
|
"command": "codeReviewer.exportReport",
|
|
"title": "Code Purifier: 导出报告"
|
|
},
|
|
{
|
|
"command": "codeReviewer.addCustomRule",
|
|
"title": "Code Purifier: 添加自定义规则"
|
|
},
|
|
{
|
|
"command": "codeReviewer.fixIssue",
|
|
"title": "Code Purifier: 修复此问题"
|
|
},
|
|
{
|
|
"command": "codeReviewer.fixAll",
|
|
"title": "Code Purifier: 批量修复"
|
|
},
|
|
{
|
|
"command": "codeReviewer.openSetup",
|
|
"title": "Code Purifier: 打开设置面板"
|
|
},
|
|
{
|
|
"command": "codeReviewer.exportTemplate",
|
|
"title": "Code Purifier: 导出规则模板"
|
|
}
|
|
],
|
|
"keybindings": [
|
|
{
|
|
"command": "codeReviewer.review",
|
|
"key": "ctrl+shift+r",
|
|
"when": "editorTextFocus"
|
|
}
|
|
],
|
|
"viewsContainers": {
|
|
"activitybar": [
|
|
{
|
|
"id": "code-reviewer",
|
|
"title": "Code Purifier",
|
|
"icon": "images/icon.png"
|
|
}
|
|
]
|
|
},
|
|
"views": {
|
|
"code-reviewer": [
|
|
{
|
|
"type": "webview",
|
|
"id": "codeReviewer.setupView",
|
|
"name": "设置"
|
|
}
|
|
]
|
|
},
|
|
"menus": {
|
|
"editor/context": [
|
|
{
|
|
"command": "codeReviewer.review",
|
|
"group": "navigation"
|
|
},
|
|
{
|
|
"command": "codeReviewer.reviewSelection",
|
|
"when": "editorHasSelection"
|
|
}
|
|
]
|
|
},
|
|
"configuration": {
|
|
"title": "Code Purifier",
|
|
"properties": {
|
|
"vscode-code-reviewer.ai.provider": {
|
|
"type": "string",
|
|
"default": "deepseek",
|
|
"description": "AI 模型提供商"
|
|
},
|
|
"vscode-code-reviewer.ai.model": {
|
|
"type": "string",
|
|
"default": "deepseek-chat",
|
|
"description": "AI 模型名称"
|
|
},
|
|
"vscode-code-reviewer.ai.baseUrl": {
|
|
"type": "string",
|
|
"default": "https://api.deepseek.com/v1",
|
|
"description": "API Base URL"
|
|
},
|
|
"vscode-code-reviewer.ai.temperature": {
|
|
"type": "number",
|
|
"default": 0.2,
|
|
"description": "AI 温度参数"
|
|
},
|
|
"vscode-code-reviewer.ai.maxTokens": {
|
|
"type": "number",
|
|
"default": 8192,
|
|
"description": "AI 单次请求最大输出 Token 数"
|
|
},
|
|
"vscode-code-reviewer.ai.timeout": {
|
|
"type": "number",
|
|
"default": 300,
|
|
"description": "AI 请求超时(秒)"
|
|
},
|
|
"vscode-code-reviewer.ai.outputLanguage": {
|
|
"type": "string",
|
|
"default": "zh-CN",
|
|
"enum": [
|
|
"zh-CN",
|
|
"en",
|
|
"ja"
|
|
],
|
|
"description": "插件语言"
|
|
},
|
|
"vscode-code-reviewer.linters.javascript": {
|
|
"type": "string",
|
|
"default": "eslint",
|
|
"enum": [
|
|
"",
|
|
"eslint"
|
|
],
|
|
"description": "JavaScript linter"
|
|
},
|
|
"vscode-code-reviewer.linters.typescript": {
|
|
"type": "string",
|
|
"default": "eslint",
|
|
"enum": [
|
|
"",
|
|
"eslint"
|
|
],
|
|
"description": "TypeScript linter"
|
|
},
|
|
"vscode-code-reviewer.linters.java": {
|
|
"type": "string",
|
|
"default": "pmd",
|
|
"enum": [
|
|
"",
|
|
"pmd"
|
|
],
|
|
"description": "Java linter"
|
|
},
|
|
"vscode-code-reviewer.linters.jsp": {
|
|
"type": "string",
|
|
"default": "jsp",
|
|
"enum": [
|
|
"",
|
|
"jsp"
|
|
],
|
|
"description": "JSP linter"
|
|
},
|
|
"vscode-code-reviewer.linters.html": {
|
|
"type": "string",
|
|
"default": "jsp",
|
|
"enum": [
|
|
"",
|
|
"jsp"
|
|
],
|
|
"description": "HTML linter"
|
|
},
|
|
"vscode-code-reviewer.linters.css": {
|
|
"type": "string",
|
|
"default": "stylelint",
|
|
"enum": [
|
|
"",
|
|
"stylelint"
|
|
],
|
|
"description": "CSS linter"
|
|
},
|
|
"vscode-code-reviewer.linters.sql": {
|
|
"type": "string",
|
|
"default": "sql-lint",
|
|
"enum": [
|
|
"",
|
|
"sql-lint"
|
|
],
|
|
"description": "SQL linter"
|
|
},
|
|
"vscode-code-reviewer.linters.plsql": {
|
|
"type": "string",
|
|
"default": "sql-lint",
|
|
"enum": [
|
|
"",
|
|
"sql-lint"
|
|
],
|
|
"description": "PL/SQL linter"
|
|
},
|
|
"vscode-code-reviewer.pmd.jarPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "PMD jar 路径(空=使用插件内置)"
|
|
},
|
|
"vscode-code-reviewer.pmd.rulesetPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Java 规则集 XML 路径(空=使用内置)"
|
|
},
|
|
"vscode-code-reviewer.pmd.jspRulesetPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "JSP 规则集 XML 路径(空=使用内置)"
|
|
},
|
|
"vscode-code-reviewer.sql-lint.configFile": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "sqlfluff 配置文件路径"
|
|
},
|
|
"vscode-code-reviewer.linters.eslintConfigPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "ESLint 自定义配置文件路径(绝对路径)。留空则使用项目 .eslintrc 或内置规则"
|
|
},
|
|
"vscode-code-reviewer.linters.stylelintConfigPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Stylelint 自定义配置文件路径(绝对路径)。留空则使用项目 .stylelintrc 或内置规则"
|
|
},
|
|
"vscode-code-reviewer.linter.pmd.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 PMD 适配器"
|
|
},
|
|
"vscode-code-reviewer.linter.sql-lint.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 SQL-Lint 适配器"
|
|
},
|
|
"vscode-code-reviewer.linter.eslint.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 ESLint 适配器"
|
|
},
|
|
"vscode-code-reviewer.linter.stylelint.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 Stylelint 适配器"
|
|
},
|
|
"vscode-code-reviewer.fixer.contextLines": {
|
|
"type": "number",
|
|
"default": 5,
|
|
"description": "AI 修复时提取的上下文行数"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"scripts": {
|
|
"compile": "tsc -p ./ && node scripts/copy-webview-js.mjs",
|
|
"watch": "tsc -watch -p ./",
|
|
"build": "node scripts/build.mjs",
|
|
"vscode:prepublish": "npm run build",
|
|
"download-pmd": "node scripts/download-pmd.mjs",
|
|
"package-prod": "node scripts/package-prod.mjs",
|
|
"pretest": "npm run compile && npm run lint",
|
|
"lint": "eslint src",
|
|
"test": "vscode-test"
|
|
},
|
|
"dependencies": {
|
|
"@eslint/js": "^9.39.3",
|
|
"eslint": "^9.39.3",
|
|
"mammoth": "^1.12.0",
|
|
"officeparser": "^7.5.0",
|
|
"stylelint": "^17.14.0",
|
|
"stylelint-config-recommended": "^18.0.0",
|
|
"typescript-eslint": "^8.56.1",
|
|
"xlsx": "^0.18.5"
|
|
},
|
|
"devDependencies": {
|
|
"@types/mocha": "^10.0.10",
|
|
"@types/node": "22.x",
|
|
"@types/vscode": "^1.120.0",
|
|
"@vscode/test-cli": "^0.0.12",
|
|
"@vscode/test-electron": "^2.5.2",
|
|
"@vscode/vsce": "^3.9.2",
|
|
"esbuild": "^0.28.1",
|
|
"typescript": "^5.9.3"
|
|
}
|
|
}
|