Comments (5)
What about something like this?
"precommit": "js-beautify index.js && git add index.js"
You may want to extract this to a script if it's too long. For example with a Node script, it could be:
// precommit.js
var execSync = require('child_process')
execSync('js-beautify index.js')
execSync('git add index.js')
"precommit": "node precommit"
from husky.
I'm aware I can do it in my own script but for me it was kinda like expected behaviour after pre-commit script. I mean when one of files that were added and script makes change, it will be added again after pre-commit. I found it like nice-to-have general feature to your library.
from husky.
Sorry, I misunderstood what you meant.
Yes it would be a nice feature, but personally for this project I prefer to avoid "magical" features. What's happening during a pre-commit
hook is only what's defined in the precommit
script.
Thanks for the feature suggestion :)
from husky.
That's fair enough :) I think that it closes the issue. Thanks for your reply!
from husky.
You're welcome :)
from husky.
Related Issues (20)
- Export husky module in project defaulting to ESM requires the .default() property usage HOT 6
- V9 doesnt work within vscode HOT 15
- `.husky/_/husky.sh` empty on install HOT 1
- V9 doesn't work after install HOT 15
- Dead article links in Introduction docs page HOT 3
- Hashbang support in V9? HOT 2
- pre commit script failing HOT 3
- Backwards compatibility with Husky 8.x HOT 5
- Use a Windows compatible script in release note HOT 2
- V9 Issue - Husky command not found in the PATH - with the hooks code in python HOT 11
- Yarn add husky failed due to node version is lower than 18, How can I skip installing in CI HOT 3
- Docs for optional install of Husky HOT 2
- Husky replaces my "prepare" script HOT 5
- [HELP] pre-commit and echo -e HOT 3
- ERR_MODULE_NOT_FOUND on Husky 9.0.10 HOT 4
- Integrating with `pre-commit.com` HOT 2
- `export HUSKY=0` in a config has no effect HOT 3
- commitlint 18.6.1 HOT 2
- Cannot import husky v9 with moduleResolution: "node" HOT 3
- Issue with path resolution on Windows HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from husky.