chore: add husky + prettier/dotnet format pre-commit

This commit is contained in:
sam 2024-10-01 22:35:17 +02:00
parent aa756ac56a
commit eac0a17473
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
6 changed files with 60 additions and 2 deletions

22
.husky/pre-commit Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
## husky task runner examples -------------------
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'
## run all tasks
#husky run
### run all tasks with group: 'group-name'
#husky run --group group-name
## run task with name: 'task-name'
#husky run --name task-name
## pass hook arguments to task
#husky run --args "$1" "$2"
## or put your custom commands -------------------
#echo 'Husky.Net is awesome!'
dotnet husky run

21
.husky/task-runner.json Normal file
View file

@ -0,0 +1,21 @@
{
"$schema": "https://alirezanet.github.io/Husky.Net/schema.json",
"tasks": [
{
"name": "run-prettier",
"command": "yarn",
"args": [
"format",
"${staged}"
],
"pathMode": "absolute"
},
{
"name": "dotnet-format",
"command": "dotnet",
"args": [
"format"
]
}
]
}