Releases: lint-staged/lint-staged
Release list
v17.3.0
Minor Changes
-
#1825
16b3f74- It is now possible to run multiple tasks in parallel for a single glob by configuring it with an array of tasks (which run sequentially), and then placing another array inside it (where the tasks will run in parallel). The following demonstrates the order tasks will start in:{ "*.ts": ["first", "second", ["third", "third"], "fourth"] }As a concrete example, lint-staged's own configuration is:
/** @type {import('./lib/index.js').Configuration} */ export default { "*": [ [ "oxfmt --check --no-error-on-unmatched-pattern", "oxlint --no-error-on-unmatched-pattern", ], ], "*.ts": () => "tsc", };
which means:
- for all staged files, run the two commands in parallel with staged filenames appended, for example:
oxfmt --check --no-error-on-unmatched-pattern lib/index.jsoxlint --no-error-on-unmatched-pattern lib/index.js
- additionally, if any
*.tsfiles are staged, runtscwithout appending any arguments - The two sets of commands also run in parallel
- for all staged files, run the two commands in parallel with staged filenames appended, for example:
Patch Changes
v17.2.0
Minor Changes
-
#1823
ee156cc- The chunking of tasks based on maximum command line argument length has been re-implemented to be more precise. Now the chunking happens based on the final generated command string, instead of just the list of staged files like previously. This benefits mainly Windows platforms and function commands like:/** @type {import('lint-staged').Configuration} */ export default { "*.ts": () => "tsc", // Run "tsc" when any TS file is changed (for entire project) };
Where the spawned command is literally
"tsc"without any extra arguments. Previously, this was still chunked when a lot of files were staged. Now, it probably won't be chunked because the length of the command is just three letters.Also, native JavaScript/Node.js function tasks won't be chunked at all, when previously they were run multiple times when chunked:
/** @type {import('lint-staged').Configuration} */ export default { "*.js": { title: "Log staged JS files to console", task: async (files) => { console.log("Staged JS files:", files); }, }, };
v17.1.1
v17.1.0
Minor Changes
-
#1816
7568d4f- The console output of lint-staged has been simplified so that there's less interactive spinners and more explicit messages like "Startedβ¦" -> "Done!". The primary purpose of this was to removeListr2, a very large dependency.Before:
Size of
node_modules/after installing:1561.7 kBwith 29 packages.Fancy interactive spinners, but output dynamically changes:
β Backed up original state in git stash (0b191303) β Running tasks for staged files... β Staging changes from tasks... β Cleaning up temporary files...
After:
Size of
node_modules/after installing:974.0 kBwith 5 packages (37.6 % smaller, 82.7 % less transitive dependencies).Simpler but more explicit output:
β― Backing up original stateβ¦ β Done backing up original state (35b38ed1)! β― Running tasks for staged filesβ¦ *.js β 1 file β― oxlint --fix *.{json,md} β 1 file β― oxfmt --write β oxfmt --write β oxlint --fix β Done running tasks for staged files! β― Staging changes from tasksβ¦ β Done staging changes from tasks! β― Cleaning up temporary filesβ¦ β Done cleaning up temporary files!
Patch Changes
-
#1816
c19079d- Try to restore hidden unstaged changes when using--no-revert. -
#1818
efb23a2- Console output colors are enabled/disabled more consistently. -
#1818
26112a1- Failed JS function tasks now properly kill other tasks, unless--continue-on-erroris used. Previously their failure didn't affect other tasks.
v17.0.8
Patch Changes
-
#1809
179b437- Fix lint-staged discarding the ongoing merge conflict status (.git/MERGE_HEAD) when using the--hide-unstagedor--hide-alloptions. -
#1811
3d0b2c0- Fix issues with Git commands that are successful but also emit warnings tostderr, by ignoring thestderroutput completely when the process exits with code 0. This was the behavior when usingnano-spawnandexeca, but when switching totinyexecin 16.3.0 bothstdoutandstderrwere used as interleaved output.
v17.0.7
v17.0.6
Patch Changes
-
#1803
bdf2770- Run all tests with Deno, in addition to Node.js and Bun. -
#1796
7508272- Fix performance regression of lint-staged v17 by going back to usinggit addto stage task modifications. This was changed togit update-index --againin v17 for less manual work, but unfortunately theupdate-indexcommand gets slower in very large Git repos. -
#1797
7b2505a- This version of lint-staged uses the new staged publishing for npm packages feature. Releases are already published from GitHub Actions with trusted publishing, but now an additional approval with two-factor authentication is also required. -
#1802
321b0a9- Downgrade dependencytinyexec@1.2.2to avoid issues in version 1.2.3.
v17.0.5
v17.0.4
Patch Changes
-
#1788
f95c1f8- Another fix for making sure lint-staged adds task modifications correctly to the commit in the following cases:- after editing
<file>it is staged withgit add <file>, and then committed withgit commit - after editing
<file>it is committed withgit commit --allwithout explicitgit add - after editing
<file>it is committed withgit commit <pathspec>without explicitgit add
There's new test cases which actually setup the Git
pre_commithook to run lint-staged and verify them. These issues started in v17.0.0 when trying to improve support for committig without having explicitly staged files. - after editing
v17.0.3
Patch Changes
- #1782
06813f9Thanks @iiroj! - Fix lint-staged behavior when implicitly committing files without usinggit addby either:git commit -am "my commit message"where-a(--all) means to automatically stage all tracked modified and deleted filesgit commit -m "my commit message" .where.is an example of a pathspec where matching files will be staged