Skip to content

Commit

Permalink
feat: add git hooks prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
yklydxtt committed Aug 17, 2021
1 parent 33369f1 commit 792de1c
Show file tree
Hide file tree
Showing 4 changed files with 525 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port
dist
lib
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
semi: false
singleQuote: true
printWidth: 80
trailingComma: none
19 changes: 18 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"scripts": {
"test": "",
"lint": "prettier --write \"src/**/*.js\"",
"prepublish": "babel src -d lib"
},
"repository": {
Expand All @@ -28,6 +29,22 @@
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.6"
"@babel/core": "^7.14.6",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2",
"yorkie": "^2.0.0"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,md}": [
"prettier --write",
"git add"
],
"*.ts": [
"prettier --parser=typescript --write",
"git add"
]
}
}
Loading

0 comments on commit 792de1c

Please sign in to comment.