[Snyk] Upgrade lint-staged from 10.5.4 to 16.1.5 #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade lint-staged from 10.5.4 to 16.1.5.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 93 versions ahead of your current version.
The recommended version was released 23 days ago.
Issues fixed by the recommended upgrade:
SNYK-JS-ANSIREGEX-1583908
SNYK-JS-ANSIREGEX-1583908
SNYK-JS-BODYPARSER-7926860
SNYK-JS-BRACES-6838727
SNYK-JS-DECODEURICOMPONENT-3149970
SNYK-JS-FOLLOWREDIRECTS-6141137
SNYK-JS-GETFUNCNAME-5923417
SNYK-JS-JSONSCHEMA-1920922
SNYK-JS-WS-7266574
SNYK-JS-QS-3153490
SNYK-JS-QS-3153490
SNYK-JS-SEMVER-3247795
SNYK-JS-SEMVER-3247795
SNYK-JS-SHELLQUOTE-1766506
SNYK-JS-TARFS-10293725
SNYK-JS-TARFS-9535930
SNYK-JS-UAPARSERJS-3244450
SNYK-JS-BABELHELPERS-9397697
SNYK-JS-BABELRUNTIME-10044504
SNYK-JS-COOKIE-8163060
SNYK-JS-EJS-6689533
SNYK-JS-FOLLOWREDIRECTS-2332181
SNYK-JS-FOLLOWREDIRECTS-6444610
SNYK-JS-LOADERUTILS-3042992
SNYK-JS-LOADERUTILS-3105943
SNYK-JS-MICROMATCH-6838728
SNYK-JS-MINIMATCH-3050818
SNYK-JS-OCTOKITENDPOINT-8730856
SNYK-JS-OCTOKITPLUGINPAGINATEREST-8730855
SNYK-JS-OCTOKITREQUEST-8730853
SNYK-JS-OCTOKITREQUESTERROR-8730854
SNYK-JS-PATHTOREGEXP-7925106
SNYK-JS-POSTCSS-5926692
SNYK-JS-ROLLUP-8073097
SNYK-JS-TMP-11501554
SNYK-JS-BRACEEXPANSION-9789073
SNYK-JS-BRACEEXPANSION-9789073
SNYK-JS-FOLLOWREDIRECTS-2396346
SNYK-JS-MINIMIST-2429795
Release notes
Package name: lint-staged
Patch Changes
4e3ce22
Thanks @ srsatt! - Detect the git repo's top-level directory correctly when in a worktree.Patch Changes
90b37b0
Thanks @ iiroj! - Add anothertypes
field topackage.json
to make even more sure NPM detects that lint-staged includes built-in TypeScript type definitions.Patch Changes
7ea700b
Thanks @ dword-design! - Add thetypes
field topackage.json
to make sure NPM detects lint-staged includes built-in TypeScript type definitions.Patch Changes
#1570
a7c0c88
Thanks @ ItsNickBarry! - When using--diff-filter
with theD
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 fromgit add
likefatal: pathspec 'deleted-file' did not match any files
.38f942e
Thanks @ iiroj! - Removed an extraneous log entry that printedshouldHidePArtiallyStagedFiles
to console output.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.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
c37dc38
Thanks @ iiroj! - The minimum required Node.js version is lowered to20.17
following nano-spawn@1.0.2.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:#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"$@"
:#!/bin/bash
echo "Staged files: $@"
and
If you were using the shell option to avoid passing filenames to tasks, for example
bash -c 'tsc --noEmit'
, use the function syntax instead:#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: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.
Patch Changes
5561321
Thanks @ YimingIsCOLD! - Correctly handle colon (:
) characters in staged filenames.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: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
file.js
with only double quotes"
changed to'
git commit -am "I don't like double quotes"
prettier --write file.js
, converting all the'
back to"
'
are stagedNow
file.js
with only double-quotes"
changed to'
git commit -am "I don't like double quotes"
prettier --write file.js
, converting all the'
back to"
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: