Skip to content

Commit

Permalink
ci: define lint-staged precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Korzunin committed Sep 14, 2021
1 parent e5fe2ac commit 6386f34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
npx lint-staged
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"eslint-plugin-jest": "^24.4.0",
"husky": "^7.0.0",
"jest": "^27.0.6",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2",
"prisma": "^2.29.1",
"semantic-release": "^17.4.5",
Expand All @@ -67,7 +68,6 @@
"clean": "rm -rf ./dist",
"build": "npm run clean && tsc",
"prepublishOnly": "npm run build",
"precommit": "npm run test",
"pretest": "npm run lint",
"test": "jest --passWithNoTests",
"coverage": "npm run test -- --coverage",
Expand All @@ -79,5 +79,13 @@
},
"publishConfig": {
"access": "public"
},
"lint-staged": {
"*.ts": [
"eslint --cache --fix",
"prettier --write",
"jest --bail --findRelatedTests"
],
"*.md": "prettier --write"
}
}

0 comments on commit 6386f34

Please sign in to comment.