Skip to content

Commit

Permalink
Added prettier, lint-staged and husky.
Browse files Browse the repository at this point in the history
Run prettier as a pre-commit hook.
  • Loading branch information
lukester1975 committed Apr 21, 2023
1 parent 07d4316 commit 727057b
Show file tree
Hide file tree
Showing 5 changed files with 515 additions and 5 deletions.
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"

yarn --silent lint-staged -r
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,ts,tsx,json,css,md,html}": "prettier --write"
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
node_modules
out
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,21 @@
]
},
"scripts": {
"postinstall": "husky install",
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./"
},
"devDependencies": {
"@types/node": "^16.11.7",
"@types/vscode": "^1.1.59",
"husky": "^8.0.3",
"lint-staged": "^13.2.1",
"prettier": "^2.8.7",
"typescript": "^4.4.4"
},
"dependencies": {}
"dependencies": {},
"prettier": {
"printWidth": 100
}
}
Loading

0 comments on commit 727057b

Please sign in to comment.