✨ Automatically format when submitting
This commit is contained in:
2
.githooks/pre-commit
Executable file
2
.githooks/pre-commit
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
npm run format && git add -A
|
||||||
4
.githooks/setup.sh
Executable file
4
.githooks/setup.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
git config core.hooksPath .githooks
|
||||||
|
chmod +x .githooks/*
|
||||||
|
git config alias.add '!f() { npm run format && git add "$@"; }; f'
|
||||||
@@ -42,6 +42,8 @@
|
|||||||
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
||||||
"test": "npm run cli:build && node tests/index.js",
|
"test": "npm run cli:build && node tests/index.js",
|
||||||
"format": "npx prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
|
"format": "npx prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
|
||||||
|
"hooks:setup": "bash .githooks/setup.sh",
|
||||||
|
"postinstall": "npm run hooks:setup",
|
||||||
"prepublishOnly": "npm run cli:build"
|
"prepublishOnly": "npm run cli:build"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
Reference in New Issue
Block a user