diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63e8da0a..d1caf2b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,27 @@ repos: -- repo: https://github.com/astral-sh/ruff-pre-commit - # Ruff version. - rev: v0.11.7 - hooks: - # Run the linter of backend. - - id: ruff - # Run the formatter of backend. - - id: ruff-format + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.11.7 + hooks: + # Run the linter of backend. + - id: ruff + args: [--fix] + # Run the formatter of backend. + - id: ruff-format + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + types_or: [javascript, jsx, ts, tsx, json, css, scss, yaml] + additional_dependencies: + - prettier@3.1.0 + + - repo: local + hooks: + - id: lint-staged + name: lint-staged + entry: cd web && pnpm lint-staged + language: system + types: [javascript, jsx, ts, tsx] + pass_filenames: false diff --git a/pkg/core/boot.py b/pkg/core/boot.py index 6f5490f8..b8c5a974 100644 --- a/pkg/core/boot.py +++ b/pkg/core/boot.py @@ -25,7 +25,6 @@ stage_order = [ async def make_app(loop: asyncio.AbstractEventLoop) -> app.Application: - # 确定是否为调试模式 if 'DEBUG' in os.environ and os.environ['DEBUG'] in ['true', '1']: constants.debug_mode = True diff --git a/web/.husky/pre-commit b/web/.husky/pre-commit deleted file mode 100644 index aa89fa4b..00000000 --- a/web/.husky/pre-commit +++ /dev/null @@ -1,2 +0,0 @@ -cd web -pnpm lint-staged diff --git a/web/package.json b/web/package.json index 2e6aed98..8894e743 100644 --- a/web/package.json +++ b/web/package.json @@ -7,9 +7,14 @@ "build": "next build", "start": "next start", "lint": "next lint", - "prepare": "cd .. && husky web/.husky", "lint-staged": "lint-staged" }, + "lint-staged": { + "*.{js,jsx,ts,tsx}": [ + "next lint --fix", + "prettier --write" + ] + }, "dependencies": { "@hookform/resolvers": "^5.0.1", "@radix-ui/react-checkbox": "^1.3.1", @@ -49,7 +54,6 @@ "eslint-config-next": "15.2.4", "eslint-config-prettier": "^10.1.2", "eslint-plugin-prettier": "^5.2.6", - "husky": "^9.1.7", "lint-staged": "^15.5.1", "prettier": "^3.5.3", "tw-animate-css": "^1.2.9", diff --git a/web/src/app/home/plugins/page.tsx b/web/src/app/home/plugins/page.tsx index c66f3a25..4be10db3 100644 --- a/web/src/app/home/plugins/page.tsx +++ b/web/src/app/home/plugins/page.tsx @@ -44,6 +44,7 @@ export default function PluginConfigPage() { const taskId = resp.task_id; let alreadySuccess = false; + console.log('taskId:', taskId); // 每秒拉取一次任务状态 const interval = setInterval(() => {