Add pre-commit hook to auto-run/fix prettier and eslint

This commit is contained in:
Matt Rubens
2025-01-17 14:04:37 -05:00
parent 4a6fdf2b18
commit 3bcb4ff8c5
2 changed files with 314 additions and 278 deletions

41
package-lock.json generated
View File

@@ -73,6 +73,7 @@
"jest-simple-dot-reporter": "^1.0.5", "jest-simple-dot-reporter": "^1.0.5",
"lint-staged": "^15.2.11", "lint-staged": "^15.2.11",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^3.4.2",
"ts-jest": "^29.2.5", "ts-jest": "^29.2.5",
"typescript": "^5.4.5" "typescript": "^5.4.5"
}, },
@@ -2733,6 +2734,21 @@
"semver": "^7.5.3" "semver": "^7.5.3"
} }
}, },
"node_modules/@changesets/apply-release-plan/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@changesets/apply-release-plan/node_modules/resolve-from": { "node_modules/@changesets/apply-release-plan/node_modules/resolve-from": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
@@ -2999,6 +3015,21 @@
"prettier": "^2.7.1" "prettier": "^2.7.1"
} }
}, },
"node_modules/@changesets/write/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@esbuild/aix-ppc64": { "node_modules/@esbuild/aix-ppc64": {
"version": "0.24.0", "version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz",
@@ -13217,15 +13248,15 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.8", "version": "3.4.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin/prettier.cjs"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=14"
}, },
"funding": { "funding": {
"url": "https://github.com/prettier/prettier?sponsor=1" "url": "https://github.com/prettier/prettier?sponsor=1"

View File

@@ -1,275 +1,280 @@
{ {
"name": "roo-cline", "name": "roo-cline",
"displayName": "Roo Cline", "displayName": "Roo Cline",
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.", "description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
"publisher": "RooVeterinaryInc", "publisher": "RooVeterinaryInc",
"version": "3.1.6", "version": "3.1.6",
"icon": "assets/icons/rocket.png", "icon": "assets/icons/rocket.png",
"galleryBanner": { "galleryBanner": {
"color": "#617A91", "color": "#617A91",
"theme": "dark" "theme": "dark"
}, },
"engines": { "engines": {
"vscode": "^1.84.0" "vscode": "^1.84.0"
}, },
"author": { "author": {
"name": "Roo Vet" "name": "Roo Vet"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/RooVetGit/Roo-Cline" "url": "https://github.com/RooVetGit/Roo-Cline"
}, },
"homepage": "https://github.com/RooVetGit/Roo-Cline", "homepage": "https://github.com/RooVetGit/Roo-Cline",
"categories": [ "categories": [
"AI", "AI",
"Chat", "Chat",
"Programming Languages", "Programming Languages",
"Education", "Education",
"Snippets", "Snippets",
"Testing" "Testing"
], ],
"keywords": [ "keywords": [
"cline", "cline",
"claude", "claude",
"dev", "dev",
"mcp", "mcp",
"openrouter", "openrouter",
"coding", "coding",
"agent", "agent",
"autonomous", "autonomous",
"chatgpt", "chatgpt",
"sonnet", "sonnet",
"ai", "ai",
"llama" "llama"
], ],
"activationEvents": [ "activationEvents": [
"onLanguage", "onLanguage",
"onStartupFinished" "onStartupFinished"
], ],
"main": "./dist/extension.js", "main": "./dist/extension.js",
"contributes": { "contributes": {
"viewsContainers": { "viewsContainers": {
"activitybar": [ "activitybar": [
{ {
"id": "roo-cline-ActivityBar", "id": "roo-cline-ActivityBar",
"title": "Roo Cline", "title": "Roo Cline",
"icon": "$(rocket)" "icon": "$(rocket)"
} }
] ]
}, },
"views": { "views": {
"roo-cline-ActivityBar": [ "roo-cline-ActivityBar": [
{ {
"type": "webview", "type": "webview",
"id": "roo-cline.SidebarProvider", "id": "roo-cline.SidebarProvider",
"name": "" "name": ""
} }
] ]
}, },
"commands": [ "commands": [
{ {
"command": "roo-cline.plusButtonClicked", "command": "roo-cline.plusButtonClicked",
"title": "New Task", "title": "New Task",
"icon": "$(add)" "icon": "$(add)"
}, },
{ {
"command": "roo-cline.mcpButtonClicked", "command": "roo-cline.mcpButtonClicked",
"title": "MCP Servers", "title": "MCP Servers",
"icon": "$(server)" "icon": "$(server)"
}, },
{ {
"command": "roo-cline.promptsButtonClicked", "command": "roo-cline.promptsButtonClicked",
"title": "Prompts", "title": "Prompts",
"icon": "$(notebook)" "icon": "$(notebook)"
}, },
{ {
"command": "roo-cline.historyButtonClicked", "command": "roo-cline.historyButtonClicked",
"title": "History", "title": "History",
"icon": "$(history)" "icon": "$(history)"
}, },
{ {
"command": "roo-cline.popoutButtonClicked", "command": "roo-cline.popoutButtonClicked",
"title": "Open in Editor", "title": "Open in Editor",
"icon": "$(link-external)" "icon": "$(link-external)"
}, },
{ {
"command": "roo-cline.settingsButtonClicked", "command": "roo-cline.settingsButtonClicked",
"title": "Settings", "title": "Settings",
"icon": "$(settings-gear)" "icon": "$(settings-gear)"
}, },
{ {
"command": "roo-cline.openInNewTab", "command": "roo-cline.openInNewTab",
"title": "Open In New Tab", "title": "Open In New Tab",
"category": "Roo Cline" "category": "Roo Cline"
} }
], ],
"menus": { "menus": {
"view/title": [ "view/title": [
{ {
"command": "roo-cline.plusButtonClicked", "command": "roo-cline.plusButtonClicked",
"group": "navigation@1", "group": "navigation@1",
"when": "view == roo-cline.SidebarProvider" "when": "view == roo-cline.SidebarProvider"
}, },
{ {
"command": "roo-cline.promptsButtonClicked", "command": "roo-cline.promptsButtonClicked",
"group": "navigation@2", "group": "navigation@2",
"when": "view == roo-cline.SidebarProvider" "when": "view == roo-cline.SidebarProvider"
}, },
{ {
"command": "roo-cline.mcpButtonClicked", "command": "roo-cline.mcpButtonClicked",
"group": "navigation@3", "group": "navigation@3",
"when": "view == roo-cline.SidebarProvider" "when": "view == roo-cline.SidebarProvider"
}, },
{ {
"command": "roo-cline.historyButtonClicked", "command": "roo-cline.historyButtonClicked",
"group": "navigation@4", "group": "navigation@4",
"when": "view == roo-cline.SidebarProvider" "when": "view == roo-cline.SidebarProvider"
}, },
{ {
"command": "roo-cline.popoutButtonClicked", "command": "roo-cline.popoutButtonClicked",
"group": "navigation@5", "group": "navigation@5",
"when": "view == roo-cline.SidebarProvider" "when": "view == roo-cline.SidebarProvider"
}, },
{ {
"command": "roo-cline.settingsButtonClicked", "command": "roo-cline.settingsButtonClicked",
"group": "navigation@6", "group": "navigation@6",
"when": "view == roo-cline.SidebarProvider" "when": "view == roo-cline.SidebarProvider"
} }
] ]
}, },
"configuration": { "configuration": {
"title": "RooCline", "title": "RooCline",
"properties": { "properties": {
"roo-cline.allowedCommands": { "roo-cline.allowedCommands": {
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
}, },
"default": [ "default": [
"npm test", "npm test",
"npm install", "npm install",
"tsc", "tsc",
"git log", "git log",
"git diff", "git diff",
"git show" "git show"
], ],
"description": "Commands that can be auto-executed when 'Always approve execute operations' is enabled" "description": "Commands that can be auto-executed when 'Always approve execute operations' is enabled"
}, },
"roo-cline.vsCodeLmModelSelector": { "roo-cline.vsCodeLmModelSelector": {
"type": "object", "type": "object",
"properties": { "properties": {
"vendor": { "vendor": {
"type": "string", "type": "string",
"description": "The vendor of the language model (e.g. copilot)" "description": "The vendor of the language model (e.g. copilot)"
}, },
"family": { "family": {
"type": "string", "type": "string",
"description": "The family of the language model (e.g. gpt-4)" "description": "The family of the language model (e.g. gpt-4)"
} }
}, },
"description": "Settings for VSCode Language Model API" "description": "Settings for VSCode Language Model API"
} }
} }
} }
}, },
"scripts": { "scripts": {
"build": "npm run build:webview && npm run vsix", "build": "npm run build:webview && npm run vsix",
"build:webview": "cd webview-ui && npm run build", "build:webview": "cd webview-ui && npm run build",
"changeset": "changeset", "changeset": "changeset",
"check-types": "tsc --noEmit", "check-types": "tsc --noEmit",
"compile": "npm run check-types && npm run lint && node esbuild.js", "compile": "npm run check-types && npm run lint && node esbuild.js",
"compile-tests": "tsc -p . --outDir out", "compile-tests": "tsc -p . --outDir out",
"install:all": "npm install && cd webview-ui && npm install", "install:all": "npm install && cd webview-ui && npm install",
"lint": "eslint src --ext ts && npm run lint --prefix webview-ui", "lint": "eslint src --ext ts && npm run lint --prefix webview-ui",
"package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production", "package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production",
"pretest": "npm run compile-tests && npm run compile && npm run lint", "pretest": "npm run compile-tests && npm run compile && npm run lint",
"start:webview": "cd webview-ui && npm run start", "start:webview": "cd webview-ui && npm run start",
"test": "jest && npm run test:webview", "test": "jest && npm run test:webview",
"test:webview": "cd webview-ui && npm run test", "test:webview": "cd webview-ui && npm run test",
"test:extension": "vscode-test", "test:extension": "vscode-test",
"prepare": "husky", "prepare": "husky",
"publish:marketplace": "vsce publish && ovsx publish", "publish:marketplace": "vsce publish && ovsx publish",
"publish": "npm run build && changeset publish && npm install --package-lock-only", "publish": "npm run build && changeset publish && npm install --package-lock-only",
"version-packages": "changeset version && npm install --package-lock-only", "version-packages": "changeset version && npm install --package-lock-only",
"vscode:prepublish": "npm run package", "vscode:prepublish": "npm run package",
"vsix": "mkdir -p bin && npx vsce package --out bin", "vsix": "mkdir -p bin && npx vsce package --out bin",
"watch": "npm-run-all -p watch:*", "watch": "npm-run-all -p watch:*",
"watch:esbuild": "node esbuild.js --watch", "watch:esbuild": "node esbuild.js --watch",
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json", "watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
"watch-tests": "tsc -p . -w --outDir out" "watch-tests": "tsc -p . -w --outDir out"
}, },
"devDependencies": { "devDependencies": {
"@changesets/cli": "^2.27.10", "@changesets/cli": "^2.27.10",
"@changesets/types": "^6.0.0", "@changesets/types": "^6.0.0",
"@types/diff": "^5.2.1", "@types/diff": "^5.2.1",
"@types/diff-match-patch": "^1.0.36", "@types/diff-match-patch": "^1.0.36",
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
"@types/mocha": "^10.0.7", "@types/mocha": "^10.0.7",
"@types/node": "20.x", "@types/node": "20.x",
"@types/string-similarity": "^4.0.2", "@types/string-similarity": "^4.0.2",
"@typescript-eslint/eslint-plugin": "^7.14.1", "@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.11.0", "@typescript-eslint/parser": "^7.11.0",
"@vscode/test-cli": "^0.0.9", "@vscode/test-cli": "^0.0.9",
"@vscode/test-electron": "^2.4.0", "@vscode/test-electron": "^2.4.0",
"dotenv": "^16.4.7", "dotenv": "^16.4.7",
"esbuild": "^0.24.0", "esbuild": "^0.24.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-simple-dot-reporter": "^1.0.5", "jest-simple-dot-reporter": "^1.0.5",
"lint-staged": "^15.2.11", "lint-staged": "^15.2.11",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"ts-jest": "^29.2.5", "prettier": "^3.4.2",
"typescript": "^5.4.5" "ts-jest": "^29.2.5",
}, "typescript": "^5.4.5"
"dependencies": { },
"@anthropic-ai/bedrock-sdk": "^0.10.2", "dependencies": {
"@anthropic-ai/sdk": "^0.26.0", "@anthropic-ai/bedrock-sdk": "^0.10.2",
"@anthropic-ai/vertex-sdk": "^0.4.1", "@anthropic-ai/sdk": "^0.26.0",
"@aws-sdk/client-bedrock-runtime": "^3.706.0", "@anthropic-ai/vertex-sdk": "^0.4.1",
"@google/generative-ai": "^0.18.0", "@aws-sdk/client-bedrock-runtime": "^3.706.0",
"@mistralai/mistralai": "^1.3.6", "@google/generative-ai": "^0.18.0",
"@modelcontextprotocol/sdk": "^1.0.1", "@mistralai/mistralai": "^1.3.6",
"@types/clone-deep": "^4.0.4", "@modelcontextprotocol/sdk": "^1.0.1",
"@types/pdf-parse": "^1.1.4", "@types/clone-deep": "^4.0.4",
"@types/tmp": "^0.2.6", "@types/pdf-parse": "^1.1.4",
"@types/turndown": "^5.0.5", "@types/tmp": "^0.2.6",
"@types/vscode": "^1.95.0", "@types/turndown": "^5.0.5",
"@vscode/codicons": "^0.0.36", "@types/vscode": "^1.95.0",
"axios": "^1.7.4", "@vscode/codicons": "^0.0.36",
"cheerio": "^1.0.0", "axios": "^1.7.4",
"chokidar": "^4.0.1", "cheerio": "^1.0.0",
"clone-deep": "^4.0.1", "chokidar": "^4.0.1",
"default-shell": "^2.2.0", "clone-deep": "^4.0.1",
"delay": "^6.0.0", "default-shell": "^2.2.0",
"diff": "^5.2.0", "delay": "^6.0.0",
"diff-match-patch": "^1.0.5", "diff": "^5.2.0",
"fast-deep-equal": "^3.1.3", "diff-match-patch": "^1.0.5",
"fastest-levenshtein": "^1.0.16", "fast-deep-equal": "^3.1.3",
"globby": "^14.0.2", "fastest-levenshtein": "^1.0.16",
"isbinaryfile": "^5.0.2", "globby": "^14.0.2",
"mammoth": "^1.8.0", "isbinaryfile": "^5.0.2",
"monaco-vscode-textmate-theme-converter": "^0.1.7", "mammoth": "^1.8.0",
"openai": "^4.78.1", "monaco-vscode-textmate-theme-converter": "^0.1.7",
"os-name": "^6.0.0", "openai": "^4.78.1",
"p-wait-for": "^5.0.2", "os-name": "^6.0.0",
"pdf-parse": "^1.1.1", "p-wait-for": "^5.0.2",
"puppeteer-chromium-resolver": "^23.0.0", "pdf-parse": "^1.1.1",
"puppeteer-core": "^23.4.0", "puppeteer-chromium-resolver": "^23.0.0",
"serialize-error": "^11.0.3", "puppeteer-core": "^23.4.0",
"simple-git": "^3.27.0", "serialize-error": "^11.0.3",
"sound-play": "^1.1.0", "simple-git": "^3.27.0",
"string-similarity": "^4.0.4", "sound-play": "^1.1.0",
"strip-ansi": "^7.1.0", "string-similarity": "^4.0.4",
"tmp": "^0.2.3", "strip-ansi": "^7.1.0",
"tree-sitter-wasms": "^0.1.11", "tmp": "^0.2.3",
"turndown": "^7.2.0", "tree-sitter-wasms": "^0.1.11",
"web-tree-sitter": "^0.22.6", "turndown": "^7.2.0",
"zod": "^3.23.8" "web-tree-sitter": "^0.22.6",
}, "zod": "^3.23.8"
"lint-staged": { },
"src/**/*.{ts,tsx}": [ "lint-staged": {
"npx eslint -c .eslintrc.json" "*.{js,jsx,ts,tsx,json,css,md}": [
] "prettier --write"
} ],
"src/**/*.{ts,tsx}": [
"prettier --write",
"npx eslint -c .eslintrc.json --fix"
]
}
} }