Skip to content

Commit

Permalink
Add husky/lint-staged to auto-format pre-commit (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Oct 27, 2024
1 parent 87cbd03 commit d1f9302
Show file tree
Hide file tree
Showing 3 changed files with 350 additions and 5 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lint:fix": "eslint --fix --ext .ts,.tsx .",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"prepare": "husky",
"make": "yarn run vite:compile && electron-builder build --config=builder-debug.config.ts",
"make:assets:amd": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --amd --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && mkdir -p ComfyUI/user/default",
"make:assets:cpu": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --cpu --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && node ../scripts/env.mjs && mkdir -p ComfyUI/user/default",
Expand Down Expand Up @@ -57,6 +58,8 @@
"electron-builder": "^25.1.8",
"eslint": "^8.0.1",
"eslint-plugin-import": "^2.25.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
Expand Down Expand Up @@ -88,5 +91,11 @@
"update-electron-app": "^3.0.0",
"ws": "^8.18.0",
"yaml": "^2.6.0"
},
"lint-staged": {
"./**/*.{js,ts,tsx}": [
"prettier --write",
"git add"
]
}
}
Loading

0 comments on commit d1f9302

Please sign in to comment.