Renovate: Update dependency lint-staged to v16 #159

Open
renovate wants to merge 1 commit from renovate/lint-staged-16.x into main
Collaborator

This PR contains the following updates:

Package Type Update Change
lint-staged devDependencies major ^15.2.7 -> ^16.0.0

Release Notes

lint-staged/lint-staged (lint-staged)

v16.2.7

Compare Source

Patch Changes
  • #​1711 ef74c8d Thanks @​iiroj! - Do not display a "failed to spawn" error message when a task fails normally. This message is reserved for when the task didn't run because spawning it failed.

v16.2.6

Compare Source

Patch Changes

v16.2.5

Compare Source

Patch Changes
  • #​1687 9e02d9d Thanks @​iiroj! - Fix unhandled promise rejection when spawning tasks (instead of the tasks themselves failing). Previously when a task failed to spawn, lint-staged also failed and the backup stash might not have been automatically restored.

v16.2.4

Compare Source

Patch Changes

v16.2.3

Compare Source

Patch Changes
  • #​1669 27cd541 Thanks @​iiroj! - When using --fail-on-changes, automatically hidden (partially) unstaged changes are no longer counted to make lint-staged fail.

v16.2.2

Compare Source

Patch Changes
  • #​1667 699f95d Thanks @​iiroj! - The backup stash will not be dropped when using --fail-on-changes and there are errors. When reverting to original state is disabled (via --no-revert or --fail-on-changes), hidden (partially) unstaged changes are still restored automatically so that it's easier to resolve the situation manually.

    Additionally, the example for using the backup stash manually now uses the correct backup hash, if available:

    % npx lint-staged --fail-on-changes
    ✔ Backed up original state in git stash (c18d55a3)
    ✔ Running tasks for staged files...
    ✖ Tasks modified files and --fail-on-changes was used!
    ↓ Cleaning up temporary files...
    
    ✖ lint-staged failed because `--fail-on-changes` was used.
    
    Any lost modifications can be restored from a git stash:
    
      > git stash list --format="%h %s"
      c18d55a3 On main: lint-staged automatic backup
      > git apply --index c18d55a3
    

v16.2.1

Compare Source

Patch Changes
  • #​1664 8277b3b Thanks @​iiroj! - The built-in TypeScript types have been updated to more closely match the implementation. Notably, the list of staged files supplied to task functions is readonly string[] and can't be mutated. Thanks @​outslept!

    export default {
    ---  "*": (files: string[]) => void console.log('staged files', files)
    +++  "*": (files: readonly string[]) => void console.log('staged files', files)
    }
    
  • #​1654 70b9af3 Thanks @​iiroj! - This version has been published from GitHub Actions using Trusted Publishing for npm packages.

  • #​1659 4996817 Thanks @​iiroj! - Fix searching configuration files when the working directory is a subdirectory of a git repository, and there are package.json files in the working directory. This situation might happen when running lint-staged for a single package in a monorepo.

  • #​1654 7021f0a Thanks @​iiroj! - 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 with chalk and debug, which were also removed in the same version.

    Given the recent vulnerabilities in the npm ecosystem, it's best to be very careful when updating dependencies.

v16.2.0

Compare Source

Minor Changes
  • #​1615 99eb742 Thanks @​iiroj! - Added a new option --fail-on-changes to make lint-staged exit with code 1 when tasks modify any files, making the precommit hook fail. This is similar to the git diff --exit-code option. Using this flag also implies the --no-revert flag which means any changes made by tasks will be left in the working tree after failing, so that they can be manually staged and the commit tried again.

  • #​1611 cd05fd3 Thanks @​rlorenzo! - Added a new option --continue-on-error so that lint-staged will run all tasks to completion even if some of them fail. By default, lint-staded will exit early on the first failure.

  • #​1637 82fcc07 Thanks @​iiroj! - Internal lint-staged errors are now thrown and visible in the console output. Previously they were caught with the process exit code set to 1, but not logged. This happens when, for example, there's a syntax error in the lint-staged configuration file.

  • #​1647 a5ecc06 Thanks @​iiroj! - Remove debug as a dependency due to recent malware issue; read more at https://github.com/debug-js/debug/issues/1005. Because of this, the DEBUG environment variable is no longer supported — use the --debug to enable debugging

  • #​1636 8db2717 Thanks @​iiroj! - Added a new option --hide-unstaged so that lint-staged will hide all unstaged changes to tracked files before running tasks. The changes will be applied back after running the tasks. Note that the combination of flags --hide-unstaged --no-hide-partially-staged isn't meaningful and behaves the same as just --hide-unstaged.

    Thanks to @​ItsNickBarry for the idea and initial implementation in #​1552.

  • #​1648 7900b3b Thanks @​iiroj! - Remove lilconfig to reduce reliance on third-party dependencies. It was used to find possible config files outside of those tracked in Git, including from the parent directories. This behavior has been moved directly into lint-staged and should work about the same.

Patch Changes

v16.1.6

