Skip to content

Commit

Permalink
[#3] Install Husky
Browse files Browse the repository at this point in the history
- npm install --save-dev husky
- npx husky init

Add DDEV configs to ensure Husky is connected to the user & DDEV's Git processes
  • Loading branch information
joshuapease committed May 21, 2024
1 parent 80d41d0 commit 56b978d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ use_dns_when_possible: true
composer_version: '2'
web_environment: []
nodejs_version: '18'
hooks:
post-start:
- composer: install
# Sets up husky
- exec: npm run prepare
# Ensures that lint-staged runs properly in ddev container
- exec: git config --global --add safe.directory /var/www/html
web_extra_exposed_ports:
# Expose ports for vite
- name: vite
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run format
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
"build": "vite build",
"preview": "vite preview",
"lint": "eslint --fix src",
"format": "prettier --write ."
"format": "prettier --write .",
"prepare": "husky"
},
"devDependencies": {
"@eslint/js": "^9.3.0",
"autoprefixer": "^10.4.19",
"cssnano": "^7.0.1",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.3.0",
"husky": "^9.0.11",
"postcss": "^8.4.38",
"postcss-pxtorem": "^6.1.0",
"prettier": "3.2.5",
Expand Down

0 comments on commit 56b978d

Please sign in to comment.