npm / lint-staged
lint-staged
What changed in lint-staged 9 to 17, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-28.
21 breaking1 deprecations10 new APIs and options15 behavior and defaults29 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlint-staged 1739 changes
Breaking changes 6
lint-staged now stages changes to all tracked files modified by tasks, including files not originally staged or matching configured globs.
Lint-staged refuses to run when files were staged with this flag, because Git stash does not support them.
Failed JS function tasks now kill other tasks unless --continue-on-error is used.
lint-staged now verifies that the installed Git version is at least 2.32.0 before running.
Node.js 20 is no longer supported; lint-staged now requires Node.js 22.22.1 or newer.
On POSIX systems, scripts with the
#!/usr/bin/env nodeshebang now run with the same Node.js version that lint-staged itself was started with.
New APIs and options 5
Use this option to hide unstaged changes while tasks run, preventing edits by a task from staging those changes too.
Task functions receive a log() function for emitting output while the task runs; output is visible by default only when the task fails, and rejected-task errors are shown.
Includes all Git-tracked files instead of only staged files; implies --no-stash and --allow-empty.
Added a helper for type-checking the lint-staged configuration, imported from lint-staged/config.
Hides all unstaged changes and untracked files before running tasks; untracked files are included in the backup stash and restored afterward.
Behavior and default changes 10
Lint-staged now honors the FORCE_COLOR environment variable.
During an in-progress merge, files unchanged from the branch being merged are skipped; files are included only if they have staged changes against both HEAD and MERGE_HEAD.
Nested task arrays let a glob run tasks in parallel within a sequential task list.
Chunking is based on the final generated command string rather than only the staged-file list, making it more precise, especially on Windows.
Native JavaScript/Node.js function tasks are no longer chunked or run multiple times when many files are staged.
Accepts Infinity to disable chunking tasks by the number of staged files; parsing and validation have also been improved.
Output uses fewer interactive spinners and more explicit messages such as “Started…” and “Done!”.
The default value is now set based on the running platform, controlling how very long lists of staged files are split into chunks.
lint-staged runs this command after tasks instead of adding the originally staged files, improving compatibility with non-default indexes and pathspec commits.
The yaml dependency is optional and probably won't be installed by default; install it separately when using a YAML configuration file.
Fixes and other changes 18
The warning about hidden partially-staged changes is displayed only when restoring those changes fails.
Nested arrays of tasks returned by a function now run inner tasks in parallel, consistent with task arrays defined directly.
Partially staged changes are hidden in uniquely named patch files, avoiding overwrites between lint-staged invocations and making concurrent runs in multiple worktrees safer.
Changes the signature from const to a function to fix TypeScript issue TS1254.
Lint-staged does not try to restore untracked files when this flag is used and there is no initial commit.
Local binaries from node_modules/.bin are resolved starting from the directory of each lint-staged configuration file in monorepo setups.
Color support is handled better in non-TTY streams.
Its behavior was improved when lint-staged runs in multiple worktrees in parallel; parallel instances in the same tree should still be avoided.
Parsing was rewritten to avoid inconsistent behavior between CLI flags and Node.js API options.
Parsing and validation of this numeric CLI option have been improved.
Console output colors are enabled or disabled more consistently.
lint-staged tries to restore hidden unstaged changes when --no-revert is used.
Using this option no longer causes lint-staged to discard the ongoing merge conflict status in .git/MERGE_HEAD.
Output on stderr is ignored for successful Git commands, avoiding issues when commands emit warnings despite exiting with code 0.
lint-staged uses git add again to stage task modifications, fixing a performance regression in very large Git repositories.
lint-staged now correctly adds task modifications to the commit when files are explicitly staged, committed with --all, or committed using a pathspec.
Fixes lint-staged behavior when files are implicitly staged by git commit -am or git commit with a pathspec, without using git add.
When Node.js is installed from Ubuntu App Center, scripts with the
#!/usr/bin/env nodeshebang are now spawned with the real Node.js binary instead of the Snap symlink.
lint-staged 1613 changes
Breaking changes 4
Validation for deprecated advanced configuration has been removed; remaining options may instead be treated as valid globs for staged files.
Processes are spawned using nano-spawn instead of execa. Node.js scripts used as tasks might need to be invoked explicitly with node, especially on Windows.
The lowest supported Node.js version is now 20.18, so developers using an older version need to upgrade.
The flag has been removed, and lint-staged no longer evaluates commands directly via a shell. Use a shell script or function syntax instead.
New APIs and options 1
Function tasks can be configured with a title and task function; lint-staged passes matching staged files to the function and displays the custom title.
Behavior and default changes 1
When a task fails, its subprocesses are killed more efficiently via the process group on Unix systems and the taskkill command on Windows.
Fixes and other changes 7
Commands prefer local node_modules/.bin locations over global locations.
Git's warning about CRLF line endings no longer interferes with creating the initial backup stash.
On Windows, tasks are spawned without the detached option to hide the extra cmd window.
Incorrect brace expansions like
*.{js}are detected exhaustively instead of in a single pass.The “failed to spawn” error message is no longer displayed when a task fails normally; it is reserved for failures to spawn the task.
Fixes problems where tasks might still have been killed with SIGINT when one of them failed.
Fixes unhandled promise rejections when tasks fail to spawn; previously lint-staged could fail and the backup stash might not be automatically restored.
lint-staged 151 changes
Breaking changes 1
Requires Node.js 18.12.0 or later and drops support for Node.js 16.
lint-staged 141 changes
Breaking changes 1
Node.js 14 is no longer supported; upgrade to at least 16.14.0.
lint-staged 131 changes
Breaking changes 1
lint-staged no longer supports Node.js 12, which reached end of life on 30 April 2022.
lint-staged 122 changes
Breaking changes 2
lint-staged is now a pure ESM module; integrations should use an import instead of require.
The required Node.js versions are ^12.20.0, ^14.13.1, or >=16.0.0.
lint-staged 111 changes
Breaking changes 1
Node.js 12 LTS 'Erbium' is now the minimum required version.
lint-staged 1010 changes
Breaking changes 3
Empty commits now cause an error by default; use this option to allow them.
Task modifications are staged automatically; remove git add from task configurations to avoid warnings and race conditions.
Node.js v8 is no longer supported; the Node.js version dependency is at least 10.13.0.
New APIs and options 1
Set allowEmpty to true in the Node.js API to allow empty commits.
Behavior and default changes 3
Tasks can now be async functions.
gitWorkflow uses git stashes to handle changes while tasks run.
Tasks are split into chunks to support shells with limited maximum argument length.
Fixes and other changes 3
Binary files are now supported.
Unstaged changes are restored more reliably, including when restoration fails or applying changes needs a three-way merge.
Untracked files are backed up and restored so they remain around while tasks run.
lint-staged 98 changes
Breaking changes 2
Very long argument strings are no longer chunked on Windows; function linters should be used to customize this behavior.
lint-staged no longer resolves local commands; execa does this instead, so missing commands no longer produce pretty error messages.
Deprecations 1
Advanced configuration options are deprecated in favour of the simple format, and using them produces a deprecation error.
New APIs and options 3
Functions can be used as linter commands.
Adds the --quiet flag.
Adds the --shell flag.
Behavior and default changes 1
Function linters can return an array of commands.
Fixes and other changes 1
Titles are parsed for function linters.