Skip to content

Commit 263c716

Browse files
committed
Add prettier to the Taskfile
1 parent 74c86fe commit 263c716

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Taskfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ function project:install-dependencies {
4444
npm install
4545
}
4646

47+
function task:prettify { ## Prettify all files
48+
title "Cleaning codestyle"
49+
echo "Prettifying files..."
50+
prettier --write --list-different .
51+
echo "Done."
52+
}
53+
54+
# =========================================================
55+
## Automation
56+
# =========================================================
57+
58+
function task:pre-commit { ## Clean up code before committing
59+
task:prettify
60+
title "Comitting"
61+
}
62+
4763
# =========================================================
4864
## Taskfile
4965
# =========================================================

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "A ./Taskfile is a task runner in plain and easy Bash. It adds a list of available tasks to your project.",
55
"scripts": {
6-
"format": "prettier --write .",
6+
"format": "./Taskfile pre-commit",
77
"prepare": "husky install"
88
},
99
"repository": {

0 commit comments

Comments
 (0)