Skip to content

Latest commit

Β 

History

History
1793 lines (994 loc) Β· 97.4 KB

CHANGELOG.md

File metadata and controls

1793 lines (994 loc) Β· 97.4 KB

lint-staged

15.2.10

Patch Changes

15.2.9

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.

15.2.8

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.

15.2.7

Patch Changes

  • #1440 a51be80 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 drops the --path-format=absolute option to support earlier git versions since it's also the default behavior. If you are still having trouble, please try upgrading git to the latest version.

15.2.6

Patch Changes

  • #1433 119adb2 Thanks @iiroj! - Use native "git rev-parse" commands to determine git repo root directory and the .git config directory, instead of using custom logic. This hopefully makes path resolution more robust on non-POSIX systems.

15.2.5

Patch Changes

  • #1424 31a1f95 Thanks @iiroj! - Allow approximately equivalent versions of direct dependencies by using the "~" character in the version ranges. This means a more recent patch version of a dependency is allowed if available.

  • #1423 91abea0 Thanks @iiroj! - Improve error logging when failing to read or parse a configuration file

  • #1424 ee43f15 Thanks @iiroj! - Upgrade micromatch@4.0.7

15.2.4

Patch Changes

  • 4f4537a Thanks @iiroj! - Fix release issue with previous version; update dependencies

15.2.3

Patch Changes

15.2.2

Patch Changes

  • #1391 fdcdad4 Thanks @iiroj! - Lint-staged no longer tries to load configuration from files that are not checked out. This might happen when using sparse-checkout.

15.2.1

Patch Changes

  • #1387 e4023f6 Thanks @iiroj! - Ignore stdin of spawned commands so that they don't get stuck waiting. Until now, lint-staged has used the default settings to spawn linter commands. This means the stdin of the spawned commands has accepted input, and essentially gotten stuck waiting. Now the stdin is ignored and commands will no longer get stuck. If you relied on this behavior, please open a new issue and describe how; the behavior has not been intended.

15.2.0

Minor Changes

  • #1371 f3378be Thanks @iiroj! - Using the --no-stash flag no longer discards all unstaged changes to partially staged files, which resulted in inadvertent data loss. This fix is available with a new flag --no-hide-partially-staged that is automatically enabled when --no-stash is used.

Patch Changes

  • #1362 17bc480 Thanks @antonk52! - update lilconfig@3.0.0

  • #1368 7c55ca9 Thanks @iiroj! - Update most dependencies

  • #1368 777d4e9 Thanks @iiroj! - To improve performance, only use lilconfig when searching for config files outside the git repo. In the regular case, lint-staged finds the config files from the Git index and loads them directly.

  • #1373 85eb0dd Thanks @iiroj! - When determining git directory, use fs.realpath() only for symlinks. It looks like fs.realpath() changes some Windows mapped network filepaths unexpectedly, causing issues.

15.1.0

Minor Changes

  • #1344 0423311 Thanks @danielbayley! - Add support for loading configuration from package.yaml and package.yml files, supported by pnpm.

Patch Changes

15.0.2

Patch Changes

  • #1339 8e82364 Thanks @iiroj! - Update dependencies, including listr2@7.0.2 to fix an upstream issue affecting lint-staged.

15.0.1

Patch Changes

  • #1217 d2e6f8b Thanks @louneskmt! - Previously it was possible for a function task to mutate the list of staged files passed to the function, and accidentally affect the generation of other tasks. This is now fixed by passing a copy of the original file list instead.

15.0.0

Major Changes

  • #1322 66b93aa Thanks @iiroj! - Require at least Node.js 18.12.0

    This release drops support for Node.js 16, which is EOL after 2023-09-11. Please upgrade your Node.js to the latest version.

    Additionally, all dependencies have been updated to their latest versions.

v14.0.1 - 21 Aug 2023