Compare Source

Patch Changes
  • #​1610 e93578e Thanks @​iiroj! - Try to improve terminating of subprocess of tasks by using SIGKILL, and only calling pidtree when the the main task process has a known pid.

v16.1.5

Compare Source

Patch Changes

v16.1.4

Compare Source

Patch Changes
  • #​1604 90b37b0 Thanks @​iiroj! - Add another types field to package.json to make even more sure NPM detects that lint-staged includes built-in TypeScript type definitions.

v16.1.3

Compare Source

Patch Changes
  • #​1602 7ea700b Thanks @​dword-design! - Add the types field to package.json to make sure NPM detects lint-staged includes built-in TypeScript type definitions.

v16.1.2

Compare Source

Patch Changes
  • #​1570 a7c0c88 Thanks @​ItsNickBarry! - When using --diff-filter with the D option to include deleted staged files, lint-staged no longer tries to stage the deleted files, unless they're no longer deleted. Previously this caused an error from git add like fatal: pathspec 'deleted-file' did not match any files.

  • 38f942e Thanks @​iiroj! - Removed an extraneous log entry that printed shouldHidePArtiallyStagedFiles to console output.

v16.1.1

Compare Source

Patch Changes
  • #​1565 3686977 Thanks @​iiroj! - Lint-staged now explicitly warns about potential data loss when using --no-stash.

  • #​1571 02299a9 Thanks @​iiroj! - Function tasks (introduced in v16.0.0) only receive the staged files matching the configured glob, instead of all staged files.

  • #​1563 bc61c74 Thanks @​iiroj! - This version fixes incorrect behavior where unstaged changes were committed when using the --no-stash option. This happened because --no-stash implied --no-hide-partially-staged, meaning unstaged changes to files which also had other staged changes were added to the commit by lint-staged; this is no longer the case.

    The previous (incorrect) behavior can still be achieved by using both options --no-stash --no-hide-partially-staged at the same time.

v16.1.0

Compare Source

Minor Changes
  • #​1536 e729daa Thanks @​iiroj! - A new flag --no-revert has been introduced for when task modifications should be applied to the index before aborting the commit in case of errors. By default, lint-staged will clear all task modifications and revert to the original state.

  • #​1550 b27fa3f Thanks @​iiroj! - Lint-staged now ignores symlinks and leaves them out from the list of staged files.

Patch Changes

v16.0.0

Compare Source

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

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

v15.5.2

Compare Source

Patch Changes

v15.5.1

Compare Source

Patch Changes
  • #​1533 5d53534 Thanks @​iiroj! - Improve listing of staged files so that lint-staged doesn't crash when encountering an uninitialized submodule. This should result in less errors like:

    ✖ Failed to get staged files!
    

v15.5.0

Compare Source

Minor Changes
  • #​1526 630af5f Thanks @​iiroj! - Lint-staged no longer resets to the original state when preventing an empty git commit. This happens when your configured tasks reset all the staged changes, typically when trying to commit formatting changes which conflict with your linter setup like ESLint or Prettier.
Example with Prettier

By default Prettier prefers double quotes.

Previously
  1. Stage file.js with only double quotes " changed to '
  2. Run git commit -am "I don't like double quotes"
  3. Lint-staged runs prettier --write file.js, converting all the ' back to "
  4. Because there are now no changes, lint-staged fails, cancels the commit, and resets back to the original state
  5. Commit was not done, original state is restored and single quotes ' are staged
Now
  1. Stage file.js with only double-quotes " changed to '
  2. Run git commit -am "I don't like double quotes"
  3. Lint-staged runs prettier --write file.js, converting all the ' back to "
  4. Because there are now no changes, lint-staged fails and cancels the commit
  5. Commit was not done, and there are no staged changes

v15.4.3

Compare Source

Patch Changes
  • #​1512 cbfed1d Thanks @​tarik02! - Adjust TypeScript types for the default export so that it can be used as a value without error TS2693.

v15.4.2

Compare Source

Patch Changes
  • #​1509 8827ebf Thanks @​iiroj! - Change lint-staged's dependencies to use caret (^) ranges instead of tilde (~). This makes it easier for package managers to perform dependency management when minor-level updates are also permitted instead of just patch-level.

v15.4.1

Compare Source

Patch Changes

v15.4.0

Compare Source

Minor Changes
  • #​1500 a8ec1dd Thanks @​iiroj! - Lint-staged now provides TypeScript types for the configuration and main Node.js API. You can use the JSDoc syntax in your JS configuration files:

    /**
     * @​filename: lint-staged.config.js
     * @​type {import('lint-staged').Configuration}
     */
    export default {
      '*': 'prettier --write',
    }
    

    It's also possible to use the .ts file extension for the configuration if your Node.js version supports it. The --experimental-strip-types flag was introduced in Node.js v22.6.0 and unflagged in v23.6.0, enabling Node.js to execute TypeScript files without additional configuration.

    export NODE_OPTIONS="--experimental-strip-types"
    
    npx lint-staged --config lint-staged.config.ts
    
Patch Changes

v15.3.0

Compare Source

Minor Changes
  • #​1495 e69da9e Thanks @​iiroj! - Added more info to the debug logs so that "environment" info doesn't need to be added separately to GitHub issues.

  • #​1493 fa0fe98 Thanks @​iiroj! - Added more help messages around the automatic git stash that lint-staged creates as a backup (by default). The console output also displays the short git hash of the stash so that it's easier to recover lost files in case some fatal errors are encountered, or the process is killed before completing.

    For example:

    % npx lint-staged
    ✔ Backed up original state in git stash (20addf8)
    ✔ Running tasks for staged files...
    ✔ Applying modifications from tasks...
    ✔ Cleaning up temporary files...
    

    where the backup can be seen with git show 20addf8, or git stash list:

    % git stash list
    stash@{0}: lint-staged automatic backup (20addf8)
    

v15.2.11

Compare Source

Patch Changes
  • #​1484 bcfe309 Thanks @​wormsik! - Escape paths containing spaces when using the "shell" option.

  • #​1487 7dd8caa Thanks @​iiroj! - Do not treat submodule root paths as "staged files". This caused lint-staged to fail to a Git error when only updating the revision of a submodule.

v15.2.10

Compare Source

Patch Changes

v15.2.9

Compare Source

Patch Changes
  • #​1463 b69ce2d Thanks @​iiroj! - Set the maximum number of event listeners to the number of tasks. This should silence the console warning MaxListenersExceededWarning: Possible EventEmitter memory leak detected.

v15.2.8

Compare Source

Patch Changes
  • f0480f0 Thanks @​iiroj! - In the previous version the native git rev-parse --show-toplevel command was taken into use for resolving the current git repo root. This version switched the --show-toplevel flag with --show-cdup, because on Git installed via MSYS2 the former was returning absolute paths that do not work with Node.js child_process. The new flag returns a path relative to the working directory, avoiding the issue.

    The GitHub Actions workflow has been updated to install Git via MSYS2, to ensure better future compatibility; using the default Git binary in the GitHub Actions runner was working correctly even with MSYS2.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [lint-staged](https://github.com/lint-staged/lint-staged) | devDependencies | major | [`^15.2.7` -> `^16.0.0`](https://renovatebot.com/diffs/npm/lint-staged/15.2.7/16.2.7) | --- ### Release Notes <details> <summary>lint-staged/lint-staged (lint-staged)</summary> ### [`v16.2.7`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1627) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.6...v16.2.7) ##### Patch Changes - [#&#8203;1711](https://github.com/lint-staged/lint-staged/pull/1711) [`ef74c8d`](https://github.com/lint-staged/lint-staged/commit/ef74c8d165d5acd3ce88567e02b891e0e9af8e0e) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Do not display a "*failed to spawn*" error message when a task fails normally. This message is reserved for when the task didn't run because spawning it failed. ### [`v16.2.6`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1626) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.5...v16.2.6) ##### Patch Changes - [#&#8203;1693](https://github.com/lint-staged/lint-staged/pull/1693) [`33d4502`](https://github.com/lint-staged/lint-staged/commit/33d4502ef9c939a9c6f41fc630a34e0985220f8e) Thanks [@&#8203;Adrian-Baran-GY](https://github.com/Adrian-Baran-GY)! - Fix problems with `--continue-on-error` option, where tasks might have still been killed (`SIGINT`) when one of them failed. ### [`v16.2.5`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1625) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.4...v16.2.5) ##### Patch Changes - [#&#8203;1687](https://github.com/lint-staged/lint-staged/pull/1687) [`9e02d9d`](https://github.com/lint-staged/lint-staged/commit/9e02d9dc8a84bfeb7995520f00f7080b07a2e839) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Fix unhandled promise rejection when spawning tasks (*instead of the tasks themselves failing*). Previously when a task failed to spawn, *lint-staged* also failed and the backup stash might not have been automatically restored. ### [`v16.2.4`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1624) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.3...v16.2.4) ##### Patch Changes - [#&#8203;1682](https://github.com/lint-staged/lint-staged/pull/1682) [`0176038`](https://github.com/lint-staged/lint-staged/commit/01760380e57080d136cc396455346c36aef5770e) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Update dependencies, including [`nano-spawn@2.0.0`](https://github.com/sindresorhus/nano-spawn/releases/tag/v2.0.0) with bug fixes. - [#&#8203;1671](https://github.com/lint-staged/lint-staged/pull/1671) [`581a54e`](https://github.com/lint-staged/lint-staged/commit/581a54eea6ba3a3a1b715407c895f63a961903f3) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Speed up execution by only importing the `yaml` depedency if using YAML configuration files. ### [`v16.2.3`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1623) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.2...v16.2.3) ##### Patch Changes - [#&#8203;1669](https://github.com/lint-staged/lint-staged/pull/1669) [`27cd541`](https://github.com/lint-staged/lint-staged/commit/27cd5413d973baea6b4f3da704fb3bee8298e751) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - When using `--fail-on-changes`, automatically hidden (partially) unstaged changes are no longer counted to make *lint-staged* fail. ### [`v16.2.2`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1622) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.1...v16.2.2) ##### Patch Changes - [#&#8203;1667](https://github.com/lint-staged/lint-staged/pull/1667) [`699f95d`](https://github.com/lint-staged/lint-staged/commit/699f95df8f89ac7f7d360bbf93740d19d5899ac5) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - The backup stash will not be dropped when using `--fail-on-changes` and there are errors. When reverting to original state is disabled (via `--no-revert` or `--fail-on-changes`), hidden (partially) unstaged changes are still restored automatically so that it's easier to resolve the situation manually. Additionally, the example for using the backup stash manually now uses the correct backup hash, if available: ```shell % npx lint-staged --fail-on-changes ✔ Backed up original state in git stash (c18d55a3) ✔ Running tasks for staged files... ✖ Tasks modified files and --fail-on-changes was used! ↓ Cleaning up temporary files... ✖ lint-staged failed because `--fail-on-changes` was used. Any lost modifications can be restored from a git stash: > git stash list --format="%h %s" c18d55a3 On main: lint-staged automatic backup > git apply --index c18d55a3 ``` ### [`v16.2.1`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1621) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.2.0...v16.2.1) ##### Patch Changes - [#&#8203;1664](https://github.com/lint-staged/lint-staged/pull/1664) [`8277b3b`](https://github.com/lint-staged/lint-staged/commit/8277b3b298421ebbb39c43d7e3538481e15c4659) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - The built-in TypeScript types have been updated to more closely match the implementation. Notably, the list of staged files supplied to task functions is `readonly string[]` and can't be mutated. Thanks [@&#8203;outslept](https://github.com/outslept)! ```diff export default { --- "*": (files: string[]) => void console.log('staged files', files) +++ "*": (files: readonly string[]) => void console.log('staged files', files) } ``` - [#&#8203;1654](https://github.com/lint-staged/lint-staged/pull/1654) [`70b9af3`](https://github.com/lint-staged/lint-staged/commit/70b9af3ac3fd66af94936e55bb3e91381937b41f) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - This version has been published from GitHub Actions using [Trusted Publishing for npm packages](https://docs.npmjs.com/trusted-publishers). - [#&#8203;1659](https://github.com/lint-staged/lint-staged/pull/1659) [`4996817`](https://github.com/lint-staged/lint-staged/commit/49968170abb3bab7ac8dc0a6bc5ea92850337baa) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Fix searching configuration files when the working directory is a subdirectory of a git repository, and there are `package.json` files in the working directory. This situation might happen when running *lint-staged* for a single package in a monorepo. - [#&#8203;1654](https://github.com/lint-staged/lint-staged/pull/1654) [`7021f0a`](https://github.com/lint-staged/lint-staged/commit/7021f0af40ac1d5787501894c0f2222980023703) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - 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](https://github.com/lint-staged/lint-staged/releases/tag/v16.2.0) after the vulnerability issues with `chalk` and `debug`, which were also removed in the same version. Given the recent vulnerabilities in the *npm* ecosystem, it's best to be very careful when updating dependencies. ### [`v16.2.0`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1620) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.6...v16.2.0) ##### Minor Changes - [#&#8203;1615](https://github.com/lint-staged/lint-staged/pull/1615) [`99eb742`](https://github.com/lint-staged/lint-staged/commit/99eb74200e8db69e72dba45314025953b8b0794e) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Added a new option `--fail-on-changes` to make *lint-staged* exit with code 1 when tasks modify any files, making the `precommit` hook fail. This is similar to the `git diff --exit-code` option. Using this flag also implies the `--no-revert` flag which means any changes made by tasks will be left in the working tree after failing, so that they can be manually staged and the commit tried again. - [#&#8203;1611](https://github.com/lint-staged/lint-staged/pull/1611) [`cd05fd3`](https://github.com/lint-staged/lint-staged/commit/cd05fd349594baf586fbafb05588ff07d86060b7) Thanks [@&#8203;rlorenzo](https://github.com/rlorenzo)! - Added a new option `--continue-on-error` so that *lint-staged* will run all tasks to completion even if some of them fail. By default, *lint-staded* will exit early on the first failure. - [#&#8203;1637](https://github.com/lint-staged/lint-staged/pull/1637) [`82fcc07`](https://github.com/lint-staged/lint-staged/commit/82fcc0789c17bf6b2ea2649147abec77fa619375) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Internal *lint-staged* errors are now thrown and visible in the console output. Previously they were caught with the process exit code set to 1, but not logged. This happens when, for example, there's a syntax error in the *lint-staged* configuration file. - [#&#8203;1647](https://github.com/lint-staged/lint-staged/pull/1647) [`a5ecc06`](https://github.com/lint-staged/lint-staged/commit/a5ecc0605d52756167417c84cb0007ea7bceaaa3) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Remove [debug](https://github.com/debug-js/debug) as a dependency due to recent malware issue; read more at https://github.com/debug-js/debug/issues/1005. Because of this, the `DEBUG` environment variable is no longer supported — use the `--debug` to enable debugging - [#&#8203;1636](https://github.com/lint-staged/lint-staged/pull/1636) [`8db2717`](https://github.com/lint-staged/lint-staged/commit/8db2717574ebfa2b80e0fc4eb0b24d705fd264fc) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Added a new option `--hide-unstaged` so that *lint-staged* will hide all unstaged changes to tracked files before running tasks. The changes will be applied back after running the tasks. Note that the combination of flags `--hide-unstaged --no-hide-partially-staged` isn't meaningful and behaves the same as just `--hide-unstaged`. Thanks to [@&#8203;ItsNickBarry](https://github.com/ItsNickBarry) for the idea and initial implementation in [#&#8203;1552](https://github.com/lint-staged/lint-staged/pull/1552). - [#&#8203;1648](https://github.com/lint-staged/lint-staged/pull/1648) [`7900b3b`](https://github.com/lint-staged/lint-staged/commit/7900b3b79c5e2e69662cb8b1bcbcae79c3549421) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Remove [lilconfig](https://github.com/antonk52/lilconfig) to reduce reliance on third-party dependencies. It was used to find possible config files outside of those tracked in Git, including from the parent directories. This behavior has been moved directly into *lint-staged* and should work about the same. ##### Patch Changes - [#&#8203;1633](https://github.com/lint-staged/lint-staged/pull/1633) [`7f9e485`](https://github.com/lint-staged/lint-staged/commit/7f9e485a981707897e0d417f6a62008f0c098e00) Thanks [@&#8203;dependabot](https://github.com/apps/dependabot)! - Bumps [listr2](https://github.com/listr2/listr2) from 9.0.3 to 9.0.4. - [#&#8203;1626](https://github.com/lint-staged/lint-staged/pull/1626) [`99d5a9b`](https://github.com/lint-staged/lint-staged/commit/99d5a9b0ddcba7d471d39ff3969d37988f1e2705) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Due to recent phishing attacks, for example [chalk@5.6.1](https://github.com/chalk/chalk/issues/656) was released with malware. To avoid *lint-staged*'s users being at risk the **direct dependencies are pinned to exact versions**, instead of allowing future patch versions with the [caret (`^`) range](https://docs.npmjs.com/cli/v6/using-npm/semver#caret-ranges-123-025-004). - [#&#8203;1588](https://github.com/lint-staged/lint-staged/pull/1588) [`035bbf2`](https://github.com/lint-staged/lint-staged/commit/035bbf268ac47bbaf2cfa737c3b2240d38feb22e) Thanks [@&#8203;outslept](https://github.com/outslept)! - Increase performance by listing staged files and searching for configuration concurrently. - [#&#8203;1645](https://github.com/lint-staged/lint-staged/pull/1645) [`deba3ad`](https://github.com/lint-staged/lint-staged/commit/deba3ad83581938dd71b86b563e62827b5fc2a0a) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Remove [chalk](https://github.com/chalk/chalk) as a dependency due to recent malware issue; read more at https://github.com/chalk/chalk/issues/656. If you are having trouble with ANSI color codes when using *lint-staged*, you can try setting either `FORCE_COLOR=true` or `NO_COLOR=true` env variables. ### [`v16.1.6`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1616) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.5...v16.1.6) ##### Patch Changes - [#&#8203;1610](https://github.com/lint-staged/lint-staged/pull/1610) [`e93578e`](https://github.com/lint-staged/lint-staged/commit/e93578e265a69ed6b02fcaa11486078c1bdbdaaa) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Try to improve terminating of subprocess of tasks by using `SIGKILL`, and only calling `pidtree` when the the main task process has a known pid. ### [`v16.1.5`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1615) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.4...v16.1.5) ##### Patch Changes - [#&#8203;1608](https://github.com/lint-staged/lint-staged/pull/1608) [`4e3ce22`](https://github.com/lint-staged/lint-staged/commit/4e3ce225b33f759f78a84d156189dc38e536cdc6) Thanks [@&#8203;srsatt](https://github.com/srsatt)! - Detect the git repo's top-level directory correctly when in a worktree. ### [`v16.1.4`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1614) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.3...v16.1.4) ##### Patch Changes - [#&#8203;1604](https://github.com/lint-staged/lint-staged/pull/1604) [`90b37b0`](https://github.com/lint-staged/lint-staged/commit/90b37b00c2c30b9cacf6c080f6a0885e1151eb7a) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Add another `types` field to `package.json` to make even more sure NPM detects that *lint-staged* includes built-in TypeScript type definitions. ### [`v16.1.3`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1613) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.2...v16.1.3) ##### Patch Changes - [#&#8203;1602](https://github.com/lint-staged/lint-staged/pull/1602) [`7ea700b`](https://github.com/lint-staged/lint-staged/commit/7ea700bcf3d0078a01720a9c8dc13a271387afbd) Thanks [@&#8203;dword-design](https://github.com/dword-design)! - Add the `types` field to `package.json` to make sure NPM detects *lint-staged* includes built-in TypeScript type definitions. ### [`v16.1.2`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1612) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.1...v16.1.2) ##### Patch Changes - [#&#8203;1570](https://github.com/lint-staged/lint-staged/pull/1570) [`a7c0c88`](https://github.com/lint-staged/lint-staged/commit/a7c0c88bcfe94e695528cb33e69fea58586691fc) Thanks [@&#8203;ItsNickBarry](https://github.com/ItsNickBarry)! - When using `--diff-filter` with the `D` option to include deleted staged files, *lint-staged* no longer tries to stage the deleted files, unless they're no longer deleted. Previously this caused an error from `git add` like `fatal: pathspec 'deleted-file' did not match any files`. - [`38f942e`](https://github.com/lint-staged/lint-staged/commit/38f942ecc456355d5f12af68db1696f3411f65c2) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Removed an extraneous log entry that printed `shouldHidePArtiallyStagedFiles` to console output. ### [`v16.1.1`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1611) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.1.0...v16.1.1) ##### Patch Changes - [#&#8203;1565](https://github.com/lint-staged/lint-staged/pull/1565) [`3686977`](https://github.com/lint-staged/lint-staged/commit/3686977ccdadf70b709c16c0346ef6c2b18e2376) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - *Lint-staged* now explicitly warns about potential data loss when using `--no-stash`. - [#&#8203;1571](https://github.com/lint-staged/lint-staged/pull/1571) [`02299a9`](https://github.com/lint-staged/lint-staged/commit/02299a9e4f98a05c13beb27f3596af73aaa8c150) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Function tasks (introduced in v16.0.0) only receive the staged files matching the configured glob, instead of all staged files. - [#&#8203;1563](https://github.com/lint-staged/lint-staged/pull/1563) [`bc61c74`](https://github.com/lint-staged/lint-staged/commit/bc61c74383b6d100c55b8d275b979d583ffbe5a1) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - This version fixes incorrect behavior where unstaged changes were committed when using the `--no-stash` option. This happened because `--no-stash` implied `--no-hide-partially-staged`, meaning unstaged changes to files which also had other staged changes were added to the commit by *lint-staged*; this is no longer the case. The previous (incorrect) behavior can still be achieved by using both options `--no-stash --no-hide-partially-staged` at the same time. ### [`v16.1.0`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1610) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v16.0.0...v16.1.0) ##### Minor Changes - [#&#8203;1536](https://github.com/lint-staged/lint-staged/pull/1536) [`e729daa`](https://github.com/lint-staged/lint-staged/commit/e729daa3b3ae28e613f63e730652dbfad5d1c594) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - A new flag `--no-revert` has been introduced for when task modifications should be applied to the index before aborting the commit in case of errors. By default, *lint-staged* will clear all task modifications and revert to the original state. - [#&#8203;1550](https://github.com/lint-staged/lint-staged/pull/1550) [`b27fa3f`](https://github.com/lint-staged/lint-staged/commit/b27fa3fecb75bcdcaa4bcd483c9d5c0755a22607) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - *Lint-staged* now ignores symlinks and leaves them out from the list of staged files. ##### Patch Changes - [#&#8203;1558](https://github.com/lint-staged/lint-staged/pull/1558) [`c37dc38`](https://github.com/lint-staged/lint-staged/commit/c37dc38dddbdebc41df4dbd909d79c98c3f69eb3) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - The minimum required Node.js version is lowered to `20.17` following [nano-spawn@1.0.2](https://github.com/sindresorhus/nano-spawn/releases/tag/v1.0.2). ### [`v16.0.0`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1600) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.5.2...v16.0.0) ##### Major Changes - [#&#8203;1546](https://github.com/lint-staged/lint-staged/pull/1546) [`158d15c`](https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Processes are spawned using [nano-spawn](https://github.com/sindresorhus/nano-spawn) instead of [execa](https://github.com/sindresorhus/execa). If you are using Node.js scripts as tasks, you might need to explicitly run them with `node`, especially when using Windows: ```json { "*.js": "node my-js-linter.js" } ``` - [#&#8203;1546](https://github.com/lint-staged/lint-staged/pull/1546) [`158d15c`](https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba) Thanks [@&#8203;iiroj](https://github.com/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 `"$@&#8203;"`: ```shell ``` ### [`v15.5.2`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1552) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.5.1...v15.5.2) ##### Patch Changes - [#&#8203;1544](https://github.com/lint-staged/lint-staged/pull/1544) [`5561321`](https://github.com/lint-staged/lint-staged/commit/556132176afce1701b4766c00ffd23159d437cb4) Thanks [@&#8203;YimingIsCOLD](https://github.com/YimingIsCOLD)! - Correctly handle colon (`:`) characters in staged filenames. ### [`v15.5.1`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1551) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.5.0...v15.5.1) ##### Patch Changes - [#&#8203;1533](https://github.com/lint-staged/lint-staged/pull/1533) [`5d53534`](https://github.com/lint-staged/lint-staged/commit/5d535349958a939cd17d87180196bb2b9dfc452b) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Improve listing of staged files so that *lint-staged* doesn't crash when encountering an uninitialized submodule. This should result in less errors like: ``` ✖ Failed to get staged files! ``` ### [`v15.5.0`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1550) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.4.3...v15.5.0) ##### Minor Changes - [#&#8203;1526](https://github.com/lint-staged/lint-staged/pull/1526) [`630af5f`](https://github.com/lint-staged/lint-staged/commit/630af5fb48ed43eb6ccaefa7a9d9612309023b6f) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Lint-staged no longer resets to the original state when preventing an empty git commit. This happens when your configured tasks reset all the staged changes, typically when trying to commit formatting changes which conflict with your linter setup like ESLint or Prettier. ##### Example with Prettier By default Prettier [prefers double quotes](https://prettier.io/docs/rationale#strings). ##### Previously 1. Stage `file.js` with only double quotes `"` changed to `'` 2. Run `git commit -am "I don't like double quotes"` 3. *Lint-staged* runs `prettier --write file.js`, converting all the `'` back to `"` 4. Because there are now no changes, *lint-staged* fails, cancels the commit, and resets back to the original state 5. Commit was not done, original state is restored and single quotes `'` are staged ##### Now 1. Stage `file.js` with only double-quotes `"` changed to `'` 2. Run `git commit -am "I don't like double quotes"` 3. *Lint-staged* runs `prettier --write file.js`, converting all the `'` back to `"` 4. Because there are now no changes, *lint-staged* fails and cancels the commit 5. Commit was not done, and there are no staged changes ### [`v15.4.3`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1543) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.4.2...v15.4.3) ##### Patch Changes - [#&#8203;1512](https://github.com/lint-staged/lint-staged/pull/1512) [`cbfed1d`](https://github.com/lint-staged/lint-staged/commit/cbfed1dfd2465c4198c692955281f0836600bea1) Thanks [@&#8203;tarik02](https://github.com/tarik02)! - Adjust TypeScript types for the default export so that it can be used as a value without error TS2693. ### [`v15.4.2`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1542) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.4.1...v15.4.2) ##### Patch Changes - [#&#8203;1509](https://github.com/lint-staged/lint-staged/pull/1509) [`8827ebf`](https://github.com/lint-staged/lint-staged/commit/8827ebf29dc8f25149a36450b4a0023425202e18) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Change *lint-staged*'s dependencies to use [caret (`^`) ranges](https://docs.npmjs.com/cli/v6/using-npm/semver#caret-ranges-123-025-004) instead of [tilde (`~`)](https://docs.npmjs.com/cli/v6/using-npm/semver#tilde-ranges-123-12-1). This makes it easier for package managers to perform dependency management when minor-level updates are also permitted instead of just patch-level. ### [`v15.4.1`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1541) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.4.0...v15.4.1) ##### Patch Changes - [#&#8203;1504](https://github.com/lint-staged/lint-staged/pull/1504) [`1c7a45e`](https://github.com/lint-staged/lint-staged/commit/1c7a45ed2c7fee9d5f55337be16a51e4c9b240e1) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Default TypeScript config filenames match JS equivalents. - [#&#8203;1504](https://github.com/lint-staged/lint-staged/pull/1504) [`9cc18c9`](https://github.com/lint-staged/lint-staged/commit/9cc18c9debb185490f9ae4f9c1d21ec8c2587393) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Add missing conditional exports syntax for TypeScript types. ### [`v15.4.0`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1540) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.3.0...v15.4.0) ##### Minor Changes - [#&#8203;1500](https://github.com/lint-staged/lint-staged/pull/1500) [`a8ec1dd`](https://github.com/lint-staged/lint-staged/commit/a8ec1ddb587d2c1c2420dbb4baff8160f0ac46c9) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - *Lint-staged* now provides TypeScript types for the configuration and main Node.js API. You can use the JSDoc syntax in your JS configuration files: ```js /** * @&#8203;filename: lint-staged.config.js * @&#8203;type {import('lint-staged').Configuration} */ export default { '*': 'prettier --write', } ``` It's also possible to use the `.ts` file extension for the configuration if your Node.js version supports it. The `--experimental-strip-types` flag was introduced in [Node.js v22.6.0](https://github.com/nodejs/node/releases/tag/v22.6.0) and unflagged in [v23.6.0](https://github.com/nodejs/node/releases/tag/v23.6.0), enabling Node.js to execute TypeScript files without additional configuration. ```shell export NODE_OPTIONS="--experimental-strip-types" npx lint-staged --config lint-staged.config.ts ``` ##### Patch Changes - [#&#8203;1501](https://github.com/lint-staged/lint-staged/pull/1501) [`9b79364`](https://github.com/lint-staged/lint-staged/commit/9b793640e1f87b46e4f40fcfc1ecf9d6f6013ac9) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Handle possible failures when logging user shell for debug info. ### [`v15.3.0`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1530) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.2.11...v15.3.0) ##### Minor Changes - [#&#8203;1495](https://github.com/lint-staged/lint-staged/pull/1495) [`e69da9e`](https://github.com/lint-staged/lint-staged/commit/e69da9e614db2d45f56e113d45d5ec0157813423) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Added more info to the debug logs so that "environment" info doesn't need to be added separately to GitHub issues. - [#&#8203;1493](https://github.com/lint-staged/lint-staged/pull/1493) [`fa0fe98`](https://github.com/lint-staged/lint-staged/commit/fa0fe98104f8885f673b98b8b49ae586de699c5e) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Added more help messages around the automatic `git stash` that *lint-staged* creates as a backup (by default). The console output also displays the short git *hash* of the stash so that it's easier to recover lost files in case some fatal errors are encountered, or the process is killed before completing. For example: ``` % npx lint-staged ✔ Backed up original state in git stash (20addf8) ✔ Running tasks for staged files... ✔ Applying modifications from tasks... ✔ Cleaning up temporary files... ``` where the backup can be seen with `git show 20addf8`, or `git stash list`: ``` % git stash list stash@{0}: lint-staged automatic backup (20addf8) ``` ### [`v15.2.11`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#15211) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.2.10...v15.2.11) ##### Patch Changes - [#&#8203;1484](https://github.com/lint-staged/lint-staged/pull/1484) [`bcfe309`](https://github.com/lint-staged/lint-staged/commit/bcfe309fca88aedf42b6a321383de49eb361c5a0) Thanks [@&#8203;wormsik](https://github.com/wormsik)! - Escape paths containing spaces when using the "shell" option. - [#&#8203;1487](https://github.com/lint-staged/lint-staged/pull/1487) [`7dd8caa`](https://github.com/lint-staged/lint-staged/commit/7dd8caa8f80fe1a6ce40939c1224b6774000775a) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Do not treat submodule root paths as "staged files". This caused *lint-staged* to fail to a Git error when only updating the revision of a submodule. ### [`v15.2.10`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#15210) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.2.9...v15.2.10) ##### Patch Changes - [#&#8203;1471](https://github.com/lint-staged/lint-staged/pull/1471) [`e3f283b`](https://github.com/lint-staged/lint-staged/commit/e3f283b250868b7c15ceb54d2a51b2e5fb3a18a9) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Update minor dependencies, including `micromatch@~4.0.8`. ### [`v15.2.9`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1529) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.2.8...v15.2.9) ##### Patch Changes - [#&#8203;1463](https://github.com/lint-staged/lint-staged/pull/1463) [`b69ce2d`](https://github.com/lint-staged/lint-staged/commit/b69ce2ddfd5a7ae576f4fef4afc60b8a81f3c945) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - Set the maximum number of event listeners to the number of tasks. This should silence the console warning `MaxListenersExceededWarning: Possible EventEmitter memory leak detected`. ### [`v15.2.8`](https://github.com/lint-staged/lint-staged/blob/HEAD/CHANGELOG.md#1528) [Compare Source](https://github.com/lint-staged/lint-staged/compare/v15.2.7...v15.2.8) ##### Patch Changes - [`f0480f0`](https://github.com/lint-staged/lint-staged/commit/f0480f01b24b9f6443a12515d413a7ba4dda3981) Thanks [@&#8203;iiroj](https://github.com/iiroj)! - In the previous version the native `git rev-parse --show-toplevel` command was taken into use for resolving the current git repo root. This version switched the `--show-toplevel` flag with `--show-cdup`, because on Git installed via MSYS2 the former was returning absolute paths that do not work with Node.js `child_process`. The new flag returns a path relative to the working directory, avoiding the issue. The GitHub Actions workflow has been updated to install Git via MSYS2, to ensure better future compatibility; using the default Git binary in the GitHub Actions runner was working correctly even with MSYS2. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjQuMCIsInVwZGF0ZWRJblZlciI6IjQwLjYyLjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/lint-staged-16.x:renovate/lint-staged-16.x
git switch renovate/lint-staged-16.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff renovate/lint-staged-16.x
git switch renovate/lint-staged-16.x
git rebase main
git switch main
git merge --ff-only renovate/lint-staged-16.x
git switch renovate/lint-staged-16.x
git rebase main
git switch main
git merge --no-ff renovate/lint-staged-16.x
git switch main
git merge --squash renovate/lint-staged-16.x
git switch main
git merge --ff-only renovate/lint-staged-16.x
git switch main
git merge renovate/lint-staged-16.x
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
NB-Public/rocketchat2matrix!159
No description provided.