Skip to content

Commit d62eef3

Browse files
committed
Added prettier, lint-staged and husky.
Run prettier as a pre-commit hook.
1 parent ceeaba4 commit d62eef3

File tree

6 files changed

+376
-6
lines changed

6 files changed

+376
-6
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ indent_size = 2
66
charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
9+
10+
[*.ts]
11+
max_line_length = 120

.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,yml,yaml}": "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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,21 @@
331331
]
332332
},
333333
"scripts": {
334-
"vscode:prepublish": "npm run compile",
335334
"compile": "tsc -p ./",
335+
"postinstall": "husky install",
336+
"vscode:prepublish": "npm run compile",
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": "^14.0.1",
344+
"prettier": "^3.0.3",
341345
"typescript": "^4.4.4"
342346
},
343-
"dependencies": {}
347+
"dependencies": {},
348+
"prettier": {
349+
"proseWrap": "always"
350+
}
344351
}

0 commit comments

Comments
 (0)