lint-staged
17.6.0 · 26 Sep 2026MIT26.8M / weekRepositoryHomepagenpmAtom feed
Upgrading lint-staged from 10.0.9 to 17.6.0
154 releases in betweennotes for 67
- 15+
- changes to make
- 0
- advisories fixed
- 33+
- new
- 81+
- fixes
Counted from 67 of 154 release notes. Advisories are counted from the advisory database, in full.
Start here
Before you upgrade
Tick each one off as you go- breaking17.0.0
- breaking17.0.0
- breaking17.0.0
- breaking17.0.0
- breaking16.3.0
- breaking16.2.0
- breaking16.0.0
- breaking16.0.0
- breaking16.0.0
- breaking16.0.0
Security
- 16.2.1
Return the caret semver range (
^) to direct dependencies so that future patch and minor versions are allowed. This enables projects to better maintain and deduplicate their own transitive dependencies while not requiring direct updates to lint-staged. This was changed in 16.2.0 after the vulnerability issues withchalkanddebug, which were also removed in the same version.
Release by release
- new
Task functions like
{ title, task }can now use a logger functionlog()to emit output while the task runs. By default, the output will only be visible if the task fails, unless the--verboseoption was used. Additionally, when the task rejects, the error will be shown in the output. - new
lint-staged now stages changes to all tracked files modified by tasks, including files that weren’t originally staged or didn’t match the configured globs. This can happen when your task has side-effects, or it's a function that ignores the staged files like
() => "prettier --write .". - fixed
The assignment of staged files to lint-staged configuration files (when using multiple, for example in a monorepo) has been rewritten to be more efficient. As a reminder, each staged file is assigned to exactly one configuration (the closest one), even if that config doesn't match the file in its globs.
- fixed
Fix running parallel tasks for a single glob, when tasks are created by a function. Nesting one level of arrays inside an array of tasks will result in the inner tasks running in parallel. This behavior should now be consistent when creating tasks using functions. In the following example
eslintandprettierwill run in parallel (for all files, when any JS files are staged): - fixed
Various performance improvements from skipping redundant internal Git calls.
- fixed
Partially staged changes are hidden in a uniquely-named patch file to avoid multiple invocations of lint-staged overwriting it. This makes it safer to run lint-staged in multiple worktrees at the same time.
- new
- fixed
Fix TypeScript issue
TS1254fromdefineConfig()by changing the signature fromconstto afunction:
- fixed
- new
Lint-staged now refuses to run when files were staged with
--intent-to-add, because Git stash doesn't support them. Previously this was an unhandled error. - fixed
Lint-staged now handles color support better in non-TTY streams, and honors the
FORCE_COLORenvironment variable. - fixed
Update
tinyexec@1.3.1so that local binaries fromnode_modules/.binare resolved starting from the directory of each lint-staged configuration file (in monorepo setups). This behavior was broken inlint-staged@16.3.0where they were only resolved from the current working directory and up. - fixed
Do not try to restore untracked files when using
--hide-alland there is no initial commit yet.
- new
- fixed
This is a version-bump-only release because the previous version
17.4.0was not published to npmjs.com due to problems with GitHub Actions and Changesets.
- fixed
- new
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:
- fixed
During an in-progress merge, files that are unchanged from the branch being merged are now skipped. Technically, files are only included if there are staged changes against both
HEADandMERGE_HEAD.
- new
- new
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:
- new
- fixed
It's now possible to set
--max-arg-length=Infinityto effectively disable chunking of tasks based on the number of staged files. The parsing and validation of the numeric CLI options--max-arg-lengthand--concurrencyhas been improved.
- fixed
- new
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 remove
Listr2, a very large dependency. - fixed
Try to restore hidden unstaged changes when using
--no-revert. - fixed
Console output colors are enabled/disabled more consistently.
- fixed
Failed JS function tasks now properly kill other tasks, unless
--continue-on-erroris used. Previously their failure didn't affect other tasks.
- new
8 other lines we could not sort, mostly version bumps
- 15.5.0
Stage
file.jswith only double quotes"changed to' - 15.5.0
Run
git commit -am "I don't like double quotes" - 15.5.0
Lint-staged runs
prettier --write file.js, converting all the'back to" - 15.5.0
Because there are now no changes, lint-staged fails, cancels the commit, and resets back to the original state
- 15.5.0
Commit was not done, original state is restored and single quotes
'are staged - 15.5.0
Stage
file.jswith only double-quotes"changed to' - 15.5.0
Because there are now no changes, lint-staged fails and cancels the commit
- 15.5.0
Commit was not done, and there are no staged changes
5 internal lines (docs, tests, tooling) left out.