Skip to content

Commit 3b1d3bc

Browse files
committed
Added prettier, lint-staged and husky.
Run prettier as a pre-commit hook.
1 parent 4d8a651 commit 3b1d3bc

File tree

5 files changed

+515
-5
lines changed

5 files changed

+515
-5
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn --silent lint-staged -r

.lintstagedrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,jsx,ts,tsx,json,css,md,html}": "prettier --write"
3+
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/out/

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,23 @@
331331
]
332332
},
333333
"scripts": {
334+
"postinstall": "husky install",
334335
"vscode:prepublish": "npm run compile",
335336
"compile": "tsc -p ./",
336337
"watch": "tsc -watch -p ./"
337338
},
338339
"devDependencies": {
339340
"@types/node": "^16.11.7",
340341
"@types/vscode": "^1.1.59",
342+
"husky": "^8.0.3",
343+
"lint-staged": "^13.2.1",
344+
"prettier": "^2.8.7",
341345
"typescript": "^4.4.4"
342346
},
343-
"dependencies": {}
347+
"dependencies": {},
348+
"prettier": {
349+
"printWidth": 100,
350+
"trailingComma": "all",
351+
"proseWrap": "always"
352+
}
344353
}

0 commit comments

Comments
 (0)