chore: add husky + prettier/dotnet format pre-commit
This commit is contained in:
parent
aa756ac56a
commit
eac0a17473
6 changed files with 60 additions and 2 deletions
13
.config/dotnet-tools.json
Normal file
13
.config/dotnet-tools.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"husky": {
|
||||
"version": "0.7.1",
|
||||
"commands": [
|
||||
"husky"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
22
.husky/pre-commit
Executable file
22
.husky/pre-commit
Executable 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
21
.husky/task-runner.json
Normal 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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2,5 +2,6 @@
|
|||
<project version="4">
|
||||
<component name="EslintConfiguration">
|
||||
<files-pattern value="**/*.{js,ts,jsx,tsx,html,vue,svelte}" />
|
||||
<option name="fix-on-save" value="true" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PrettierConfiguration">
|
||||
<option name="myConfigurationMode" value="MANUAL" />
|
||||
<option name="myConfigurationMode" value="AUTOMATIC" />
|
||||
<option name="myRunOnSave" value="true" />
|
||||
<option name="myRunOnReformat" value="true" />
|
||||
<option name="myFilesPattern" value="**/*.{js,ts,jsx,tsx,vue,astro,svelte,html}" />
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"concurrently": "^9.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "concurrently -n .net,node,rate -c magenta,yellow,blue -i 'cd Foxnouns.Backend && dotnet watch --no-hot-reload' 'cd Foxnouns.Frontend && yarn dev' 'cd rate && go run -v .'"
|
||||
"dev": "concurrently -n .net,node,rate -c magenta,yellow,blue -i 'cd Foxnouns.Backend && dotnet watch --no-hot-reload' 'cd Foxnouns.Frontend && yarn dev' 'cd rate && go run -v .'",
|
||||
"format": "cd frontend && yarn format -w"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue