lint-staged
17.6.0 · 26 Sep 2026MIT26.8M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgradeWhat to use instead
A better maintained package
From the e18e module-replacements list, maintained by the community.
The list compares the options for lint-staged: read the comparison.
Before you switch
- 1
Check what else depends on it
Paste your package.json in the dependency check to see every deprecated or outdated package in one pass, not only this one.
- 2
Read the replacement's peers and releases
A native API or a few lines of code need no release notes, but check the Node version your project runs on.
- 3
Know when it ships
Follow the new package on Inlinr: its releases and advisories land in your feed, and the time spent on the migration branch shows on its page.
Latest releases
All 268 releases- 17.x · latest line
17.6.0
26 Sep 2026Task 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.import { defineConfig } from 'lint-staged/config' export default defineConfig({ '*': { title: 'Fail if PDF files are committed', task: async (filepaths, { log }) => { const pdfFiles = filepaths.filter((f) => f.toLowerCase().endsWith('.pdf')) if (pdfFiles.length > 0) { log('PDF files should not be committed: %s', pdfFiles) throw new Error('Failed') } }, }, })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 .".If you have unstaged changes in a file and the task also edits that file, your unstaged changes will be staged too. Use
--hide-unstagedto hide your changes while tasks run.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.
Minor Changes
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.import { defineConfig } from 'lint-staged/config' export default defineConfig({ '*': { title: 'Fail if PDF files are committed', task: async (filepaths, { log }) => { const pdfFiles = filepaths.filter((f) => f.toLowerCase().endsWith('.pdf')) if (pdfFiles.length > 0) { log('PDF files should not be committed: %s', pdfFiles) throw new Error('Failed') } }, }, })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 .".If you have unstaged changes in a file and the task also edits that file, your unstaged changes will be staged too. Use
--hide-unstagedto hide your changes while tasks run.
Patch Changes
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.
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):import { defineConfig } from 'lint-staged/config' export default defineConfig({ '*.js': () => [['eslint --max-warnings=0 .', 'prettier --list-different .']], })Various performance improvements from skipping redundant internal Git calls.
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.
17.5.1
10 Sep 2026Fix TypeScript issue
TS1254fromdefineConfig()by changing the signature fromconstto afunction:A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
17.5.0
5 Sep 2026Lint-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.Lint-staged now handles color support better in non-TTY streams, and honors the
FORCE_COLORenvironment variable.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.
Minor Changes
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.
Patch Changes
Lint-staged now handles color support better in non-TTY streams, and honors the
FORCE_COLORenvironment variable.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.Do not try to restore untracked files when using
--hide-alland there is no initial commit yet.
Dependency tracking · free for 3 projects
Know when your own dependencies move
lint-staged shipped a new major in the last 12 months, among 24 releases. Inlinr shows which of your projects are behind, and what the upgrade breaks.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 28 Oct 2026. Releases and advisories last read 28 Oct 2026.