Bug Fixes

  • fix reading config from stdin, introduced in v14.0.0 (#1317) (fc3bfea)

v14.0.0 - 13 Aug 2023

Features

BREAKING CHANGES

  • Please upgrade your Node.js version to at least 16.14.0.

v13.3.0 - 13 Aug 2023

Bug Fixes

  • dependencies: update most dependencies (7443870)
  • detect duplicate redundant braces in pattern (d895aa8)

Features

  • dependencies: update listr2@6.6.0 (09844ca)

v13.2.3 - 28 Jun 2023

Bug Fixes

  • the --diff option implies --no-stash (66a716d)

v13.2.2 - 26 Apr 2023

Bug Fixes

  • dependencies: update yaml@2.2.2 (GHSA-f9xv-q969-pqx4) (#1290) (cf691aa)

v13.2.1 - 07 Apr 2023

Bug Fixes

  • ignore "package.json" as config file when it's invalid JSON (#1281) (e7ed6f7)

v13.2.0 - 10 Mar 2023

Bug Fixes

  • dependencies: replace colorette with chalk for better color support detection (f598725)
  • use index-based stash references for improved MSYS2 compatibility (#1270) (60fcd99)

Features

v13.1.2 - 13 Feb 2023

Bug Fixes

  • disable stash by default when using diff option (#1259) (142c6f2)

v13.1.1 - 07 Feb 2023

Bug Fixes

  • allow re-enabling --stash when using the --diff option (99390c3)

v13.1.0 - 04 Dec 2022

Features

  • expose cli entrance from "lint-staged/bin" (#1237) (eabf1d2)

v13.0.4 - 25 Nov 2022

Bug Fixes

  • deps: update all dependencies (336f3b5)
  • deps: update all dependencies (ec995e5)

v13.0.3 - 24 Jun 2022

Bug Fixes

  • correctly handle git stash when using MSYS2 (#1178) (0d627a5)

v13.0.2 - 16 Jun 2022

Bug Fixes

  • use new --diff and --diff-filter options when checking task modifications (1a5a66a)

v13.0.1 - 08 Jun 2022

Bug Fixes

  • correct spelling of "0 files" (f27f1d4)
  • suppress error from process.kill when killing tasks on failure (f2c6bdd)
  • deps: update pidtree@^0.6.0 to fix screen size error in WSL (1a77e42)
  • ignore "No matching pid found" error (cb8a432)
  • prevent possible race condition when killing tasks on failure (bc92aff)

Performance Improvements

  • use EventsEmitter instead of setInterval for killing tasks on failure (c508b46)

v13.0.0 - 01 Jun 2022

Bug Fixes

  • deps: update execa@^6.1.0 (659c85c)
  • deps: update yaml@^2.1.1 (2750a3d)

Features

  • remove support for Node.js 12 (5fb6df9)

BREAKING CHANGES

  • lint-staged will no longer support Node.js 12, which is EOL since 30 April 2022

v12.5.0 - 31 May 2022

Bug Fixes

  • include all files when using --config <path> (641d1c2)
  • skip backup stash when using the --diff option (d4da24d)

Features

  • add --diff-filter option for overriding list of (staged) files (753ef72)
  • add --diff option for overriding list of (staged) files (35fcce9)

v12.4.3 - 30 May 2022

Bug Fixes

  • deps: downgrade yaml@1.10.2 to support Node.js 12 (383a96e)
  • deps: update commander@^9.2.0 (22ebf52)
  • deps: update yaml@^2.0.1 (ec73af0)

v12.4.2 - 24 May 2022

Bug Fixes

  • correctly handle --max-arg-length cli option (1db5f26)

v12.4.1 - 26 Apr 2022

Bug Fixes

  • correctly handle symlinked config files (b3f63ec)

v12.4.0 - 20 Apr 2022

Bug Fixes

  • handle empty input by returning empty array from parseGitZOutput (a118817)
  • limit configuration discovery to cwd (d8fdf1d)
  • restore functionality of parent globs for a single configuration file (877ab4c)

Features

  • expose --max-arg-length cli option (e8291b0)

v12.3.8 - 15 Apr 2022

Bug Fixes

  • avoid passing unexpected arguments from forEach to process.kill() (1b1f0e4)
  • clear execution interruption interval on first catch (46952cb)

v12.3.7 - 17 Mar 2022

Bug Fixes

  • improve renderer logic for --silent and FORCE_COLOR settings (d327873)

v12.3.6 - 16 Mar 2022

Bug Fixes

v12.3.5 - 05 Mar 2022

Bug Fixes

  • search all configs regardless of staged files (4b605cd)

v12.3.4 - 13 Feb 2022

Bug Fixes

v12.3.3 - 01 Feb 2022

Bug Fixes

  • use config directory as cwd, when multiple configs present (#1091) (9a14e92)

v12.3.2 - 26 Jan 2022

Bug Fixes

  • handle symlinked .git directories (3a897ff)

v12.3.1 - 23 Jan 2022

Bug Fixes

  • deps: update dependencies (f190fc3)

v12.3.0 - 23 Jan 2022

Features

  • add --cwd option for overriding task directory (62b5b83)

v12.2.2 - 20 Jan 2022

Bug Fixes

  • always search config from cwd first (4afcda5)

v12.2.1 - 19 Jan 2022

Bug Fixes

  • only throw if no configurations were found (36b9546)

v12.2.0 - 18 Jan 2022

Bug Fixes

  • make console task titles more explicit (1c94c27)

Features

  • support multiple configuration files (90d1035)

v12.1.7 - 07 Jan 2022

Bug Fixes

  • resolve config modules with ESM createRequire (#1082) (f9f6538)

v12.1.6 - 07 Jan 2022

Bug Fixes

  • always run non-git tasks in the current working directory (893f3d7)

v12.1.5 - 02 Jan 2022

Bug Fixes

  • search configuration starting from explicit cwd option (c7ea359)
  • using --debug option enables debug mode (5cceeb6)

v12.1.4 - 24 Dec 2021

Bug Fixes

  • use cwd option when resolving git repo root (#1075) (a230b03)

v12.1.3 - 18 Dec 2021

Bug Fixes

  • deps: remove enquirer because it's now optional by listr2 (96a1a29)

v12.1.2 - 22 Nov 2021

Bug Fixes

  • fix Windows JS config loading by using file:// URLs (f20ddf9)
  • fix YAML config loading (0082ec2)
  • improve error logging in loadConfig (e7b6412)

v12.1.1 - 21 Nov 2021

Bug Fixes

  • await for dynamic import promise when loading JS config (e96b6d9)

v12.1.0 - 21 Nov 2021

Features

  • allow loading .js config file with ESM syntax (410c3ba)
  • replace cosmiconfig with lilconfig + yaml to reduce dependencies (e7f9fa0)
  • support loading .mjs config (8d3b176)

v12.0.3 - 18 Nov 2021

Bug Fixes

v12.0.2 - 14 Nov 2021

Bug Fixes

v12.0.1 - 13 Nov 2021

Bug Fixes

  • read version number from lint-staged package.json instead of package.json in cwd (#1043) (#1044) (9f9213d)

v12.0.0 - 13 Nov 2021

Features

BREAKING CHANGES

  • lint-staged is now a pure ESM module, and thus requires Node.js version ^12.20.0 || ^14.13.1 || >=16.0.0.

To update your Node.js integration, please use:

// const lintStaged = require('lint-staged')
import lintStaged from 'lint-staged'

v11.3.0-beta.2 - 30 Oct 2021

Bug Fixes

Performance Improvements

v11.2.6 - 26 Oct 2021

Bug Fixes

v11.2.5 - 26 Oct 2021

Bug Fixes

  • correctly import js-yaml to fix yaml config loading (#1033) (612d806)

v11.2.4 - 23 Oct 2021

Performance Improvements

v11.2.3 - 10 Oct 2021

Bug Fixes

  • unbreak windows by correctly normalizing cwd (#1029) (f861d8d)

v11.2.2 - 09 Oct 2021

Bug Fixes

v11.2.1 - 09 Oct 2021

Bug Fixes

v11.3.0-beta.1 - 04 Oct 2021

Bug Fixes

  • add --no-stash as hidden option for backwards-compatibility (73db492)
  • do not apply empty patch (a7c1c0b)
  • do not use fs/promises for Node.js 12 compatibility (c99a6a1)
  • restore original state when preventing an empty commit (f7ef8ef)
  • restore previous order of jobs (ba62b22)

Features

  • do not use a git stash for better performance (ff0cc0d)

Performance Improvements

  • further optimize by reusing previous job (3066a35)
  • re-use figures from listr2 and remove log-symbols (5240c26)
  • replace chalk with colorette and supports-color (4de4cda)

v11.2.0 - 04 Oct 2021

Features

v11.2.0-beta.1 - 02 Oct 2021

Bug Fixes

  • add --no-stash as hidden option for backwards-compatibility (73db492)
  • do not apply empty patch (a7c1c0b)
  • do not use fs/promises for Node.js 12 compatibility (c99a6a1)
  • restore original state when preventing an empty commit (f7ef8ef)
  • restore previous order of jobs (ba62b22)

Features

  • do not use a git stash for better performance (ff0cc0d)

Performance Improvements

  • further optimize by reusing previous job (3066a35)
  • re-use figures from listr2 and remove log-symbols (5240c26)
  • replace chalk with colorette and supports-color (4de4cda)

v11.1.2 - 06 Aug 2021

Bug Fixes

  • try to automatically fix and warn about invalid brace patterns (#992) (b3d97cf)

v11.1.1 - 24 Jul 2021

Bug Fixes

  • the shell option value should be optional instead of required (#996) (f7302f4), closes #994

v11.1.0 - 22 Jul 2021

Features

  • allow a path to be supplied to the --shell option (#994) (fea8033)

v11.0.1 - 13 Jul 2021

Bug Fixes

  • do not swallow already detected deprecated usage by last task (#991) (7734156)

v11.0.0 - 07 May 2021

Bug Fixes

Features

  • bump Node.js version requirement to 12.13.0 (852aa6e)

BREAKING CHANGES

  • Node.js 12 LTS 'Erbium' is now the minimum required version

v10.5.4 - 05 Feb 2021

Bug Fixes

  • concurrent option is not working correctly (#950) (4383815)

v10.5.3 - 04 Dec 2020

Bug Fixes

  • better logging for errors in js config files (#935) (292e882)

v10.5.2 - 24 Nov 2020

Bug Fixes

  • use bibliography-style links in related posts section of readme (#932) (0ff2917), closes #931

v10.5.1 - 31 Oct 2020

Bug Fixes

v10.5.0 - 26 Oct 2020

Features

v10.4.2 - 17 Oct 2020

Bug Fixes

  • update docs on supported config file extensions (#917) (78782f9)

v10.4.1 - 16 Oct 2020

Bug Fixes

v10.4.0 - 16 Sep 2020

Features

  • Add ability to use function as config (#913) (67a4d06)

v10.3.0 - 03 Sep 2020

Features

  • Add support for adding lint-staged using pre-commit.com (#910) (d404d7d)

v10.2.13 - 25 Aug 2020

Bug Fixes

v10.2.12 - 25 Aug 2020

Bug Fixes

  • always use the default short diff format for submodules #902 (c7923ad)
  • ensure supportsColor.level exists before stringifying it (aa9898e)

v10.2.11 - 17 Jun 2020

Bug Fixes

  • run all git commands with submodule.recurse=false (#888) (86c9ed2)

v10.2.10 - 12 Jun 2020

Bug Fixes

  • Git directory is not correctly resolved if GIT_WORK_TREE is set to relative path (#887) (a1904ec)

v10.2.9 - 04 Jun 2020

Bug Fixes

  • update listr@2.1.0 and add enquirer peer dependency (#883) (0daae61)

v10.2.8 - 03 Jun 2020

Bug Fixes

  • canceling lint-staged via SIGINT restores state and cleans up (#881) (b078324)

v10.2.7 - 29 May 2020

Bug Fixes

  • use machine output to avoid escaped and quoted filenames (ea80a3d)

v10.2.6 - 22 May 2020

Bug Fixes

  • remove nanoid devDependency to remove ExperimentalWarning (#874) (979da5d)

v10.2.5 - 22 May 2020

Bug Fixes

  • truncate command title to stdout width (#865) (b8e1a4a)

v10.2.4 - 18 May 2020

Bug Fixes

  • node-13 deps issue with listr2 and uuid (#868) (93bc942)

v10.2.3 - 18 May 2020

Bug Fixes

v10.2.2 - 01 May 2020

Bug Fixes

  • chunkFiles chunks normalized files even when maxArgLength is set (#858) (fc72170)

v10.2.1 - 30 Apr 2020

Bug Fixes

  • normalize chunked paths even when maxArgLength is not set (ba67f48)
  • resolve matched files to cwd instead of gitDir before adding (defe045)

v10.2.0 - 28 Apr 2020

Bug Fixes

  • all lint-staged output respects the quiet option (aba3421)
  • do not show incorrect error when verbose and no output (b8df31a)
  • log task output after running listr to keep everything (d69c65b)
  • use test renderer during tests and when TERM=dumb (16848d8)

Features

  • add --verbose to show output even when tasks succeed (85de3a3)
  • allow specifying cwd using the Node.js API (a3bd9d7)
  • replace listr with listr2 and print errors inline (8f32a3e)

v10.1.7 - 21 Apr 2020

Bug Fixes

  • use stash create/store to prevent files from disappearing from disk (c9adca5)

v10.1.6 - 19 Apr 2020

Bug Fixes

  • deps: update dependencies (e093b1d)

v10.1.5 - 18 Apr 2020

Bug Fixes

  • pass correct path to unstaged patch during cleanup (6066b07)

v10.1.4 - 17 Apr 2020

Bug Fixes

  • allow lint-staged to run on empty git repo by disabling backup (0bf1fb0)

v10.1.3 - 09 Apr 2020

Bug Fixes

  • only run git add on staged files matched to a task (d39573b)
  • run git add for staged file chunks serially (69acfa3)

v10.1.2 - 05 Apr 2020

Bug Fixes

  • no longer include untracked files in backup stash (#827) (2f15336)

v10.1.1 - 31 Mar 2020

Bug Fixes

  • add -- to git add command to denote pathspec starting (#821) (226ccdb)

v10.1.0 - 30 Mar 2020

Bug Fixes

  • do not return string from runAll, add info symbol to "No staged files found." message (1e7298a)
  • force src and dst prefixes in diff to work around local diff.noprefix setting (7f2ef33)
  • unset GIT_LITERAL_PATHSPECS env variable before running (a653c55)

Features

  • add --no-stash option to disable the backup stash, and not revert in case of errors (c386e4c)
  • only hide/restore unstaged modifications to partially staged files (52125a9)

v10.0.10 - 29 Mar 2020

Bug Fixes

  • support non-ASCII filenames when git is configured with core.quotepath on (2cb26a6)

v10.0.9 - 24 Mar 2020

Bug Fixes

  • use path.join and normalize to improve msys compatibility in resolveGitRepo (1ad263a)

v10.0.8 - 25 Feb 2020

Bug Fixes

  • do not drop backup stash when reverting to original state fails (f589336)
  • evaluate functional configuration only once (abe4b92)

v10.0.7 - 31 Jan 2020

Bug Fixes

  • replace fs.promises with util.promisify (#786) (f71c1c9)

v10.0.6 - 30 Jan 2020

Bug Fixes

  • make sure deleted files aren't restored due to git bugs (#778) (6bfbe6c)

v10.0.5 - 30 Jan 2020

Bug Fixes

  • always resolve real git config dir location if .git is a file (#784) (b98a5ed)

v10.0.4 - 29 Jan 2020

Bug Fixes

v10.0.3 - 27 Jan 2020

Bug Fixes

  • correctly restore untracked files after running (#780) (4010db0)

v10.0.2 - 22 Jan 2020

Bug Fixes

  • only warn about git add when it's the exact command (24febb3)
  • parse command string with string-argv unless --shell is used (4cb4dde)
  • print a better warning when the initial commit is missing (293547d)

v10.0.1 - 20 Jan 2020

Bug Fixes

v10.0.0 - 19 Jan 2020

Bug Fixes

  • add all modified files to git index with git add . (bf532c2)
  • automatically add modifications only to originally staged files (083b8e7)
  • better workaround for git stash --keep-index bug (f3ae378)
  • correctly leave only staged files for running tasks (cfde9ca)
  • correctly recover when unstaged changes cannot be restored (d091f71)
  • correctly restore untracked files from backup stash (c7d0592)
  • error handling skips dropping backup stash after internal git errors (30b4809)
  • fail with a message when backup stash is missing (1b64239)
  • gitWorkflow handles active merge mode (2f1e886)
  • handle git MERGE_* files separately; improve error handling (da22cf2)
  • improve debug logging (f88e226)
  • keep untracked files around by backing them up (fc03fdc)
  • max arg length is by default half of the allowed to prevent edge cases (80406c2)
  • prevent Listr from hiding git add warning (cce9809)
  • restore metadata about git merge before running tasks (f8ddfc2)
  • retry failing apply with 3-way merge (76cb08f)
  • support binary files (7b3a334)
  • try applying unstaged changes before handling errors (357934f)
  • update warning about git add, and to README (6467a66)
  • workaround for stashing deleted files for git < 2.23 (1a87333)

Features

  • automatically stage task modifications (74ed28d)
  • bump Node.js version dependency to at least 10.13.0 (#747) (814b9df)
  • split tasks into chunks to support shells with limited max argument length (#732) (cb43872)
  • support async function tasks (20d5c5d)
  • throw error to prevent empty commits unless --allow-empty is used (#762) (8bdeec0)
  • use git stashes for gitWorkflow (40a5db1)
  • warn when task contains "git add" (5208399)

BREAKING CHANGES

  • Previously, lint-staged would allow empty commits in the situation where a linter task like "prettier --write" reverts all staged changes automatically. Now the default behaviour is to throw an error with a helpful warning message. The --allow empty option can be used to allow empty commits, or allowEmpty: true for the Node.js API.
  • Node.js v8 is no longer supported because it will reach EOL on 2019-12-31
  • Prior to version 10, tasks had to manually include git add as the final step. This behavior has been integrated into lint-staged itself in order to prevent race conditions with multiple tasks editing the same files. If lint-staged detects git add in task configurations, it will show a warning in the console. Please remove git add from your configuration after upgrading.

v10.0.0-beta.15 - 08 Jan 2020

Features

  • throw error to prevent empty commits unless --allow-empty is used (#762) (8bdeec0)

BREAKING CHANGES

  • Previously, lint-staged would allow empty commits in the situation where a linter task like "prettier --write" reverts all staged changes automatically. Now the default behaviour is to throw an error with a helpful warning message. The --allow empty option can be used to allow empty commits, or allowEmpty: true for the Node.js API.

v10.0.0-beta.14 - 24 Dec 2019

Bug Fixes

  • error handling skips dropping backup stash after internal git errors (30b4809)

v10.0.0-beta.13 - 20 Dec 2019

Bug Fixes

  • handle git MERGE_* files separately; improve error handling (da22cf2)

v10.0.0-beta.12 - 18 Dec 2019

Features

  • support async function tasks (20d5c5d)

v10.0.0-beta.11 - 17 Dec 2019

Bug Fixes

  • fail with a message when backup stash is missing (1b64239)

v10.0.0-beta.10 - 17 Dec 2019

Bug Fixes

  • correctly recover when unstaged changes cannot be restored (d091f71)

v10.0.0-beta.9 - 16 Dec 2019

Bug Fixes

  • restore metadata about git merge before running tasks (f8ddfc2)

v10.0.0-beta.8 - 14 Dec 2019

Bug Fixes

  • better workaround for git stash --keep-index bug (f3ae378)

v10.0.0-beta.7 - 05 Dec 2019

Bug Fixes

  • automatically add modifications only to originally staged files (083b8e7)

Features

  • bump Node.js version dependency to at least 10.13.0 (#747) (814b9df)

BREAKING CHANGES

  • Node.js v8 is no longer supported because it will reach EOL on 2019-12-31

v10.0.0-beta.6 - 27 Nov 2019

Features

  • add support for concurrent CLI option (6af8307)

v10.0.0-beta.5 - 27 Nov 2019

Bug Fixes

  • improve debug logging (f88e226)
  • max arg length is by default half of the allowed to prevent edge cases (80406c2)

v9.5.0 - 27 Nov 2019

Features

  • add support for concurrent CLI option (6af8307)

v10.0.0-beta.4 - 20 Nov 2019

Features

  • split tasks into chunks to support shells with limited max argument length (#732) (cb43872)

v10.0.0-beta.3 - 14 Nov 2019

Bug Fixes

v10.0.0-beta.2 - 14 Nov 2019

Bug Fixes

  • correctly leave only staged files for running tasks (cfde9ca)

Reverts

  • Revert "fix: no need to run git clean -df since untracked changes are stashed" (e58ebbf)

v10.0.0-beta.1 - 14 Nov 2019

Bug Fixes

  • add all modified files to git index with git add . (bf532c2)
  • correctly restore untracked files from backup stash (c7d0592)
  • gitWorkflow handles active merge mode (2f1e886)
  • keep untracked files around by backing them up (fc03fdc)
  • no need to run git clean -df since untracked changes are stashed (869bac6)
  • prevent Listr from hiding git add warning (cce9809)
  • retry failing apply with 3-way merge (76cb08f)
  • try applying unstaged changes before handling errors (357934f)
  • update warning about git add, and to README (6467a66)
  • workaround for stashing deleted files for git < 2.23 (1a87333)

Features

  • automatically stage task modifications (74ed28d)
  • use git stashes for gitWorkflow (40a5db1)
  • warn when task contains "git add" (5208399)

BREAKING CHANGES

  • Prior to version 10, tasks had to manually include git add as the final step. This behavior has been integrated into lint-staged itself in order to prevent race conditions with multiple tasks editing the same files. If lint-staged detects git add in task configurations, it will show a warning in the console. Please remove git add from your configuration after upgrading.

v9.4.3 - 13 Nov 2019

Bug Fixes

  • deps: bump eslint-utils from 1.4.0 to 1.4.3 to fix a security vulnerability (#722) (ed84d8e)

Bug Fixes

  • no need to run git clean -df since untracked changes are stashed (bbfae43)
  • update warning about git add, and to README (4fe53ef)

BREAKING CHANGES

  • Prior to version 10, tasks had to manually include git add as the final step. This behavior has been integrated into lint-staged itself in order to prevent race conditions with multiple tasks editing the same files. If lint-staged detects git add in task configurations, it will show a warning in the console. Please remove git add from your configuration after upgrading.

Bug Fixes

  • correctly restore untracked files from backup stash (0111f48)
  • gitWorkflow handles active merge mode (959d9d9)
  • keep untracked files around by backing them up (d20c5be)
  • prevent Listr from hiding git add warning (2b57db0)
  • retry failing apply with 3-way merge (30939b9)
  • try applying unstaged changes before handling errors (080f1c6)
  • workaround for stashing deleted files for git < 2.23 (50afea0)

Features

  • automatically stage task modifications (7d0379d)
  • use git stashes for gitWorkflow (bfd2adc)
  • warn when task contains "git add" (4014f3c)

v9.4.2 - 08 Oct 2019

Bug Fixes

  • create fn title with mock file list of correct length (8c3ca58)

v9.4.1 - 01 Oct 2019

Bug Fixes

v9.4.0 - 26 Sep 2019

Features

  • Use shorter title for function tasks with many staged files (#706) (1dcdb89), closes #674

v9.3.0 - 22 Sep 2019

Features

  • allow to pass config instead of configPath (14c46d2)

v9.2.5 - 27 Aug 2019

Bug Fixes

  • validateConfig validates function task return values (d8fad78)

v9.2.4 - 25 Aug 2019

Bug Fixes

  • include renames when getting list of staged files (2243a83)

v9.2.3 - 17 Aug 2019

Bug Fixes

  • don't normalize path gitDir path for better Windows compatibility (eb3fa83)
  • generateTasks handles parent dir globs correctly (82b5182)
  • normalize gitDir path to posix using normalize-path (f485e51)

v9.2.2 - 17 Aug 2019

Bug Fixes

  • apply patch only if there's a diff (e70e08f)

v9.2.1 - 25 Jul 2019

Bug Fixes

  • pin commitizen@3.1.2 to support node 8 (ee774e3)
  • pin cz-conventional-changelog@2.1.0 to support node 8 (e879b6a)
  • remove empty spaces from warning (6126b72)

v9.2.0 - 10 Jul 2019

Features

  • add --relative option for controlling file paths (242deb5)

v9.1.0 - 06 Jul 2019

Bug Fixes

  • snapshot with fully-resolved path name (b1a08b8)

Features

  • make node-api accessible (ca37906)

v9.0.2 - 03 Jul 2019

Bug Fixes

  • run all commands returned by function linters (0dd0c94)

v9.0.1 - 02 Jul 2019

Bug Fixes

v9.0.0 - 01 Jul 2019

Bug Fixes

  • parse titles for function linters (e24aaf2)

Code Refactoring

  • remove advanced configuration options (04190c8)
  • remove support for chunking (2ca9050)
  • use execa's shell option to run commands (bed9127)

Features

  • add --shell and --quiet flags (ecf9227)
  • add deprecation error for advanced configuration (4bef26e)
  • support function linter returning array of commands (36e54a2)
  • support functions as linter commands (f76c0d1)

BREAKING CHANGES

  • The advanced configuration options have been deprecated in favour of the simple format
  • Local commands are no longer resolved by lint-staged, but execa will do this instead. In effect, there are no longer pretty error messages when commands are not found.
  • Very long arguments strings are no longer chunked on Windows. Function linters should be used instead to customise this behaviour.

v8.2.1 - 13 Jun 2019

Bug Fixes

  • Override env GIT_DIR variable to resolve to the correct git dir path (#629) (5892455), closes #627

v8.2.0 - 06 Jun 2019

Bug Fixes

  • normalize gitDir path for Windows compatibility (90e343b)

Features

  • throw error in runAll if outside git directory (6ac666d)

v8.1.7 - 15 May 2019

Bug Fixes

  • Resolve security vulnerability in dependencies (#615) (315890a), closes #600

v8.1.6 - 03 May 2019

Bug Fixes

v8.1.5 - 01 Mar 2019

Bug Fixes

  • fix issue with scoped pkg listr-update-renderer (#587) (63b085f), closes #585

v8.1.4 - 14 Feb 2019

Bug Fixes

  • Use lodash version with prototype pollution fix (#578) (0be88a0)

v8.1.3 - 02 Feb 2019

Bug Fixes

  • Display package name when node-please-upgrade is being used (#575) (f5bed7b)

v8.1.2 - 02 Feb 2019

Bug Fixes

  • Avoid stashing if no staged files has been changed (#570) (#573) (8c4d9c9)

v8.1.1 - 28 Jan 2019

Bug Fixes

  • Fix configuration validation and allow specifying custom renderers (#572) (d5e738d), closes #567

v8.1.0 - 21 Nov 2018

Features

  • Add relative option to allow passing relative paths to linters (#534) (fcb774b)

v8.0.5 - 17 Nov 2018

Bug Fixes

v8.0.4 - 31 Oct 2018

Bug Fixes

  • package: update staged-git-files to version 1.1.2 (ce434d3)

v8.0.3 - 30 Oct 2018

Bug Fixes

v8.0.2 - 29 Oct 2018

Bug Fixes

  • git: Use resolveGitDir in hasPartiallyStagedFiles (#520) (af99172), closes #514

v8.0.1 - 29 Oct 2018

Bug Fixes

  • git: Use resolveGitDir to resolve to .git for git commands (#518) (da42f8a), closes #514

v8.0.0 - 29 Oct 2018

Features

  • Add support for partially staged files (#75) (f82443c), closes #62

BREAKING CHANGES

  • Node >= 8.6 is required

v7.3.0 - 20 Sep 2018

Features

  • Allow linting files outside of project folder (#495) (d386c80)

v7.2.2 - 12 Aug 2018

Bug Fixes

  • Make app package.json load error tolerant (#479) (d59fad7)

v7.2.1 - 12 Aug 2018

Bug Fixes

  • Disable recursive checks for jest-validate (#483) (c350a0e)

v7.2.0 - 11 Jun 2018

Features

  • Resolve a npm package passed as --config (#464) (c34a3f7)

v7.1.3 - 01 Jun 2018

Bug Fixes

  • package: Update jest-validate to version 23.0.0 (#458) (3d0ccb2)

v7.1.2 - 21 May 2018

Bug Fixes

  • package: Update cosmiconfig to version 5.0.2 (#444) (2fc7aa3), closes #441
  • package: Update listr to version 0.14.1 (#445) (a56d7c9), closes #426
  • Add .lintstagedrc.js to list of config files to search (9e27620)

v7.1.1 - 18 May 2018

Bug Fixes

v7.1.0 - 07 May 2018

Features

  • Chunked execution of linters on Windows only (#439) (1601c02)

v7.0.5 - 26 Apr 2018

Bug Fixes

  • Update "please-upgrade-node" to version 3.0.2 (#434) (b9d84ce)

v7.0.4 - 05 Apr 2018

Bug Fixes

  • Parse arguments with single quotes properly. Better tests. (29fc479), closes #419

v7.0.3 - 03 Apr 2018

Bug Fixes

  • Fix cli-command-parser to parse arguments for execa (b4fbc3b), closes #419
  • Use double quotes to make command work on Windows (06635c6)

v7.0.2 - 01 Apr 2018

Bug Fixes

  • Hide error message in a private field to avoid duplicate logs (#421) (4d6f165)

v7.0.1 - 30 Mar 2018

Bug Fixes

  • package: update staged-git-files to version 1.1.1 (31176c9)

v7.0.0 - 21 Feb 2018

Bug Fixes

  • package: Bump dependencies (267ff0f)

Code Refactoring

Features

Performance Improvements

BREAKING CHANGES

  • Requires Node.js v6 or later.

  • Remove implicit support for running npm scripts.

    Consider example lint-staged config:

    {
      "name": "My project",
      "version": "0.1.0",
      "scripts": {
        "my-custom-script": "linter --arg1 --arg2",
        "precommit": "lint-staged"
      },
      "lint-staged": {
        "*.js": ["my-custom-script", "git add"]
      }
    }

    The list of commands should be changed to the following:

      "*.js": ["npm run my-custom-script --", "git add"]
    
  • The following minimatch options are not supported in micromatch:

v6.1.1 - 16 Feb 2018

Bug Fixes

  • package: Update staged-git-files to version 1.0.0 (677e860)

v6.1.0 - 26 Jan 2018

Features

v6.0.1 - 19 Jan 2018

Bug Fixes

  • package: update cosmiconfig to version 4.0.0 (80596c3)

v6.0.0 - 01 Dec 2017

Features

  • Add debug mode, deprecate verbose option (#344) (8f214f0)

BREAKING CHANGES

  • verbose config option has been deprecated and is superseded by the command line option --debug.

v5.0.0 - 11 Nov 2017

Features

  • Remove gitDir option and resolve it automatically (#327) (0ed5135), closes #271

BREAKING CHANGES

  • gitDir option deprecated and will be ignored. Additionally, glob patterns for linters should not be relative to the git root directory.

Consider a project with the following file structure:

`-- packages
    |-- prj
    |   |-- package.json
    |   |-- src
    |   |   `-- index.js
    |   `-- yarn.lock
    `-- prj-2
        `-- file

With lint-staged@4.3.0, the config would need to be something like this:

gitDir: ../..
linters:
  packages/prj/src/*.js:
    - eslint --fix
    - git add

With lint-staged@5, this simplifies to:

linters:
  src/*.js:
    - eslint --fix
    - git add
diff view
@@ -1,5 +1,4 @@
-gitDir: ../..
 linters:
-  packages/prj/src/*.js:
+  src/*.js:
     - eslint --fix
     - git add

v4.3.0 - 18 Oct 2017

Features

  • Allow config to be provided via command-line (#304) (54809ae)

v4.2.3 - 25 Sep 2017

Bug Fixes

  • findBin: Add separator before npm args (#297) (065f362)

v4.2.2 - 22 Sep 2017

Bug Fixes

  • findBin: Resolve package script with args (#295) (1dc3bd6)

v4.2.1 - 15 Sep 2017

Bug Fixes

v4.2.0 - 15 Sep 2017

Features

  • Print friendlier error if config is missing (#281) (30fa594)

v4.1.3 - 07 Sep 2017

Bug Fixes

  • Unicode symbols compatibility on Windows (#248) (49b11e4)

v4.1.2 - 06 Sep 2017

Bug Fixes

  • Handle the case when staged-git-files errors properly (#267) (a8a585a), closes #264

v4.1.1 - 06 Sep 2017

Bug Fixes

  • Use lodash has to check config keys presence (#265) (c0287e6), closes #263

v4.1.0 - 04 Sep 2017

Features

v4.0.4 - 24 Aug 2017

Bug Fixes

  • Disable concurrent sub task execution by default (#229) (48c8c6ff, closes #225)

v4.0.3 - 06 Aug 2017

Bug Fixes

v4.0.2 - 17 Jul 2017

Bug Fixes

v4.0.1 - 06 Jul 2017

Bug Fixes

v4.0.0 - 18 Jun 2017

Bug Fixes

Breaking Changes

This might affect existing setups which depend on the -- argument. (ad265664)

v3.6.1 - 10 Jun 2017

Bug Fixes

v3.6.0 - 01 Jun 2017

Features

  • Add advanced option globOptions to customise minimatch (#179) (c5b9804b, closes #173)

v3.5.1 - 29 May 2017

Bug Fixes

  • gitDir: Fix for checking if task contains git.exe on Windows (#178) (4c600178)

v3.5.0 - 25 May 2017

Features

v3.4.2 - 17 May 2017

Bug Fixes

v3.4.1 - 28 Apr 2017

Bug Fixes

v3.4.0 - 13 Mar 2017

Features

  • Display a message if there are no files that match a pattern. (#139) (b0204ee4, closes #135)

v3.3.2 - 13 Mar 2017

Bug Fixes

  • Remove unnecessary which dependency and code block in findBin.js (3acd6c7b)

v3.3.1 - 19 Feb 2017

Bug Fixes

  • concurrent: Wait for all tasks to finish before showing errors (5a44bea4, closes #86)
  • package: update listr to version 0.11.0 (3c75c16b)

v3.3.0 - 30 Jan 2017

Bug Fixes

  • gitDir: Run npm run scripts in the current working directory instead of git directory. (9c45d8ee, closes #122)

Features

  • verbose: Add verbose option (9dae19f9)

v3.2.9 - 30 Jan 2017

Bug Fixes

  • concurrent: Fix concurrent: false could not be set using config (22a1d774)

v3.2.8 - 24 Jan 2017

Bug Fixes

  • windows: Do not reuse execa options object for runners since it breaks on Windows (#124) (be8aa3f0, closes #114)

v3.2.7 - 18 Jan 2017

Bug Fixes

v3.2.6 - 09 Jan 2017

Bug Fixes

v3.2.5 - 30 Dec 2016

Bug Fixes

  • resolvePaths: Use cwd-relative paths instead of absolute paths (#116) (968e0d8f, closes #115, #115)

v3.2.4 - 19 Dec 2016

Bug Fixes

  • When rejecting, use new Error and error.message respectively. (#113) (97ad4b46, closes #112)

v3.2.3 - 14 Dec 2016

Bug Fixes

  • Run commands in the context of gitDir if it is set (#110) (a74135d6, closes #109)

v3.2.2 - 07 Dec 2016

  • [fix]: Force colors only when running in TTY (#108)
  • [docs]: Added npm version badge

v3.2.1 - 04 Nov 2016

  • [fix]: Added { dot: true } to allow more complex globs with dots in path (#93)
  • [docs] Simpler pattern for matching js/jsx in the README.
  • [docs] Be more specific about where to put pre-commit in the installation instructions. (#87)
  • [chore]: Added commitizen conventional changelog (#92)
  • [chore] update eslint to version 3.9.1 (#88)
  • [chore]: update listr to version 0.7.0 (#85)
  • [chore]: Removed unused dev dependencies.

v3.2.0 - 18 Oct 2016

  • [feature] Support rc files extensions (.json, .yml etc) as they aren't supported by default

v3.1.1 - 17 Oct 2016

  • [fix] Properly resolve paths when the git directory differs from the current working directory. #78
  • [fix] Fixed TypeError: Path must be a string. Received undefined when gitDir isn't defined in the config.

v3.1.0 - 13 Oct 2016

v3.0.3 - 22 Sep 2016

v3.0.2 - 12 Sep 2016

  • Removed unused dependecies

v3.0.1 - 08 Sep 2016

  • Switched to listr. Simplified code and more beautiful output.
  • Switched to execa. Should fix #30
  • Use ES2015. Dropped support for Node < 4.x
  • Support commands with arguments in the lint-staged config. Closes #47
  • Support binaries from $PATH. Closes #47
  • Removed --color option from runner. You should pass arguments yourself.

v2.0.3 - 02 Aug 2016

  • Use cross-spawn to fix issues with Windows. Closes #30. (#34)
  • Updated dependencies

v2.0.2 - 11 Jul 2016

  • Fixes an error when running a config with just one task (#28). #27 @Anber.
  • Beautiful string representation for multiple linters in case of error.
  • Added tests to getLintersAsString.

v2.0.1 - 08 Jul 2016

  • When on of the sequential tasks fails, exit the process. Closes #26

v2.0.0 - 08 Jul 2016

  • Support for sequences of commands. Needs config update! #25 @okonet
  • Allow adding files to the commit after running a task. #16 @okonet

v1.0.2 - 30 Jun 2016

  • Fixed path resolution to the app root on Windows. #19 by

v1.0.1 - 07 Jun 2016

  • Fixed support of local npm scripts from package.json

v1.0.0 - 07 Jun 2016

  • Complete re-write using Node.js API to fix #5, #6, #7, #8
  • Switched to staged-git-files that supports git filter. Exclude deleted files. Closes #12

v0.2.2 - 02 May 2016

  • Switch to bin/bash and fix file existncy check #9 @fubhy
  • Switch to $(npm bin) instead of hardcoding path #9 @fubhy
  • Updated flow installation instructions @okonet

v0.2.1 - 02 May 2016

v0.2.0 - 02 May 2016

  • Added more linters: flow, JSCS @okonet
  • Better console output when no binary is found @okonet
  • Better README @okonet

v0.1.1 - 02 May 2016

  • Initial release