Skip to content

Commit

Permalink
🔧 Update husky and add lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
stoe committed Jul 7, 2024
1 parent 32c3a23 commit 6ac6477
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/husky/.gitignore

This file was deleted.

5 changes: 2 additions & 3 deletions .github/husky/pre-commit → .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

. "$(dirname "$0")/_/husky.sh"

npm run format

npm run test
npx lint-staged --verbose --allow-empty
echo ""
File renamed without changes.
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"npm": ">=10"
},
"scripts": {
"prepare": "husky install ./.github/husky",
"format": "npx prettier --config-precedence prefer-file --write . && eslint . --fix",
"prepare": "husky",
"pretest": "npx eslint-config-prettier eslint.config.js",
"test": "npm run test --workspaces --if-present",
"publish": "npm publish --access public --workspaces",
"update": "./.github/scripts/update.sh"
"update": "./.github/scripts/update.sh",
"publish": "npm publish --provenance --access public --workspaces"
},
"devDependencies": {
"@github/prettier-config": "^0.0.6",
Expand All @@ -40,13 +40,24 @@
"eslint-plugin-markdown": "^5.0.0",
"eslint-plugin-prettier": "^5.1.3",
"globals": "^15.8.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "^3.3.2"
},
"husky": {
"hooks": {
"pre-commit": "./.github/husky/pre-commit",
"pre-push": "./.github/husky/pre-push"
"pre-commit": ".husky/pre-commit",
"pre-push": ".husky/pre-push"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"npm run format",
"npm run test"
],
"*.{json,md}": [
"prettier --write"
]
},
"prettier": "@github/prettier-config"
}

0 comments on commit 6ac6477

Please sign in to comment.