Packages

lint-staged

17.6.0 · 26 Sep 2026MIT26.8M / weekRepositoryHomepagenpmAtom feed

Your version

16.0.0

major10 May 2025Where it was published

16.4.0 is the newest release of 16.x.

In short

4 breaking1 new

  • breaking

    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 with node, especially when using Windows:

  • breaking

    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 "$@":

  • breaking

    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.

  • breaking

    The lowest supported Node.js version is 20.18. Please upgrade your Node.js version.

Release note

Major Changes

  • breaking

    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 with node, especially when using Windows:

    {
      "*.js": "node my-js-linter.js"
    }
  • breaking

    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 "$@":

    # my-script.sh
    #!/bin/bash
    
    echo "Staged files: $@"

    and

    { "*.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:

    export default { '*.ts': () => 'tsc --noEmit' }
  • breaking

    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.

  • breaking

    The lowest supported Node.js version is 20.18. Please upgrade your Node.js version.

Minor Changes

  • Added support for directly running functions on staged files. To configure a function task, use an object with a title and the task itself:

    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.