Skip to content

Commit 8ec040c

Browse files
iirojokonet
authored andcommitted
fix: add note about next version (#708)
1 parent 1dcdb89 commit 8ec040c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
Run linters against staged git files and don't let :poop: slip into your code base!
44

5+
---
6+
7+
## 🚧 Help test `lint-staged@next`!
8+
9+
Version 10 of `lint-staged` is coming with changes that help it run faster on large git repositories and prevent loss of data during errors. Please help test the `next` version and report any inconsistencies in our [GitHub Issues](https://github.com/okonet/lint-staged/issues):
10+
11+
**Using npm**
12+
13+
npm install --save-dev lint-staged@next
14+
15+
**Using yarn**
16+
17+
yarn add -D lint-staged@next
18+
19+
### Notable changes
20+
21+
- A git stash is created before running any tasks, so in case of errors any lost changes can be restored easily (and automatically unless lint-staged itself crashes)
22+
- Instead of write-tree/read-tree, `lint-staged@next` uses git stashes to hide unstaged changes while running tasks against staged files
23+
- This results in a performance increase of up to 45x on very large repositories
24+
- The behaviour of committing modifications during tasks (eg. `prettier --write && git add`) is different. The current version creates a diff of these modifications, and applies it against the original state, silently ignoring any errors. The `next` version leaves modifications of staged files as-is, and then restores all hidden unstaged changes as patch. If applying the patch fails due to a merge conflict (because tasks have modified the same lines), a 3-way merge will be retried. If this also fails, the entire commit will fail and the original state will be restored.
25+
- **TL;DR** the `next` version will never skip committing any changes by tasks (due to a merge conflict), but might fail in very complex situations where unstaged changes cannot be restored cleanly. If this happens to you, we are very interested in a repeatable test scenario.
26+
27+
---
28+
529
[![asciicast](https://asciinema.org/a/199934.svg)](https://asciinema.org/a/199934)
630

731
## Why

0 commit comments

Comments
 (0)