Skip to content

Commit

Permalink
prettier configuration and pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesnyder committed May 21, 2024
1 parent a9407c9 commit 13f103b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Format JS, YAML, and CSS
a9407c93d28d6d244c0d4c108b2ccc19d28201d1
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ repos:
- id: check-yaml
- repo: local
hooks:
- id: prettier-format
name: Format JS, YAML, and CSS
entry: "bash -c '(yarn prettier --config .prettierrc --write . ) || exit 1'"
language: system
- id: compile-js
name: Update JS build
entry: "bash -c '( yarn run build && git add dlgr/griduniverse/static/scripts/dist ) || exit 1'"
Expand Down
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.html
node_modules
htmlcov
docs
build
**/util/*
**/dist/*
**/reconnecting-websocket.js
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 2,
"overrides": [
{
"files": "*.css",
"options": {
"tabWidth": 4
}
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"browser-sync": "<2.19.0",
"browser-sync-webpack-plugin": "^2.3.0",
"prettier": "3.2.5",
"uglify-es": "^3.0.28",
"webpack": "^2.4.1"
},
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2594,6 +2594,11 @@ preserve@^0.2.0:
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
integrity sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==

prettier@3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==

process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
Expand Down

0 comments on commit 13f103b

Please sign in to comment.