https://github.com/saneef/debug-lefthook
https://github.com/saneef/debug-lefthook
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/saneef/debug-lefthook
- Owner: saneef
- Created: 2024-02-12T15:21:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-13T08:12:26.000Z (over 2 years ago)
- Last Synced: 2025-03-09T14:38:06.585Z (over 1 year ago)
- Language: CSS
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Solved] Debugging Lefthook Issue: Linted files during pre-commit are not committed
Issue: https://github.com/evilmartians/lefthook/issues/628
✅ **Solution**: Use [`stage_fixed: true`](https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md#stage_fixed) with each `commands` where you need to commit linted files.
## Problem
During commit, the Lefthook runs pre-commit commands. But, the changes made by the pre-commit command (especially `stylelint`) are not included in the commit.
## Steps to reproduce
1. Clone this repo locally.
2. Install NPM packages using `npm install`.
3. Open the file `css/styles.css`, delete the comment on line 7, and save.
4. Stage the file `css/styles.css`, and commit.
5. You should see the commit completed, and file `css/styles.css` with new changes. The changes that were made by pre-commit `stylelint` command.