Skip to content

Commit

Permalink
chore: add staged auto-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Micieli committed Mar 5, 2023
1 parent 78ef24b commit e0fdfca
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
node_modules
oclif.manifest.json
.idea
.eslintcache
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run autoformat:staged
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"**/*.ts?(x)": [
"prettier --write"
]
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"axios": "^1.3.4",
"chalk": "^4.1.2",
"ios-deploy": "^1.12.1",
"lint-staged": "^13.1.2",
"prompts": "^2.4.2"
},
"devDependencies": {
Expand All @@ -47,6 +48,7 @@
"eslint-config-oclif-typescript": "^1.0.3",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.0",
"mocha": "^10.2.0",
"oclif": "^3",
"prettier": "^2.8.4",
Expand All @@ -70,11 +72,13 @@
"autoformat": "prettier --write \"src/**/*.ts\" && eslint --no-error-on-unmatched-pattern --fix --cache \"./src/**/*.{ts}\"",
"lint": "eslint . --ext .ts --config .eslintrc",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "npm run lint",
"prepack": "npm run build && oclif manifest && oclif readme",
"posttest": "pnpm run lint",
"prepack": "pnpm run build && oclif manifest && oclif readme",
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif readme && git add README.md",
"run": "./bin/dev run -a"
"run": "./bin/dev run -a",
"prepare": "husky install",
"autoformat:staged": "pnpm dlx lint-staged"
},
"engines": {
"node": ">=12.0.0"
Expand Down
Loading

0 comments on commit e0fdfca

Please sign in to comment.