Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2025-05-10 | 3.1 kB | |
v16.0.0 source code.tar.gz | 2025-05-10 | 1.9 MB | |
v16.0.0 source code.zip | 2025-05-10 | 1.9 MB | |
Totals: 3 Items | 3.8 MB | 0 |
Major Changes
-
#1546
158d15c
Thanks @iiroj! - Processes are spawned using nano-spawn instead of execa. If you are using Node.js scripts as tasks, you might need to explicitly run them withnode
, especially when using Windows:json { "*.js": "node my-js-linter.js" }
-
#1546
158d15c
Thanks @iiroj! - The--shell
flag has been removed and lint-staged no longer supports evaluating commands directly via a shell. To migrate existing commands, you can create a shell script and invoke it instead. Lint-staged will pass matched staged files as a list of arguments, accessible via"$@"
:```shell
my-script.sh
!/bin/bash
echo "Staged files: $@" ```
and
json { "*.js": "my-script.sh" }
If you were using the shell option to avoid passing filenames to tasks, for example
bash -c 'tsc --noEmit'
, use the function syntax instead:js export default { '*.ts': () => 'tsc --noEmit' }
-
#1546
158d15c
Thanks @iiroj! - Validation for deprecated advanced configuration has been removed. The advanced configuration was removed in lint-staged version 9 and until now validation has failed if advanced configuration options were detected. Going forward the entire configuration will be treated with the same logic and if these advanced options are still present, they might be treated as valid globs for staged files instead. -
#1546
158d15c
Thanks @iiroj! - The lowest supported Node.js version is20.18
. Please upgrade your Node.js version.
Minor Changes
-
#1401
27110ef
Thanks @RohitLuthra19! - Added support for directly running functions on staged files. To configure a function task, use an object with a title and the task itself:js export default { '*.js': { title: 'My task', task: async (files) => { console.log('Staged JS files:', files) }, }, }
Lint-staged will run your function task with the staged files matching the configured glob as its argument, and show the custom title in its console output.