Full Code of lint-staged/lint-staged for AI

main 593bcfe915f3 cached
164 files
518.5 KB
150.2k tokens
96 symbols
1 requests
Download .txt
Showing preview only (559K chars total). Download the full file or copy to clipboard to get everything.
Repository: lint-staged/lint-staged
Branch: main
Commit: 593bcfe915f3
Files: 164
Total size: 518.5 KB

Directory structure:
gitextract_965w5l_w/

├── .changeset/
│   ├── README.md
│   ├── chilly-symbols-rhyme.md
│   └── config.json
├── .editorconfig
├── .gitattributes
├── .github/
│   ├── FUNDING.yml
│   ├── issue_template.md
│   ├── pull_request_template.md
│   └── workflows/
│       ├── default-branch-push.yml
│       ├── npm.yml
│       ├── pull-requests.yml
│       ├── security.yml
│       └── tag.yml
├── .gitignore
├── .husky/
│   ├── commit-msg
│   ├── pre-commit
│   └── pre-push
├── .node-version
├── .prettierignore
├── .prettierrc.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── MIGRATION.md
├── README.md
├── bin/
│   └── lint-staged.js
├── commitlint.config.js
├── eslint.config.js
├── lib/
│   ├── chunkFiles.js
│   ├── colors.js
│   ├── configFiles.js
│   ├── debug.js
│   ├── execGit.js
│   ├── figures.js
│   ├── file.js
│   ├── generateTasks.js
│   ├── getAbortController.js
│   ├── getDiffCommand.js
│   ├── getFunctionTask.js
│   ├── getRenderer.js
│   ├── getSpawnedTask.js
│   ├── getSpawnedTasks.js
│   ├── getStagedFiles.js
│   ├── gitWorkflow.js
│   ├── groupFilesByConfig.js
│   ├── index.d.ts
│   ├── index.js
│   ├── killSubprocesses.js
│   ├── loadConfig.js
│   ├── matchFiles.js
│   ├── messages.js
│   ├── normalizePath.js
│   ├── parseGitZOutput.js
│   ├── printTaskOutput.js
│   ├── readStdin.js
│   ├── resolveConfig.js
│   ├── resolveGitRepo.js
│   ├── runAll.js
│   ├── searchConfigs.js
│   ├── state.js
│   ├── symbols.js
│   ├── validateBraces.js
│   ├── validateConfig.js
│   ├── validateOptions.js
│   └── version.js
├── lint-staged.config.js
├── package.json
├── scripts/
│   └── test-node-range.js
├── test/
│   ├── __utils__/
│   │   ├── createTempDir.js
│   │   └── getRepoRootPath.js
│   ├── e2e/
│   │   ├── __utils__/
│   │   │   └── forkLintStagedBin.js
│   │   ├── internal-errors.test.js
│   │   ├── kill-tasks-on-failure.test.js
│   │   ├── no-stash.test.js
│   │   ├── special-characters.test.js
│   │   └── stdin-config.test.js
│   ├── integration/
│   │   ├── __fixtures__/
│   │   │   ├── configs.js
│   │   │   └── files.js
│   │   ├── __utils__/
│   │   │   ├── addConfigFileSerializer.js
│   │   │   ├── isWindows.js
│   │   │   ├── normalizeWindowsNewlines.js
│   │   │   ├── replaceSerializer.js
│   │   │   └── withGitIntegration.js
│   │   ├── allow-empty.test.js
│   │   ├── basic-functionality.test.js
│   │   ├── binary-files.test.js
│   │   ├── continue-on-error.test.js
│   │   ├── diff-options.test.js
│   │   ├── fail-on-changes.test.js
│   │   ├── fail-to-spawn.test.js
│   │   ├── file-resurrection.test.js
│   │   ├── files-outside-cwd.test.js
│   │   ├── git-amend.test.js
│   │   ├── git-lock-file.test.js
│   │   ├── git-submodules.test.js
│   │   ├── git-worktree.test.js
│   │   ├── gitWorkFlow.test.js
│   │   ├── hide-unstaged.test.js
│   │   ├── merge-conflict.test.js
│   │   ├── multiple-config-files.test.js
│   │   ├── no-hide-partially-staged.test.js
│   │   ├── no-initial-commit.test.js
│   │   ├── no-revert.test.js
│   │   ├── no-stash.test.js
│   │   ├── non-ascii.test.js
│   │   ├── not-inside-git-repo.test.js
│   │   ├── parent-globs.test.js
│   │   ├── partially-staged-changes.test.js
│   │   ├── resolveGitRepo.spec.js
│   │   ├── symlink-git-dir.test.js
│   │   ├── symlinked-config.test.js
│   │   ├── symlinked-staged-files.test.js
│   │   └── untracked-files.test.js
│   ├── types/
│   │   └── index.test.ts
│   └── unit/
│       ├── __mocks__/
│       │   ├── advanced-cjs-config.cjs
│       │   ├── advanced-esm-config.js
│       │   ├── cjs/
│       │   │   └── my-config.cjs
│       │   ├── esm-config-in-js.js
│       │   ├── esm-config.mjs
│       │   ├── gitWorkflow.js
│       │   ├── invalid-json-config.json
│       │   ├── invalid-yml-config.yml
│       │   ├── my-config.json
│       │   ├── my-config.yml
│       │   └── my-lint-staged-config/
│       │       ├── index.cjs
│       │       └── package.json
│       ├── __utils__/
│       │   ├── getMockListr2.js
│       │   ├── getMockTinyexec.js
│       │   ├── mockNanoSpawnReturnValue.js
│       │   └── mockTinyexecReturnValue.js
│       ├── chunkFiles.spec.js
│       ├── colors.spec.js
│       ├── debug.spec.js
│       ├── execGit.spec.js
│       ├── file.spec.js
│       ├── generateTasks.spec.js
│       ├── getAbortController.spec.js
│       ├── getBackupStash.spec.js
│       ├── getDiffCommand.spec.js
│       ├── getFunctionTask.spec.js
│       ├── getRenderer.spec.js
│       ├── getSpawnedTask.spec.js
│       ├── getSpawnedTask.unmocked.spec.js
│       ├── getSpawnedTasks.spec.js
│       ├── getStagedFiles.spec.js
│       ├── index.spec.js
│       ├── index2.spec.js
│       ├── index3.spec.js
│       ├── killSubprocesses.spec.js
│       ├── loadConfig.spec.js
│       ├── matchFiles.spec.js
│       ├── normalizePath.spec.js
│       ├── parseGitZOutput.spec.js
│       ├── printTaskOutput.spec.js
│       ├── readStdin.spec.js
│       ├── resolveGitRepo.spec.js
│       ├── runAll.spec.js
│       ├── searchConfigs.spec.js
│       ├── state.spec.js
│       ├── validateBraces.spec.js
│       ├── validateConfig.spec.js
│       └── validateOptions.spec.js
├── tsconfig.json
└── vitest.config.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .changeset/README.md
================================================
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)


================================================
FILE: .changeset/chilly-symbols-rhyme.md
================================================
---
---


================================================
FILE: .changeset/config.json
================================================
{
  "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
  "changelog": ["@changesets/changelog-github", { "repo": "okonet/lint-staged" }],
  "access": "public",
  "baseBranch": "main"
}


================================================
FILE: .editorconfig
================================================
# https://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.json]
indent_size = 2


================================================
FILE: .gitattributes
================================================
* text=auto eol=lf


================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: lint-staged
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL


================================================
FILE: .github/issue_template.md
================================================
### Description

<!--
If this is a feature request, explain why it should be added. Specific
use-cases are best.

If this is a bug, please check that it can be reproduced in the latest version
of `lint-staged`. Furthermore, please provide as much *relevant* info as
possible. Including what is the expected and actual behavior.
-->

### Steps to reproduce

<!-- Tell us how to reproduce this issue. -->

### Debug Logs

<!--
Run `lint-staged` in debug mode using the command line flag `--debug`. You can
either modify your pre-commit script/command to include the flag or invoke
`lint-staged` manually(`npx lint-staged --debug`). Read more
about debug mode here: https://github.com/lint-staged/lint-staged#--debug.

Without debug logs, it's difficult to provide any help.
-->

<details>

<summary>expand to view</summary>

```
COPY THE DEBUG LOGS HERE
```

</details>

<!-- Check this box to certify that: -->

- [ ] I have read this issue template before submitting an issue. If left unchecked, the issue might be ignored or closed without consideration.


================================================
FILE: .github/pull_request_template.md
================================================
**Do not open Pull Requests unless they have been agreed to with the maintainer!**  
**Otherwise they might be ignored or closed without consideration. Please open a new issue first!**

- [ ] I have opened a GitHub issue beforehand and have agreed with the maintainer of this project
- [ ] I have written unit, integration and e2e tests that cover the logic in this Pull Request
- [ ] I have updated the [README.md](../README.md) file to reflect the changes in this Pull Request
- [ ] I have used the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification in my commit messages
- [ ] I have created a [Changeset](https://github.com/changesets/changesets) file for generating a changelog entry


================================================
FILE: .github/workflows/default-branch-push.yml
================================================
name: Default Branch Push

on:
  push:
    branches:
      - main
    # Do not run on tags
    tags-ignore:
      - '*'

permissions:
  contents: write
  issues: read
  packages: write
  pull-requests: write
  id-token: write

jobs:
  npm:
    uses: ./.github/workflows/npm.yml

  Release:
    needs: npm
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          # This is a PAT token that allows triggering of new Actions when 🦋 Changeset pushes a git tag
          token: ${{ secrets.CHANGESET_RELEASE_TOKEN }}
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - name: Create Release Pull Request
        uses: changesets/action@v1
        with:
          title: '🦋 Changeset release'
          version: npm run version
          publish: npm run tag
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          HUSKY: '0' # disabled because pre-push hook checks for changesets which have now been removed


================================================
FILE: .github/workflows/npm.yml
================================================
name: Npm

on:
  workflow_call:

permissions:
  contents: read

jobs:
  Install:
    name: Install Dependencies
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          sparse-checkout: |
            .node-version
            package-lock.json
            package.json
          sparse-checkout-cone-mode: false
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          registry-url: https://registry.npmjs.org
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - if: steps.cache-node_modules.outputs.cache-hit != 'true'
        run: npm ci --ignore-scripts


================================================
FILE: .github/workflows/pull-requests.yml
================================================
name: Pull Requests

on:
  pull_request:
    branches:
      - main

permissions:
  contents: read

jobs:
  npm:
    uses: ./.github/workflows/npm.yml

  Changesets:
    needs: npm
    # Changesets no longer exist when releasing
    if: github.event_name == 'pull_request' && !startsWith(github.event.pull_request.title, '🦋 Changeset release')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - run: npx changeset status --since=${{ github.event.pull_request.base.sha }}

  Commitlint:
    needs: npm
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

  TypeScript:
    needs: npm
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - run: npm run typecheck

  ESLint:
    needs: npm
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - run: npm run lint

  test-node-range:
    name: Test Node.js version range
    needs: npm
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-ubuntu-latest-${{ hashFiles('package-lock.json') }}
      - run: node ./scripts/test-node-range.js

  test-matrix:
    strategy:
      matrix:
        # Test with Node.js active LTS versions, and the latest version
        node:
          - '20.17.0' # lowest supported version
          - '20.x'
          - '22.x'
          - '24.x'
        # Test with Ubuntu, macOS, and Windows
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest
    name: Node.js v${{ matrix.node }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    steps:
      - if: matrix.os == 'windows-latest'
        run: git config --global core.autocrlf true
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node }}
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-${{ matrix.os }}-${{ hashFiles('package-lock.json') }}
      - if: steps.cache-node_modules.outputs.cache-hit != 'true'
        run: npm ci --ignore-scripts
      # Print current Node.js version
      - run: node --version
      # Print current npm version
      - run: npm --version
      # Print current Git version
      - run: git --version
      # Print lint-staged version
      - run: node bin/lint-staged.js --version
      # Print lint-staged help text
      - run: node bin/lint-staged.js --help
      # Run tests
      - run: npm test

  test-msys2:
    strategy:
      matrix:
        node:
          - 20.17.0 # lowest supported version
          - 20
          - 22
          - 24
    name: Node.js ${{ matrix.node }} on windows-latest (MSYS2)
    runs-on: windows-latest
    defaults:
      run:
        shell: msys2 {0}
    steps:
      - uses: msys2/setup-msys2@v2
        with:
          msystem: UCRT64
          path-type: inherit
          install: >-
            git
      - run: git config --global core.autocrlf true
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node }}
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-windows-msys2-latest-${{ hashFiles('package-lock.json') }}
      - if: steps.cache-node_modules.outputs.cache-hit != 'true'
        run: npm ci --ignore-scripts
      - run: node --version
      - run: npm --version
      - run: git --version
      - run: node bin/lint-staged.js --version
      - run: node bin/lint-staged.js --help
      - run: npm test

  test-cygwin:
    strategy:
      matrix:
        node:
          - 20.17.0 # lowest supported version
          - 20
          - 22
          - 24
    name: Node.js ${{ matrix.node }} on windows-latest (Cygwin)
    runs-on: windows-latest
    steps:
      - uses: cygwin/cygwin-install-action@v6
      - run: git config --global core.autocrlf true
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node }}
          package-manager-cache: false
      - uses: actions/cache@v5
        id: cache-node_modules
        with:
          path: node_modules
          key: node-modules-windows-cygwin-latest-${{ hashFiles('package-lock.json') }}
      - if: steps.cache-node_modules.outputs.cache-hit != 'true'
        run: npm ci --ignore-scripts
      - run: node --version
      - run: npm --version
      - run: git --version
      - run: node bin/lint-staged.js --version
      - run: node bin/lint-staged.js --help
      - run: npm test


================================================
FILE: .github/workflows/security.yml
================================================
name: Security Analysis

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  schedule:
    - cron: '0 0 * * 1' # 00:00 on Monday.

permissions:
  contents: read
  security-events: write

jobs:
  CodeQL:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: github/codeql-action/init@v4
        with:
          languages: javascript
      - uses: github/codeql-action/analyze@v4

  npm:
    uses: ./.github/workflows/npm.yml

  npm-audit:
    runs-on: ubuntu-latest
    needs: npm
    steps:
      - uses: actions/checkout@v6
      - run: npm audit --include prod --audit-level high


================================================
FILE: .github/workflows/tag.yml
================================================
name: Publish

on:
  push:
    tags:
      # Semver-like tags "v1.0.0", or "v.0.0.1-beta.1"
      - 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
  contents: read
  id-token: write

jobs:
  Publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version-file: .node-version
          registry-url: https://registry.npmjs.org
          package-manager-cache: false
      - run: npm publish --provenance --access public


================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
.idea
.vscode
coverage/


================================================
FILE: .husky/commit-msg
================================================
commitlint --edit ${1}


================================================
FILE: .husky/pre-commit
================================================
node bin/lint-staged.js


================================================
FILE: .husky/pre-push
================================================
changeset status --since=main


================================================
FILE: .node-version
================================================
24


================================================
FILE: .prettierignore
================================================
test/unit/__mocks__


================================================
FILE: .prettierrc.json
================================================
{
  "printWidth": 100,
  "singleQuote": true,
  "semi": false,
  "trailingComma": "es5"
}


================================================
FILE: CHANGELOG.md
================================================
# lint-staged

## 16.4.0

### Minor Changes

- [#1739](https://github.com/lint-staged/lint-staged/pull/1739) [`687fc90`](https://github.com/lint-staged/lint-staged/commit/687fc9069a312ac83ca48f035a1bbf453db91814) Thanks [@hyperz111](https://github.com/hyperz111)! - Replace `micromatch` with `picomatch` to reduce dependencies.

## 16.3.4

### Patch Changes

- [#1742](https://github.com/lint-staged/lint-staged/pull/1742) [`9d6e827`](https://github.com/lint-staged/lint-staged/commit/9d6e827b0c55da5b091c989111f6c55dd76539d9) Thanks [@iiroj](https://github.com/iiroj)! - Update dependencies, including [`tinyexec@1.0.4`](https://github.com/tinylibs/tinyexec/releases/tag/1.0.4) to make sure local `node_modules/.bin` are preferred to global locations (released in [`tinyexec@1.0.3`](https://github.com/tinylibs/tinyexec/releases/tag/1.0.3)).

## 16.3.3

### Patch Changes

- [#1740](https://github.com/lint-staged/lint-staged/pull/1740) [`0109e8d`](https://github.com/lint-staged/lint-staged/commit/0109e8d1507409d950dab0d65ce27bd40b1137c7) Thanks [@iiroj](https://github.com/iiroj)! - Make sure Git's warning about CRLF line-endings doesn't interfere with creating initial backup stash.

## 16.3.2

### Patch Changes

- [#1735](https://github.com/lint-staged/lint-staged/pull/1735) [`2adaf6c`](https://github.com/lint-staged/lint-staged/commit/2adaf6c3a76152abddbf23b749dfa5d62982f3cf) Thanks [@iiroj](https://github.com/iiroj)! - Hide the extra `cmd` window on Windows by spawning tasks without the `detached` option.

## 16.3.1

### Patch Changes

- [#1729](https://github.com/lint-staged/lint-staged/pull/1729) [`cd5d762`](https://github.com/lint-staged/lint-staged/commit/cd5d762c288bcfe36274c32f018cea97dfe11280) Thanks [@iiroj](https://github.com/iiroj)! - Remove `nano-spawn` as a dependency from `package.json` as it was replaced with `tinyexec` and is no longer used.

## 16.3.0

### Minor Changes

- [#1698](https://github.com/lint-staged/lint-staged/pull/1698) [`feda37a`](https://github.com/lint-staged/lint-staged/commit/feda37aa590789e847f32a4aabc346af1d79c547) Thanks [@iiroj](https://github.com/iiroj)! - Run external processes with [`tinyexec`](https://github.com/tinylibs/tinyexec) instead of [`nano-spawn`](https://github.com/sindresorhus/nano-spawn). `nano-spawn` replaced [`execa`](https://github.com/sindresorhus/execa) in _lint-staged_ version 16 to limit the amount of npm dependencies required, but caused some unknown issues related to spawning tasks. Let's hope `tinyexec` improves the situation.

- [#1699](https://github.com/lint-staged/lint-staged/pull/1699) [`1346d16`](https://github.com/lint-staged/lint-staged/commit/1346d16387e188911ef64e8bad6b8a6252cb6d71) Thanks [@iiroj](https://github.com/iiroj)! - Remove `pidtree` as a dependency. When a task fails, its sub-processes are killed more efficiently via the process group on Unix systems, and the `taskkill` command on Windows.

### Patch Changes

- [#1726](https://github.com/lint-staged/lint-staged/pull/1726) [`87467aa`](https://github.com/lint-staged/lint-staged/commit/87467aaa76e1edc2547f3f3d462a4495afa5337d) Thanks [@iiroj](https://github.com/iiroj)! - Incorrect brace expansions like `*.{js}` (_nothing to expand_) are detected exhaustively, instead of just a single pass.

## 16.2.7

### Patch Changes

- [#1711](https://github.com/lint-staged/lint-staged/pull/1711) [`ef74c8d`](https://github.com/lint-staged/lint-staged/commit/ef74c8d165d5acd3ce88567e02b891e0e9af8e0e) Thanks [@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.

## 16.2.6

### Patch Changes

- [#1693](https://github.com/lint-staged/lint-staged/pull/1693) [`33d4502`](https://github.com/lint-staged/lint-staged/commit/33d4502ef9c939a9c6f41fc630a34e0985220f8e) Thanks [@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.

## 16.2.5

### Patch Changes

- [#1687](https://github.com/lint-staged/lint-staged/pull/1687) [`9e02d9d`](https://github.com/lint-staged/lint-staged/commit/9e02d9dc8a84bfeb7995520f00f7080b07a2e839) Thanks [@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.

## 16.2.4

### Patch Changes

- [#1682](https://github.com/lint-staged/lint-staged/pull/1682) [`0176038`](https://github.com/lint-staged/lint-staged/commit/01760380e57080d136cc396455346c36aef5770e) Thanks [@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.

- [#1671](https://github.com/lint-staged/lint-staged/pull/1671) [`581a54e`](https://github.com/lint-staged/lint-staged/commit/581a54eea6ba3a3a1b715407c895f63a961903f3) Thanks [@iiroj](https://github.com/iiroj)! - Speed up execution by only importing the `yaml` depedency if using YAML configuration files.

## 16.2.3

### Patch Changes

- [#1669](https://github.com/lint-staged/lint-staged/pull/1669) [`27cd541`](https://github.com/lint-staged/lint-staged/commit/27cd5413d973baea6b4f3da704fb3bee8298e751) Thanks [@iiroj](https://github.com/iiroj)! - When using `--fail-on-changes`, automatically hidden (partially) unstaged changes are no longer counted to make _lint-staged_ fail.

## 16.2.2

### Patch Changes

- [#1667](https://github.com/lint-staged/lint-staged/pull/1667) [`699f95d`](https://github.com/lint-staged/lint-staged/commit/699f95df8f89ac7f7d360bbf93740d19d5899ac5) Thanks [@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
  ```

## 16.2.1

### Patch Changes

- [#1664](https://github.com/lint-staged/lint-staged/pull/1664) [`8277b3b`](https://github.com/lint-staged/lint-staged/commit/8277b3b298421ebbb39c43d7e3538481e15c4659) Thanks [@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 [@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)
  }
  ```

- [#1654](https://github.com/lint-staged/lint-staged/pull/1654) [`70b9af3`](https://github.com/lint-staged/lint-staged/commit/70b9af3ac3fd66af94936e55bb3e91381937b41f) Thanks [@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).

- [#1659](https://github.com/lint-staged/lint-staged/pull/1659) [`4996817`](https://github.com/lint-staged/lint-staged/commit/49968170abb3bab7ac8dc0a6bc5ea92850337baa) Thanks [@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.

- [#1654](https://github.com/lint-staged/lint-staged/pull/1654) [`7021f0a`](https://github.com/lint-staged/lint-staged/commit/7021f0af40ac1d5787501894c0f2222980023703) Thanks [@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.

## 16.2.0

### Minor Changes

- [#1615](https://github.com/lint-staged/lint-staged/pull/1615) [`99eb742`](https://github.com/lint-staged/lint-staged/commit/99eb74200e8db69e72dba45314025953b8b0794e) Thanks [@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.

- [#1611](https://github.com/lint-staged/lint-staged/pull/1611) [`cd05fd3`](https://github.com/lint-staged/lint-staged/commit/cd05fd349594baf586fbafb05588ff07d86060b7) Thanks [@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.

- [#1637](https://github.com/lint-staged/lint-staged/pull/1637) [`82fcc07`](https://github.com/lint-staged/lint-staged/commit/82fcc0789c17bf6b2ea2649147abec77fa619375) Thanks [@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.

- [#1647](https://github.com/lint-staged/lint-staged/pull/1647) [`a5ecc06`](https://github.com/lint-staged/lint-staged/commit/a5ecc0605d52756167417c84cb0007ea7bceaaa3) Thanks [@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

- [#1636](https://github.com/lint-staged/lint-staged/pull/1636) [`8db2717`](https://github.com/lint-staged/lint-staged/commit/8db2717574ebfa2b80e0fc4eb0b24d705fd264fc) Thanks [@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 [@ItsNickBarry](https://github.com/ItsNickBarry) for the idea and initial implementation in [#1552](https://github.com/lint-staged/lint-staged/pull/1552).

- [#1648](https://github.com/lint-staged/lint-staged/pull/1648) [`7900b3b`](https://github.com/lint-staged/lint-staged/commit/7900b3b79c5e2e69662cb8b1bcbcae79c3549421) Thanks [@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

- [#1633](https://github.com/lint-staged/lint-staged/pull/1633) [`7f9e485`](https://github.com/lint-staged/lint-staged/commit/7f9e485a981707897e0d417f6a62008f0c098e00) Thanks [@dependabot](https://github.com/apps/dependabot)! - Bumps [listr2](https://github.com/listr2/listr2) from 9.0.3 to 9.0.4.

- [#1626](https://github.com/lint-staged/lint-staged/pull/1626) [`99d5a9b`](https://github.com/lint-staged/lint-staged/commit/99d5a9b0ddcba7d471d39ff3969d37988f1e2705) Thanks [@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).

- [#1588](https://github.com/lint-staged/lint-staged/pull/1588) [`035bbf2`](https://github.com/lint-staged/lint-staged/commit/035bbf268ac47bbaf2cfa737c3b2240d38feb22e) Thanks [@outslept](https://github.com/outslept)! - Increase performance by listing staged files and searching for configuration concurrently.

- [#1645](https://github.com/lint-staged/lint-staged/pull/1645) [`deba3ad`](https://github.com/lint-staged/lint-staged/commit/deba3ad83581938dd71b86b563e62827b5fc2a0a) Thanks [@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.

## 16.1.6

### Patch Changes

- [#1610](https://github.com/lint-staged/lint-staged/pull/1610) [`e93578e`](https://github.com/lint-staged/lint-staged/commit/e93578e265a69ed6b02fcaa11486078c1bdbdaaa) Thanks [@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.

## 16.1.5

### Patch Changes

- [#1608](https://github.com/lint-staged/lint-staged/pull/1608) [`4e3ce22`](https://github.com/lint-staged/lint-staged/commit/4e3ce225b33f759f78a84d156189dc38e536cdc6) Thanks [@srsatt](https://github.com/srsatt)! - Detect the git repo's top-level directory correctly when in a worktree.

## 16.1.4

### Patch Changes

- [#1604](https://github.com/lint-staged/lint-staged/pull/1604) [`90b37b0`](https://github.com/lint-staged/lint-staged/commit/90b37b00c2c30b9cacf6c080f6a0885e1151eb7a) Thanks [@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.

## 16.1.3

### Patch Changes

- [#1602](https://github.com/lint-staged/lint-staged/pull/1602) [`7ea700b`](https://github.com/lint-staged/lint-staged/commit/7ea700bcf3d0078a01720a9c8dc13a271387afbd) Thanks [@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.

## 16.1.2

### Patch Changes

- [#1570](https://github.com/lint-staged/lint-staged/pull/1570) [`a7c0c88`](https://github.com/lint-staged/lint-staged/commit/a7c0c88bcfe94e695528cb33e69fea58586691fc) Thanks [@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 [@iiroj](https://github.com/iiroj)! - Removed an extraneous log entry that printed `shouldHidePArtiallyStagedFiles` to console output.

## 16.1.1

### Patch Changes

- [#1565](https://github.com/lint-staged/lint-staged/pull/1565) [`3686977`](https://github.com/lint-staged/lint-staged/commit/3686977ccdadf70b709c16c0346ef6c2b18e2376) Thanks [@iiroj](https://github.com/iiroj)! - _Lint-staged_ now explicitly warns about potential data loss when using `--no-stash`.

- [#1571](https://github.com/lint-staged/lint-staged/pull/1571) [`02299a9`](https://github.com/lint-staged/lint-staged/commit/02299a9e4f98a05c13beb27f3596af73aaa8c150) Thanks [@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.

- [#1563](https://github.com/lint-staged/lint-staged/pull/1563) [`bc61c74`](https://github.com/lint-staged/lint-staged/commit/bc61c74383b6d100c55b8d275b979d583ffbe5a1) Thanks [@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.

## 16.1.0

### Minor Changes

- [#1536](https://github.com/lint-staged/lint-staged/pull/1536) [`e729daa`](https://github.com/lint-staged/lint-staged/commit/e729daa3b3ae28e613f63e730652dbfad5d1c594) Thanks [@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.

- [#1550](https://github.com/lint-staged/lint-staged/pull/1550) [`b27fa3f`](https://github.com/lint-staged/lint-staged/commit/b27fa3fecb75bcdcaa4bcd483c9d5c0755a22607) Thanks [@iiroj](https://github.com/iiroj)! - _Lint-staged_ now ignores symlinks and leaves them out from the list of staged files.

### Patch Changes

- [#1558](https://github.com/lint-staged/lint-staged/pull/1558) [`c37dc38`](https://github.com/lint-staged/lint-staged/commit/c37dc38dddbdebc41df4dbd909d79c98c3f69eb3) Thanks [@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).

## 16.0.0

### Major Changes

- [#1546](https://github.com/lint-staged/lint-staged/pull/1546) [`158d15c`](https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba) Thanks [@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"
  }
  ```

- [#1546](https://github.com/lint-staged/lint-staged/pull/1546) [`158d15c`](https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba) Thanks [@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 `"$@"`:

  ```shell
  # my-script.sh
  #!/bin/bash

  echo "Staged files: $@"
  ```

  and

  ```json
  { "*.js": "my-script.sh" }
  ```

  If you were using the shell option to avoid passing filenames to tasks, for example `bash -c 'tsc --noEmit'`, use the function syntax instead:

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

- [#1546](https://github.com/lint-staged/lint-staged/pull/1546) [`158d15c`](https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1546) [`158d15c`](https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba) Thanks [@iiroj](https://github.com/iiroj)! - The lowest supported Node.js version is `20.18`. Please upgrade your Node.js version.

### Minor Changes

- [#1401](https://github.com/lint-staged/lint-staged/pull/1401) [`27110ef`](https://github.com/lint-staged/lint-staged/commit/27110ef8ee92c5d104235b4094abb3197b5bf074) Thanks [@RohitLuthra19](https://github.com/RohitLuthra19)! - Added support for directly running functions on staged files. To configure a function task, use an object with a title and the task itself:

  ```js
  export default {
    '*.js': {
      title: 'My task',
      task: async (files) => {
        console.log('Staged JS files:', files)
      },
    },
  }
  ```

  _Lint-staged_ will run your function task with the staged files matching the configured glob as its argument, and show the custom title in its console output.

## 15.5.2

### Patch Changes

- [#1544](https://github.com/lint-staged/lint-staged/pull/1544) [`5561321`](https://github.com/lint-staged/lint-staged/commit/556132176afce1701b4766c00ffd23159d437cb4) Thanks [@YimingIsCOLD](https://github.com/YimingIsCOLD)! - Correctly handle colon (`:`) characters in staged filenames.

## 15.5.1

### Patch Changes

- [#1533](https://github.com/lint-staged/lint-staged/pull/1533) [`5d53534`](https://github.com/lint-staged/lint-staged/commit/5d535349958a939cd17d87180196bb2b9dfc452b) Thanks [@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!
  ```

## 15.5.0

### Minor Changes

- [#1526](https://github.com/lint-staged/lint-staged/pull/1526) [`630af5f`](https://github.com/lint-staged/lint-staged/commit/630af5fb48ed43eb6ccaefa7a9d9612309023b6f) Thanks [@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 `'`
  1. Run `git commit -am "I don't like double quotes"`
  1. _Lint-staged_ runs `prettier --write file.js`, converting all the `'` back to `"`
  1. Because there are now no changes, _lint-staged_ fails, cancels the commit, and resets back to the original state
  1. Commit was not done, original state is restored and single quotes `'` are staged

  #### Now
  1. Stage `file.js` with only double-quotes `"` changed to `'`
  1. Run `git commit -am "I don't like double quotes"`
  1. _Lint-staged_ runs `prettier --write file.js`, converting all the `'` back to `"`
  1. Because there are now no changes, _lint-staged_ fails and cancels the commit
  1. Commit was not done, and there are no staged changes

## 15.4.3

### Patch Changes

- [#1512](https://github.com/lint-staged/lint-staged/pull/1512) [`cbfed1d`](https://github.com/lint-staged/lint-staged/commit/cbfed1dfd2465c4198c692955281f0836600bea1) Thanks [@tarik02](https://github.com/tarik02)! - Adjust TypeScript types for the default export so that it can be used as a value without error TS2693.

## 15.4.2

### Patch Changes

- [#1509](https://github.com/lint-staged/lint-staged/pull/1509) [`8827ebf`](https://github.com/lint-staged/lint-staged/commit/8827ebf29dc8f25149a36450b4a0023425202e18) Thanks [@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.

## 15.4.1

### Patch Changes

- [#1504](https://github.com/lint-staged/lint-staged/pull/1504) [`1c7a45e`](https://github.com/lint-staged/lint-staged/commit/1c7a45ed2c7fee9d5f55337be16a51e4c9b240e1) Thanks [@iiroj](https://github.com/iiroj)! - Default TypeScript config filenames match JS equivalents.

- [#1504](https://github.com/lint-staged/lint-staged/pull/1504) [`9cc18c9`](https://github.com/lint-staged/lint-staged/commit/9cc18c9debb185490f9ae4f9c1d21ec8c2587393) Thanks [@iiroj](https://github.com/iiroj)! - Add missing conditional exports syntax for TypeScript types.

## 15.4.0

### Minor Changes

- [#1500](https://github.com/lint-staged/lint-staged/pull/1500) [`a8ec1dd`](https://github.com/lint-staged/lint-staged/commit/a8ec1ddb587d2c1c2420dbb4baff8160f0ac46c9) Thanks [@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
  /**
   * @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](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

- [#1501](https://github.com/lint-staged/lint-staged/pull/1501) [`9b79364`](https://github.com/lint-staged/lint-staged/commit/9b793640e1f87b46e4f40fcfc1ecf9d6f6013ac9) Thanks [@iiroj](https://github.com/iiroj)! - Handle possible failures when logging user shell for debug info.

## 15.3.0

### Minor Changes

- [#1495](https://github.com/lint-staged/lint-staged/pull/1495) [`e69da9e`](https://github.com/lint-staged/lint-staged/commit/e69da9e614db2d45f56e113d45d5ec0157813423) Thanks [@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.

- [#1493](https://github.com/lint-staged/lint-staged/pull/1493) [`fa0fe98`](https://github.com/lint-staged/lint-staged/commit/fa0fe98104f8885f673b98b8b49ae586de699c5e) Thanks [@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)
  ```

## 15.2.11

### Patch Changes

- [#1484](https://github.com/lint-staged/lint-staged/pull/1484) [`bcfe309`](https://github.com/lint-staged/lint-staged/commit/bcfe309fca88aedf42b6a321383de49eb361c5a0) Thanks [@wormsik](https://github.com/wormsik)! - Escape paths containing spaces when using the "shell" option.

- [#1487](https://github.com/lint-staged/lint-staged/pull/1487) [`7dd8caa`](https://github.com/lint-staged/lint-staged/commit/7dd8caa8f80fe1a6ce40939c1224b6774000775a) Thanks [@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.

## 15.2.10

### Patch Changes

- [#1471](https://github.com/lint-staged/lint-staged/pull/1471) [`e3f283b`](https://github.com/lint-staged/lint-staged/commit/e3f283b250868b7c15ceb54d2a51b2e5fb3a18a9) Thanks [@iiroj](https://github.com/iiroj)! - Update minor dependencies, including `micromatch@~4.0.8`.

## 15.2.9

### Patch Changes

- [#1463](https://github.com/lint-staged/lint-staged/pull/1463) [`b69ce2d`](https://github.com/lint-staged/lint-staged/commit/b69ce2ddfd5a7ae576f4fef4afc60b8a81f3c945) Thanks [@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`.

## 15.2.8

### Patch Changes

- [`f0480f0`](https://github.com/lint-staged/lint-staged/commit/f0480f01b24b9f6443a12515d413a7ba4dda3981) Thanks [@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.

## 15.2.7

### Patch Changes

- [#1440](https://github.com/lint-staged/lint-staged/pull/1440) [`a51be80`](https://github.com/lint-staged/lint-staged/commit/a51be804b63307ac7af3c82f4cb2d43dbe92daac) Thanks [@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 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](https://github.com/lint-staged/lint-staged/pull/1433) [`119adb2`](https://github.com/lint-staged/lint-staged/commit/119adb29854cabddbfcf0469d7c8a0126184a5d4) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1424) [`31a1f95`](https://github.com/lint-staged/lint-staged/commit/31a1f9548ea8202bc5bd718076711f747396e3ca) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1423) [`91abea0`](https://github.com/lint-staged/lint-staged/commit/91abea0d298154d92113ba34bae4020704e22918) Thanks [@iiroj](https://github.com/iiroj)! - Improve error logging when failing to read or parse a configuration file

- [#1424](https://github.com/lint-staged/lint-staged/pull/1424) [`ee43f15`](https://github.com/lint-staged/lint-staged/commit/ee43f154097753dd5448766f792387e60e0ea453) Thanks [@iiroj](https://github.com/iiroj)! - Upgrade micromatch@4.0.7

## 15.2.4

### Patch Changes

- [`4f4537a`](https://github.com/lint-staged/lint-staged/commit/4f4537a75ebfba816826f6f67a325dbc7f25908a) Thanks [@iiroj](https://github.com/iiroj)! - Fix release issue with previous version; update dependencies

## 15.2.3

### Patch Changes

- [#1407](https://github.com/lint-staged/lint-staged/pull/1407) [`d698162`](https://github.com/lint-staged/lint-staged/commit/d6981627472315adb01a46f797c8581393e8a637) Thanks [@iiroj](https://github.com/iiroj)! - Update dependencies

## 15.2.2

### Patch Changes

- [#1391](https://github.com/lint-staged/lint-staged/pull/1391) [`fdcdad4`](https://github.com/lint-staged/lint-staged/commit/fdcdad42ff96fea3c05598e378d3c44ad4a51bde) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1387) [`e4023f6`](https://github.com/lint-staged/lint-staged/commit/e4023f687616dcf4816545b8eefbcce50e255c9c) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1371) [`f3378be`](https://github.com/lint-staged/lint-staged/commit/f3378be894fb84800341800b1e4f6f8bc8dfd904) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1362) [`17bc480`](https://github.com/lint-staged/lint-staged/commit/17bc480c0f8767407a87527931558de8d1d1551d) Thanks [@antonk52](https://github.com/antonk52)! - update lilconfig@3.0.0

- [#1368](https://github.com/lint-staged/lint-staged/pull/1368) [`7c55ca9`](https://github.com/lint-staged/lint-staged/commit/7c55ca9f410043016e8b33b3b523b9b7e764acf4) Thanks [@iiroj](https://github.com/iiroj)! - Update most dependencies

- [#1368](https://github.com/lint-staged/lint-staged/pull/1368) [`777d4e9`](https://github.com/lint-staged/lint-staged/commit/777d4e976852af4c181ffbe055f3531343349695) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1373) [`85eb0dd`](https://github.com/lint-staged/lint-staged/commit/85eb0ddab1eba0c0bcc8cc109e17dc2bbb3d044e) Thanks [@iiroj](https://github.com/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](https://github.com/lint-staged/lint-staged/pull/1344) [`0423311`](https://github.com/lint-staged/lint-staged/commit/04233115a5e25d6fa7d357cbe9d42173ae8a1acf) Thanks [@danielbayley](https://github.com/danielbayley)! - Add support for loading configuration from `package.yaml` and `package.yml` files, supported by `pnpm`.

### Patch Changes

- [#1355](https://github.com/lint-staged/lint-staged/pull/1355) [`105d901`](https://github.com/lint-staged/lint-staged/commit/105d9012fc92fca549987816406450075cf255f3) Thanks [@iiroj](https://github.com/iiroj)! - Suppress some warnings when using the "--quiet" flag

## 15.0.2

### Patch Changes

- [#1339](https://github.com/lint-staged/lint-staged/pull/1339) [`8e82364`](https://github.com/lint-staged/lint-staged/commit/8e82364dd89155e96de574cfb38a94d28b8635af) Thanks [@iiroj](https://github.com/iiroj)! - Update dependencies, including listr2@7.0.2 to fix an upstream issue affecting lint-staged.

## 15.0.1

### Patch Changes

- [#1217](https://github.com/lint-staged/lint-staged/pull/1217) [`d2e6f8b`](https://github.com/lint-staged/lint-staged/commit/d2e6f8b1e1cd84ba6eb2f3f6a7f650c882987041) Thanks [@louneskmt](https://github.com/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](https://github.com/okonet/lint-staged/pull/1322) [`66b93aa`](https://github.com/okonet/lint-staged/commit/66b93aac870d155ca81302b2574617da99409ca7) Thanks [@iiroj](https://github.com/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](https://github.com/okonet/lint-staged/releases/tag/v14.0.1) - 21 Aug 2023

### Bug Fixes

- fix reading config from stdin, introduced in v14.0.0 ([#1317](https://github.com/okonet/lint-staged/issues/1317)) ([fc3bfea](https://github.com/okonet/lint-staged/commit/fc3bfeabae29b65f99b6911a989b0b41d3d1128e))

## [v14.0.0](https://github.com/okonet/lint-staged/releases/tag/v14.0.0) - 13 Aug 2023

### Features

- drop support for Node.js 14 ([#1312](https://github.com/okonet/lint-staged/issues/1312)) ([9da8777](https://github.com/okonet/lint-staged/commit/9da877711a7547b9122c6af91683fb2a2f398184))

### BREAKING CHANGES

- Please upgrade your Node.js version to at least `16.14.0`.

## [v13.3.0](https://github.com/okonet/lint-staged/releases/tag/v13.3.0) - 13 Aug 2023

### Bug Fixes

- **dependencies:** update most dependencies ([7443870](https://github.com/okonet/lint-staged/commit/7443870b2c24ead8613295cbfa1fe80f96167e1c))
- detect duplicate redundant braces in pattern ([d895aa8](https://github.com/okonet/lint-staged/commit/d895aa8382b769f841c6bdc52ba59755bb0ed28b))

### Features

- **dependencies:** update `listr2@6.6.0` ([09844ca](https://github.com/okonet/lint-staged/commit/09844ca3f6b99feba8f3c0ea10e60a6e6df511ad))

## [v13.2.3](https://github.com/okonet/lint-staged/releases/tag/v13.2.3) - 28 Jun 2023

### Bug Fixes

- the `--diff` option implies `--no-stash` ([66a716d](https://github.com/okonet/lint-staged/commit/66a716d5a32c49f03b9a34350fec1b2411bada17))

## [v13.2.2](https://github.com/okonet/lint-staged/releases/tag/v13.2.2) - 26 Apr 2023

### Bug Fixes

- **dependencies:** update `yaml@2.2.2` (GHSA-f9xv-q969-pqx4) ([#1290](https://github.com/okonet/lint-staged/issues/1290)) ([cf691aa](https://github.com/okonet/lint-staged/commit/cf691aa188719d9479ceaeffbffe814594fdb65f))

## [v13.2.1](https://github.com/okonet/lint-staged/releases/tag/v13.2.1) - 07 Apr 2023

### Bug Fixes

- ignore "package.json" as config file when it's invalid JSON ([#1281](https://github.com/okonet/lint-staged/issues/1281)) ([e7ed6f7](https://github.com/okonet/lint-staged/commit/e7ed6f741d2ea0f084b06f3e1ac3d1d57fadf737))

## [v13.2.0](https://github.com/okonet/lint-staged/releases/tag/v13.2.0) - 10 Mar 2023

### Bug Fixes

- **dependencies:** replace `colorette` with `chalk` for better color support detection ([f598725](https://github.com/okonet/lint-staged/commit/f5987252ae59537727a93373b59ab47bc2651a2f))
- use index-based stash references for improved MSYS2 compatibility ([#1270](https://github.com/okonet/lint-staged/issues/1270)) ([60fcd99](https://github.com/okonet/lint-staged/commit/60fcd99451b88336a05ebbe71cda8909d2733ad7))

### Features

- version bump only ([#1275](https://github.com/okonet/lint-staged/issues/1275)) ([05fb382](https://github.com/okonet/lint-staged/commit/05fb3829faa5437276d98450c34699fecfc8c1c8))

## [v13.1.2](https://github.com/okonet/lint-staged/releases/tag/v13.1.2) - 13 Feb 2023

### Bug Fixes

- disable stash by default when using diff option ([#1259](https://github.com/okonet/lint-staged/issues/1259)) ([142c6f2](https://github.com/okonet/lint-staged/commit/142c6f225087207ec4c63b7847795857d567ce40))

## [v13.1.1](https://github.com/okonet/lint-staged/releases/tag/v13.1.1) - 07 Feb 2023

### Bug Fixes

- allow re-enabling `--stash` when using the `--diff` option ([99390c3](https://github.com/okonet/lint-staged/commit/99390c31a856154e380f04d5c3603d2e6428f1e5))

## [v13.1.0](https://github.com/okonet/lint-staged/releases/tag/v13.1.0) - 04 Dec 2022

### Features

- expose cli entrance from "lint-staged/bin" ([#1237](https://github.com/okonet/lint-staged/issues/1237)) ([eabf1d2](https://github.com/okonet/lint-staged/commit/eabf1d217d8bd2559b1087c92b5ec9b15b8ffa7e))

## [v13.0.4](https://github.com/okonet/lint-staged/releases/tag/v13.0.4) - 25 Nov 2022

### Bug Fixes

- **deps:** update all dependencies ([336f3b5](https://github.com/okonet/lint-staged/commit/336f3b513a8b36579165b2e6fb6e7059b988fe84))
- **deps:** update all dependencies ([ec995e5](https://github.com/okonet/lint-staged/commit/ec995e53fb173f2863cb3cc08a92ffa9252dc25d))

## [v13.0.3](https://github.com/okonet/lint-staged/releases/tag/v13.0.3) - 24 Jun 2022

### Bug Fixes

- correctly handle git stash when using MSYS2 ([#1178](https://github.com/okonet/lint-staged/issues/1178)) ([0d627a5](https://github.com/okonet/lint-staged/commit/0d627a52846d63cd6fc6018a8d7779ef454a99b2))

## [v13.0.2](https://github.com/okonet/lint-staged/releases/tag/v13.0.2) - 16 Jun 2022

### Bug Fixes

- use new `--diff` and `--diff-filter` options when checking task modifications ([1a5a66a](https://github.com/okonet/lint-staged/commit/1a5a66a9574e2a8b857bd62545a6f2a6da5811aa))

## [v13.0.1](https://github.com/okonet/lint-staged/releases/tag/v13.0.1) - 08 Jun 2022

### Bug Fixes

- correct spelling of "0 files" ([f27f1d4](https://github.com/okonet/lint-staged/commit/f27f1d45ea20904e81dda155a802b2eb07d50942))
- suppress error from `process.kill` when killing tasks on failure ([f2c6bdd](https://github.com/okonet/lint-staged/commit/f2c6bdd9114a8d5ba8473cc647ef55a6ee5664e1))
- **deps:** update pidtree@^0.6.0 to fix screen size error in WSL ([1a77e42](https://github.com/okonet/lint-staged/commit/1a77e4224a273bbc192b654d0a0120187e850a61))
- ignore "No matching pid found" error ([cb8a432](https://github.com/okonet/lint-staged/commit/cb8a4328eddbc99a0806276f68b55f6c5ecb3d8a))
- prevent possible race condition when killing tasks on failure ([bc92aff](https://github.com/okonet/lint-staged/commit/bc92aff5fdb6293045c556326df3c0529e59b7e3))

### Performance Improvements

- use `EventsEmitter` instead of `setInterval` for killing tasks on failure ([c508b46](https://github.com/okonet/lint-staged/commit/c508b46a153970114495d3f7fef05d45df0f2e10))

## [v13.0.0](https://github.com/okonet/lint-staged/releases/tag/v13.0.0) - 01 Jun 2022

### Bug Fixes

- **deps:** update `execa@^6.1.0` ([659c85c](https://github.com/okonet/lint-staged/commit/659c85c5cd4c4040a505bbe9fddbe7d416ac15c8))
- **deps:** update `yaml@^2.1.1` ([2750a3d](https://github.com/okonet/lint-staged/commit/2750a3d9d909fd834b95da752f0f6800340922b7))

### Features

- remove support for Node.js 12 ([5fb6df9](https://github.com/okonet/lint-staged/commit/5fb6df94ccd6de6f5fdd743474c094ff366cc671))

### BREAKING CHANGES

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

## [v12.5.0](https://github.com/okonet/lint-staged/releases/tag/v12.5.0) - 31 May 2022

### Bug Fixes

- include all files when using `--config <path>` ([641d1c2](https://github.com/okonet/lint-staged/commit/641d1c2fd00992e926ae07defbb98c4d324f3b13))
- skip backup stash when using the `--diff` option ([d4da24d](https://github.com/okonet/lint-staged/commit/d4da24d90cfa85ef8589a5f8c6ba5f51c3b45275))

### Features

- add `--diff-filter` option for overriding list of (staged) files ([753ef72](https://github.com/okonet/lint-staged/commit/753ef7281562e0a25a9fe01400d7108143116b39))
- add `--diff` option for overriding list of (staged) files ([35fcce9](https://github.com/okonet/lint-staged/commit/35fcce9040c8de2926a9113d09f13517e6b23a2e))

## [v12.4.3](https://github.com/okonet/lint-staged/releases/tag/v12.4.3) - 30 May 2022

### Bug Fixes

- **deps:** downgrade yaml@1.10.2 to support Node.js 12 ([383a96e](https://github.com/okonet/lint-staged/commit/383a96e17a21d10278e91ecdb8d80385886ce82f))
- **deps:** update commander@^9.2.0 ([22ebf52](https://github.com/okonet/lint-staged/commit/22ebf524e20b2bf239e22fab83df3edc76327394))
- **deps:** update yaml@^2.0.1 ([ec73af0](https://github.com/okonet/lint-staged/commit/ec73af0ddb3541f5a12e0c83b6112ab747d05d73))

## [v12.4.2](https://github.com/okonet/lint-staged/releases/tag/v12.4.2) - 24 May 2022

### Bug Fixes

- correctly handle --max-arg-length cli option ([1db5f26](https://github.com/okonet/lint-staged/commit/1db5f2651d7f41c56f3ee1eacb57f1be1566bce2))

## [v12.4.1](https://github.com/okonet/lint-staged/releases/tag/v12.4.1) - 26 Apr 2022

### Bug Fixes

- correctly handle symlinked config files ([b3f63ec](https://github.com/okonet/lint-staged/commit/b3f63ec43c04158e0ba00f541aa8ffb609d037d9))

## [v12.4.0](https://github.com/okonet/lint-staged/releases/tag/v12.4.0) - 20 Apr 2022

### Bug Fixes

- handle empty input by returning empty array from `parseGitZOutput` ([a118817](https://github.com/okonet/lint-staged/commit/a118817189a5b41168179fe7268903b1d7f4413a))
- limit configuration discovery to cwd ([d8fdf1d](https://github.com/okonet/lint-staged/commit/d8fdf1d9232fde6d65e6b1f4313edbf8d32f9dcb))
- restore functionality of parent globs for a single configuration file ([877ab4c](https://github.com/okonet/lint-staged/commit/877ab4cc66dfa51f5d8d14c89aeadc3ea41a1916))

### Features

- expose `--max-arg-length` cli option ([e8291b0](https://github.com/okonet/lint-staged/commit/e8291b03fa3f3210795b808f40b9a11968f2d988))

## [v12.3.8](https://github.com/okonet/lint-staged/releases/tag/v12.3.8) - 15 Apr 2022

### Bug Fixes

- avoid passing unexpected arguments from forEach to process.kill() ([1b1f0e4](https://github.com/okonet/lint-staged/commit/1b1f0e4f529dbcb5f73ab7d49c5f7908c3b8a866))
- clear execution interruption interval on first catch ([46952cb](https://github.com/okonet/lint-staged/commit/46952cb0306bb5b54d839f63aecff7288389b195))

## [v12.3.7](https://github.com/okonet/lint-staged/releases/tag/v12.3.7) - 17 Mar 2022

### Bug Fixes

- improve renderer logic for `--silent` and `FORCE_COLOR` settings ([d327873](https://github.com/okonet/lint-staged/commit/d327873b1c0b6fbdeb6fd276e523043d51d6de37))

## [v12.3.6](https://github.com/okonet/lint-staged/releases/tag/v12.3.6) - 16 Mar 2022

### Bug Fixes

- kill other running tasks on failure ([#1117](https://github.com/okonet/lint-staged/issues/1117)) ([34fe319](https://github.com/okonet/lint-staged/commit/34fe31986201983c33ea2bde41f4b451947b826b))

## [v12.3.5](https://github.com/okonet/lint-staged/releases/tag/v12.3.5) - 05 Mar 2022

### Bug Fixes

- search all configs regardless of staged files ([4b605cd](https://github.com/okonet/lint-staged/commit/4b605cd3694cc5bfcf6c5a1a2e75c80ef234ab1a))

## [v12.3.4](https://github.com/okonet/lint-staged/releases/tag/v12.3.4) - 13 Feb 2022

### Bug Fixes

- add `package.json` to exports ([#1059](https://github.com/okonet/lint-staged/issues/1059)) ([3395150](https://github.com/okonet/lint-staged/commit/339515010ccd95a2f952dbe65f8366463f94d26a))

## [v12.3.3](https://github.com/okonet/lint-staged/releases/tag/v12.3.3) - 01 Feb 2022

### Bug Fixes

- use config directory as cwd, when multiple configs present ([#1091](https://github.com/okonet/lint-staged/issues/1091)) ([9a14e92](https://github.com/okonet/lint-staged/commit/9a14e92e37abf658fc3a0d5504ff4e980e49996c))

## [v12.3.2](https://github.com/okonet/lint-staged/releases/tag/v12.3.2) - 26 Jan 2022

### Bug Fixes

- handle symlinked .git directories ([3a897ff](https://github.com/okonet/lint-staged/commit/3a897ff1515bde9fc88769257f38cb2646d624fc))

## [v12.3.1](https://github.com/okonet/lint-staged/releases/tag/v12.3.1) - 23 Jan 2022

### Bug Fixes

- **deps:** update dependencies ([f190fc3](https://github.com/okonet/lint-staged/commit/f190fc31888d0a3c6f7070cb0f97edcbc7018a0e))

## [v12.3.0](https://github.com/okonet/lint-staged/releases/tag/v12.3.0) - 23 Jan 2022

### Features

- add `--cwd` option for overriding task directory ([62b5b83](https://github.com/okonet/lint-staged/commit/62b5b833950774e731b0ca034aa9289ec254a602))

## [v12.2.2](https://github.com/okonet/lint-staged/releases/tag/v12.2.2) - 20 Jan 2022

### Bug Fixes

- always search config from `cwd` first ([4afcda5](https://github.com/okonet/lint-staged/commit/4afcda5addade65ef847e3c5b0c4a38db80d020b))

## [v12.2.1](https://github.com/okonet/lint-staged/releases/tag/v12.2.1) - 19 Jan 2022

### Bug Fixes

- only throw if no configurations were found ([36b9546](https://github.com/okonet/lint-staged/commit/36b9546dda5ca24174b519ce6d132f31077b093b))

## [v12.2.0](https://github.com/okonet/lint-staged/releases/tag/v12.2.0) - 18 Jan 2022

### Bug Fixes

- make console task titles more explicit ([1c94c27](https://github.com/okonet/lint-staged/commit/1c94c2780485f3a2273f8b82db8e74ecafe258b4))

### Features

- support multiple configuration files ([90d1035](https://github.com/okonet/lint-staged/commit/90d1035ef709329d297272e9164b0452c1ed37bd))

## [v12.1.7](https://github.com/okonet/lint-staged/releases/tag/v12.1.7) - 07 Jan 2022

### Bug Fixes

- resolve config modules with ESM createRequire ([#1082](https://github.com/okonet/lint-staged/issues/1082)) ([f9f6538](https://github.com/okonet/lint-staged/commit/f9f65380dc3fc6aaa5627abe92f4e26d5b7a25de))

## [v12.1.6](https://github.com/okonet/lint-staged/releases/tag/v12.1.6) - 07 Jan 2022

### Bug Fixes

- always run non-git tasks in the current working directory ([893f3d7](https://github.com/okonet/lint-staged/commit/893f3d7825f73115a41ddb3be34af15f4c207315))

## [v12.1.5](https://github.com/okonet/lint-staged/releases/tag/v12.1.5) - 02 Jan 2022

### Bug Fixes

- search configuration starting from explicit cwd option ([c7ea359](https://github.com/okonet/lint-staged/commit/c7ea3594c81f7c2724a7babc8e8d57926b4679c8))
- using `--debug` option enables debug mode ([5cceeb6](https://github.com/okonet/lint-staged/commit/5cceeb65630752b646047ae88cacc48b76758f1c))

## [v12.1.4](https://github.com/okonet/lint-staged/releases/tag/v12.1.4) - 24 Dec 2021

### Bug Fixes

- use cwd option when resolving git repo root ([#1075](https://github.com/okonet/lint-staged/issues/1075)) ([a230b03](https://github.com/okonet/lint-staged/commit/a230b0350885194e5f07be667312316ad869b7fc))

## [v12.1.3](https://github.com/okonet/lint-staged/releases/tag/v12.1.3) - 18 Dec 2021

### Bug Fixes

- **deps:** remove enquirer because it's now optional by listr2 ([96a1a29](https://github.com/okonet/lint-staged/commit/96a1a29ab49009d3d7edc98cc7344b1ac9c1cce6))

## [v12.1.2](https://github.com/okonet/lint-staged/releases/tag/v12.1.2) - 22 Nov 2021

### Bug Fixes

- fix Windows JS config loading by using file:// URLs ([f20ddf9](https://github.com/okonet/lint-staged/commit/f20ddf9413bfc2f44ad099b5cb1e5f478de5d35f))
- fix YAML config loading ([0082ec2](https://github.com/okonet/lint-staged/commit/0082ec22101c8f819a8b91872b808ee81d3c4d1e))
- improve error logging in loadConfig ([e7b6412](https://github.com/okonet/lint-staged/commit/e7b6412fb128f314346e28329c17a676cf691135))

## [v12.1.1](https://github.com/okonet/lint-staged/releases/tag/v12.1.1) - 21 Nov 2021

### Bug Fixes

- await for dynamic import promise when loading JS config ([e96b6d9](https://github.com/okonet/lint-staged/commit/e96b6d9674f07b4686876cb40605274577925973))

## [v12.1.0](https://github.com/okonet/lint-staged/releases/tag/v12.1.0) - 21 Nov 2021

### Features

- allow loading `.js` config file with ESM syntax ([410c3ba](https://github.com/okonet/lint-staged/commit/410c3ba36972259aa5b49045b5cd565a6525382b))
- replace `cosmiconfig` with `lilconfig` + `yaml` to reduce dependencies ([e7f9fa0](https://github.com/okonet/lint-staged/commit/e7f9fa0f2e6aa5adbb1a0c31d1ceaff01b43f692))
- support loading `.mjs` config ([8d3b176](https://github.com/okonet/lint-staged/commit/8d3b176a7af75790efbcd1f63f73e7ef51f6b377))

## [v12.0.3](https://github.com/okonet/lint-staged/releases/tag/v12.0.3) - 18 Nov 2021

### Bug Fixes

- install `enquirer` ([e01585f](https://github.com/okonet/lint-staged/commit/e01585f96d6aeef9f5f1b84df9936ce2be47d8f0))

## [v12.0.2](https://github.com/okonet/lint-staged/releases/tag/v12.0.2) - 14 Nov 2021

### Bug Fixes

- remove `npm` version requirement ([#1047](https://github.com/okonet/lint-staged/issues/1047)) ([e50d6d4](https://github.com/okonet/lint-staged/commit/e50d6d4ce53d125b735009bacb3de157fb6d1f2a))

## [v12.0.1](https://github.com/okonet/lint-staged/releases/tag/v12.0.1) - 13 Nov 2021

### Bug Fixes

- read version number from lint-staged package.json instead of package.json in cwd ([#1043](https://github.com/okonet/lint-staged/issues/1043)) ([#1044](https://github.com/okonet/lint-staged/issues/1044)) ([9f9213d](https://github.com/okonet/lint-staged/commit/9f9213d5fbc74e3c3fb11db2a1bd239888c2960c))

## [v12.0.0](https://github.com/okonet/lint-staged/releases/tag/v12.0.0) - 13 Nov 2021

### Features

- convert to native ESM module ([#1038](https://github.com/okonet/lint-staged/issues/1038)) ([7240f61](https://github.com/okonet/lint-staged/commit/7240f61730aa923b18156cc64ff5350f2d5be16d))

### 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:

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

## [v11.3.0-beta.2](https://github.com/okonet/lint-staged/releases/tag/v11.3.0-beta.2) - 30 Oct 2021

### Bug Fixes

- correctly import `js-yaml` to fix yaml config loading ([#1033](https://github.com/okonet/lint-staged/issues/1033)) ([612d806](https://github.com/okonet/lint-staged/commit/612d8066aa2c95573a06c125a311dc4aed8f2e71))
- detect git repo root correctly on cygwin ([#1026](https://github.com/okonet/lint-staged/issues/1026)) ([f291824](https://github.com/okonet/lint-staged/commit/f291824efadb1cce47eba62ee8fa57a546aab37f)), closes [#1025](https://github.com/okonet/lint-staged/issues/1025)
- remove dangling chars from git dir ([#1028](https://github.com/okonet/lint-staged/issues/1028)) ([11c004e](https://github.com/okonet/lint-staged/commit/11c004e89dfacc381fdb10b0db70475f693c27f1)), closes [#1027](https://github.com/okonet/lint-staged/issues/1027)
- revert back to `cosmiconfig` from `lilconfig` ([#1035](https://github.com/okonet/lint-staged/issues/1035)) ([e035b80](https://github.com/okonet/lint-staged/commit/e035b80e39da355da57c02db6565b55271ab1afa)), closes [#1033](https://github.com/okonet/lint-staged/issues/1033) [#981](https://github.com/okonet/lint-staged/issues/981)
- unbreak windows by correctly normalizing cwd ([#1029](https://github.com/okonet/lint-staged/issues/1029)) ([f861d8d](https://github.com/okonet/lint-staged/commit/f861d8d17d966809b6cd7ae338c289a125d0e3b4))

### Performance Improvements

- replace `cosmiconfig` with `lilconfig` ([#981](https://github.com/okonet/lint-staged/issues/981)) ([04529e2](https://github.com/okonet/lint-staged/commit/04529e2b9040adc54cc8e5efc66b95bc0023477c))

## [v11.2.6](https://github.com/okonet/lint-staged/releases/tag/v11.2.6) - 26 Oct 2021

### Bug Fixes

- revert back to `cosmiconfig` from `lilconfig` ([#1035](https://github.com/okonet/lint-staged/issues/1035)) ([e035b80](https://github.com/okonet/lint-staged/commit/e035b80e39da355da57c02db6565b55271ab1afa)), closes [#1033](https://github.com/okonet/lint-staged/issues/1033) [#981](https://github.com/okonet/lint-staged/issues/981)

## [v11.2.5](https://github.com/okonet/lint-staged/releases/tag/v11.2.5) - 26 Oct 2021

### Bug Fixes

- correctly import `js-yaml` to fix yaml config loading ([#1033](https://github.com/okonet/lint-staged/issues/1033)) ([612d806](https://github.com/okonet/lint-staged/commit/612d8066aa2c95573a06c125a311dc4aed8f2e71))

## [v11.2.4](https://github.com/okonet/lint-staged/releases/tag/v11.2.4) - 23 Oct 2021

### Performance Improvements

- replace `cosmiconfig` with `lilconfig` ([#981](https://github.com/okonet/lint-staged/issues/981)) ([04529e2](https://github.com/okonet/lint-staged/commit/04529e2b9040adc54cc8e5efc66b95bc0023477c))

## [v11.2.3](https://github.com/okonet/lint-staged/releases/tag/v11.2.3) - 10 Oct 2021

### Bug Fixes

- unbreak windows by correctly normalizing cwd ([#1029](https://github.com/okonet/lint-staged/issues/1029)) ([f861d8d](https://github.com/okonet/lint-staged/commit/f861d8d17d966809b6cd7ae338c289a125d0e3b4))

## [v11.2.2](https://github.com/okonet/lint-staged/releases/tag/v11.2.2) - 09 Oct 2021

### Bug Fixes

- remove dangling chars from git dir ([#1028](https://github.com/okonet/lint-staged/issues/1028)) ([11c004e](https://github.com/okonet/lint-staged/commit/11c004e89dfacc381fdb10b0db70475f693c27f1)), closes [#1027](https://github.com/okonet/lint-staged/issues/1027)

## [v11.2.1](https://github.com/okonet/lint-staged/releases/tag/v11.2.1) - 09 Oct 2021

### Bug Fixes

- detect git repo root correctly on cygwin ([#1026](https://github.com/okonet/lint-staged/issues/1026)) ([f291824](https://github.com/okonet/lint-staged/commit/f291824efadb1cce47eba62ee8fa57a546aab37f)), closes [#1025](https://github.com/okonet/lint-staged/issues/1025)

## [v11.3.0-beta.1](https://github.com/okonet/lint-staged/releases/tag/v11.3.0-beta.1) - 04 Oct 2021

### Bug Fixes

- add `--no-stash` as hidden option for backwards-compatibility ([73db492](https://github.com/okonet/lint-staged/commit/73db492a68c75cfa46e98fb3689329c0e82bfd92))
- do not apply empty patch ([a7c1c0b](https://github.com/okonet/lint-staged/commit/a7c1c0b07550cd54a338a17bee54eea9082d2391))
- do not use `fs/promises` for Node.js 12 compatibility ([c99a6a1](https://github.com/okonet/lint-staged/commit/c99a6a15667c1301c809c3d120c6ede465ebeb40))
- restore original state when preventing an empty commit ([f7ef8ef](https://github.com/okonet/lint-staged/commit/f7ef8ef0b3b6355df63436cbefa11bd5b9edea6e))
- restore previous order of jobs ([ba62b22](https://github.com/okonet/lint-staged/commit/ba62b2284140bb5c7068db2ae0833fa97585c689))

### Features

- do not use a git stash for better performance ([ff0cc0d](https://github.com/okonet/lint-staged/commit/ff0cc0d2d28ca8f4f0b2586eb7c3bf4d31fdc7eb))

### Performance Improvements

- further optimize by reusing previous job ([3066a35](https://github.com/okonet/lint-staged/commit/3066a350b7d09b1ff30d04be10d5793b4e1dc38e))
- re-use figures from listr2 and remove `log-symbols` ([5240c26](https://github.com/okonet/lint-staged/commit/5240c263e19ffa645a37bc16564d1f53d8f61e90))
- replace `chalk` with `colorette` and `supports-color` ([4de4cda](https://github.com/okonet/lint-staged/commit/4de4cdaea1e50c73ca01261bb8dcbd48287ec1ae))

## [v11.2.0](https://github.com/okonet/lint-staged/releases/tag/v11.2.0) - 04 Oct 2021

### Features

- **deps:** update and slim down dependencies ([#1003](https://github.com/okonet/lint-staged/issues/1003)) ([32c08d3](https://github.com/okonet/lint-staged/commit/32c08d3f3c1c929e4fb3996c36fc937f032a2c5a))

## [v11.2.0-beta.1](https://github.com/okonet/lint-staged/releases/tag/v11.2.0-beta.1) - 02 Oct 2021

### Bug Fixes

- add `--no-stash` as hidden option for backwards-compatibility ([73db492](https://github.com/okonet/lint-staged/commit/73db492a68c75cfa46e98fb3689329c0e82bfd92))
- do not apply empty patch ([a7c1c0b](https://github.com/okonet/lint-staged/commit/a7c1c0b07550cd54a338a17bee54eea9082d2391))
- do not use `fs/promises` for Node.js 12 compatibility ([c99a6a1](https://github.com/okonet/lint-staged/commit/c99a6a15667c1301c809c3d120c6ede465ebeb40))
- restore original state when preventing an empty commit ([f7ef8ef](https://github.com/okonet/lint-staged/commit/f7ef8ef0b3b6355df63436cbefa11bd5b9edea6e))
- restore previous order of jobs ([ba62b22](https://github.com/okonet/lint-staged/commit/ba62b2284140bb5c7068db2ae0833fa97585c689))

### Features

- do not use a git stash for better performance ([ff0cc0d](https://github.com/okonet/lint-staged/commit/ff0cc0d2d28ca8f4f0b2586eb7c3bf4d31fdc7eb))

### Performance Improvements

- further optimize by reusing previous job ([3066a35](https://github.com/okonet/lint-staged/commit/3066a350b7d09b1ff30d04be10d5793b4e1dc38e))
- re-use figures from listr2 and remove `log-symbols` ([5240c26](https://github.com/okonet/lint-staged/commit/5240c263e19ffa645a37bc16564d1f53d8f61e90))
- replace `chalk` with `colorette` and `supports-color` ([4de4cda](https://github.com/okonet/lint-staged/commit/4de4cdaea1e50c73ca01261bb8dcbd48287ec1ae))

## [v11.1.2](https://github.com/okonet/lint-staged/releases/tag/v11.1.2) - 06 Aug 2021

### Bug Fixes

- try to automatically fix and warn about invalid brace patterns ([#992](https://github.com/okonet/lint-staged/issues/992)) ([b3d97cf](https://github.com/okonet/lint-staged/commit/b3d97cf4cfb115e51908cd92b95896442494c778))

## [v11.1.1](https://github.com/okonet/lint-staged/releases/tag/v11.1.1) - 24 Jul 2021

### Bug Fixes

- the shell option value should be optional instead of required ([#996](https://github.com/okonet/lint-staged/issues/996)) ([f7302f4](https://github.com/okonet/lint-staged/commit/f7302f4649b52785cdd17e7339e49ff53a6e3eda)), closes [#994](https://github.com/okonet/lint-staged/issues/994)

## [v11.1.0](https://github.com/okonet/lint-staged/releases/tag/v11.1.0) - 22 Jul 2021

### Features

- allow a path to be supplied to the --shell option ([#994](https://github.com/okonet/lint-staged/issues/994)) ([fea8033](https://github.com/okonet/lint-staged/commit/fea80331c768b3642e90fc687e5aceaa419d2b77))

## [v11.0.1](https://github.com/okonet/lint-staged/releases/tag/v11.0.1) - 13 Jul 2021

### Bug Fixes

- do not swallow already detected deprecated usage by last task ([#991](https://github.com/okonet/lint-staged/issues/991)) ([7734156](https://github.com/okonet/lint-staged/commit/7734156ce272189a7c663cccbb38af73a2b954b3))

## [v11.0.0](https://github.com/okonet/lint-staged/releases/tag/v11.0.0) - 07 May 2021

### Bug Fixes

- migrate commander@7 ([f8a0261](https://github.com/okonet/lint-staged/commit/f8a026140d477f906083ae90ffb383ad0c0807a6))
- migrate husky@6 ([5560d97](https://github.com/okonet/lint-staged/commit/5560d97f6a1d034b933d352b953a957d9bee61fa))

### Features

- bump Node.js version requirement to 12.13.0 ([852aa6e](https://github.com/okonet/lint-staged/commit/852aa6ece128c408a7fdfcceaa952d05076fb4bd))

### BREAKING CHANGES

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

## [v10.5.4](https://github.com/okonet/lint-staged/releases/tag/v10.5.4) - 05 Feb 2021

### Bug Fixes

- concurrent option is not working correctly ([#950](https://github.com/okonet/lint-staged/issues/950)) ([4383815](https://github.com/okonet/lint-staged/commit/43838158b4b2557bf09c06d0d15c4936069e8855))

## [v10.5.3](https://github.com/okonet/lint-staged/releases/tag/v10.5.3) - 04 Dec 2020

### Bug Fixes

- better logging for errors in js config files ([#935](https://github.com/okonet/lint-staged/issues/935)) ([292e882](https://github.com/okonet/lint-staged/commit/292e882cc3422743f4419d98e97200483be82c4a))

## [v10.5.2](https://github.com/okonet/lint-staged/releases/tag/v10.5.2) - 24 Nov 2020

### Bug Fixes

- use bibliography-style links in related posts section of readme ([#932](https://github.com/okonet/lint-staged/issues/932)) ([0ff2917](https://github.com/okonet/lint-staged/commit/0ff29178c8771ab10e43a395e252c6a118306942)), closes [#931](https://github.com/okonet/lint-staged/issues/931)

## [v10.5.1](https://github.com/okonet/lint-staged/releases/tag/v10.5.1) - 31 Oct 2020

### Bug Fixes

- update dependencies ([#921](https://github.com/okonet/lint-staged/issues/921)) ([7933b08](https://github.com/okonet/lint-staged/commit/7933b081396d4a26d4c20fcd04c86c91cd89a8c6))

## [v10.5.0](https://github.com/okonet/lint-staged/releases/tag/v10.5.0) - 26 Oct 2020

### Features

- allow reading config from stdin ([#918](https://github.com/okonet/lint-staged/issues/918)) ([969713d](https://github.com/okonet/lint-staged/commit/969713d030515e4bafa6517244f8c41968f2b40b))

## [v10.4.2](https://github.com/okonet/lint-staged/releases/tag/v10.4.2) - 17 Oct 2020

### Bug Fixes

- update docs on supported config file extensions ([#917](https://github.com/okonet/lint-staged/issues/917)) ([78782f9](https://github.com/okonet/lint-staged/commit/78782f92b1fb0868218dc3463a3fc61dd5e70cfc))

## [v10.4.1](https://github.com/okonet/lint-staged/releases/tag/v10.4.1) - 16 Oct 2020

### Bug Fixes

- add support for .cjs configs ([#909](https://github.com/okonet/lint-staged/issues/909)) ([36e7e58](https://github.com/okonet/lint-staged/commit/36e7e5843b6b8b8744488b4db536d14d2e85e798))

## [v10.4.0](https://github.com/okonet/lint-staged/releases/tag/v10.4.0) - 16 Sep 2020

### Features

- Add ability to use function as config ([#913](https://github.com/okonet/lint-staged/issues/913)) ([67a4d06](https://github.com/okonet/lint-staged/commit/67a4d06e39c4638a546494940bf99934692fb610))

## [v10.3.0](https://github.com/okonet/lint-staged/releases/tag/v10.3.0) - 03 Sep 2020

### Features

- Add support for adding lint-staged using pre-commit.com ([#910](https://github.com/okonet/lint-staged/issues/910)) ([d404d7d](https://github.com/okonet/lint-staged/commit/d404d7d5a2ccfba51d2d59e1fbb6e2e82539646c))

## [v10.2.13](https://github.com/okonet/lint-staged/releases/tag/v10.2.13) - 25 Aug 2020

### Bug Fixes

- disambiguate stash reference ([#906](https://github.com/okonet/lint-staged/issues/906)) ([51c5ac8](https://github.com/okonet/lint-staged/commit/51c5ac80da475f2255e12547018a3366ef6bd5a4))

## [v10.2.12](https://github.com/okonet/lint-staged/releases/tag/v10.2.12) - 25 Aug 2020

### Bug Fixes

- always use the default short diff format for submodules [#902](https://github.com/okonet/lint-staged/issues/902) ([c7923ad](https://github.com/okonet/lint-staged/commit/c7923ad9259e8bc121694f8e8c4ad3668aae73e5))
- ensure supportsColor.level exists before stringifying it ([aa9898e](https://github.com/okonet/lint-staged/commit/aa9898e47ce20d925072ccc93986b28c0593e625))

## [v10.2.11](https://github.com/okonet/lint-staged/releases/tag/v10.2.11) - 17 Jun 2020

### Bug Fixes

- run all git commands with submodule.recurse=false ([#888](https://github.com/okonet/lint-staged/issues/888)) ([86c9ed2](https://github.com/okonet/lint-staged/commit/86c9ed2bde1245a702635b42a57b92b809340b0e))

## [v10.2.10](https://github.com/okonet/lint-staged/releases/tag/v10.2.10) - 12 Jun 2020

### Bug Fixes

- Git directory is not correctly resolved if GIT_WORK_TREE is set to relative path ([#887](https://github.com/okonet/lint-staged/issues/887)) ([a1904ec](https://github.com/okonet/lint-staged/commit/a1904ec6a96b04cd93eeb622b04cf328a10083df))

## [v10.2.9](https://github.com/okonet/lint-staged/releases/tag/v10.2.9) - 04 Jun 2020

### Bug Fixes

- update listr@2.1.0 and add enquirer peer dependency ([#883](https://github.com/okonet/lint-staged/issues/883)) ([0daae61](https://github.com/okonet/lint-staged/commit/0daae611b0637ebc6b9fac8672b842444bee3a38))

## [v10.2.8](https://github.com/okonet/lint-staged/releases/tag/v10.2.8) - 03 Jun 2020

### Bug Fixes

- canceling lint-staged via SIGINT restores state and cleans up ([#881](https://github.com/okonet/lint-staged/issues/881)) ([b078324](https://github.com/okonet/lint-staged/commit/b078324d5e911ec5e667736b2c552af32f475751))

## [v10.2.7](https://github.com/okonet/lint-staged/releases/tag/v10.2.7) - 29 May 2020

### Bug Fixes

- use machine output to avoid escaped and quoted filenames ([ea80a3d](https://github.com/okonet/lint-staged/commit/ea80a3dc4124ce8437d7879dea3c9220fb5b0ca2))

## [v10.2.6](https://github.com/okonet/lint-staged/releases/tag/v10.2.6) - 22 May 2020

### Bug Fixes

- remove nanoid devDependency to remove ExperimentalWarning ([#874](https://github.com/okonet/lint-staged/issues/874)) ([979da5d](https://github.com/okonet/lint-staged/commit/979da5d0d2fed4ef4a1748eaf10bb150005c99c4))

## [v10.2.5](https://github.com/okonet/lint-staged/releases/tag/v10.2.5) - 22 May 2020

### Bug Fixes

- truncate command title to stdout width ([#865](https://github.com/okonet/lint-staged/issues/865)) ([b8e1a4a](https://github.com/okonet/lint-staged/commit/b8e1a4a9683639d961f948283dec0e6dec556493))

## [v10.2.4](https://github.com/okonet/lint-staged/releases/tag/v10.2.4) - 18 May 2020

### Bug Fixes

- node-13 deps issue with listr2 and uuid ([#868](https://github.com/okonet/lint-staged/issues/868)) ([93bc942](https://github.com/okonet/lint-staged/commit/93bc942d9640e152a65c15d42c707c9b63420684))

## [v10.2.3](https://github.com/okonet/lint-staged/releases/tag/v10.2.3) - 18 May 2020

### Bug Fixes

- update listr2@2.0.1 ([157ad3e](https://github.com/okonet/lint-staged/commit/157ad3e97c91551de6f1182c7a8c17f3762f1f47))

## [v10.2.2](https://github.com/okonet/lint-staged/releases/tag/v10.2.2) - 01 May 2020

### Bug Fixes

- chunkFiles chunks normalized files even when maxArgLength is set ([#858](https://github.com/okonet/lint-staged/issues/858)) ([fc72170](https://github.com/okonet/lint-staged/commit/fc721704f223a8b649f949af38311c4d567268a6))

## [v10.2.1](https://github.com/okonet/lint-staged/releases/tag/v10.2.1) - 30 Apr 2020

### Bug Fixes

- normalize chunked paths even when maxArgLength is not set ([ba67f48](https://github.com/okonet/lint-staged/commit/ba67f48f5a8314723cbf1d9de08b6a794d4c112b))
- resolve matched files to cwd instead of gitDir before adding ([defe045](https://github.com/okonet/lint-staged/commit/defe0452e3080b8a13913cde11da43d30ff0e2d0))

## [v10.2.0](https://github.com/okonet/lint-staged/releases/tag/v10.2.0) - 28 Apr 2020

### Bug Fixes

- all lint-staged output respects the `quiet` option ([aba3421](https://github.com/okonet/lint-staged/commit/aba3421b0ec7335e49bc3f06a71441037bb2ae8a))
- do not show incorrect error when verbose and no output ([b8df31a](https://github.com/okonet/lint-staged/commit/b8df31af839a3125fa11fefae25359f1cfd271fd))
- log task output after running listr to keep everything ([d69c65b](https://github.com/okonet/lint-staged/commit/d69c65b8b5f7fa00dfecf52633fa6edd6bad6e29))
- use test renderer during tests and when TERM=dumb ([16848d8](https://github.com/okonet/lint-staged/commit/16848d83f3ec2cf67406755ec0aaa931ffb6787e))

### Features

- add `--verbose` to show output even when tasks succeed ([85de3a3](https://github.com/okonet/lint-staged/commit/85de3a3aff34061211622e5a250a172fcbd6fb5b))
- allow specifying `cwd` using the Node.js API ([a3bd9d7](https://github.com/okonet/lint-staged/commit/a3bd9d7fa0b85983eb25f8483b407a14b15c1f11))
- replace listr with listr2 and print errors inline ([8f32a3e](https://github.com/okonet/lint-staged/commit/8f32a3eb38926fe931c36f788947a62a0b26405c))

## [v10.1.7](https://github.com/okonet/lint-staged/releases/tag/v10.1.7) - 21 Apr 2020

### Bug Fixes

- use stash create/store to prevent files from disappearing from disk ([c9adca5](https://github.com/okonet/lint-staged/commit/c9adca5))

## [v10.1.6](https://github.com/okonet/lint-staged/releases/tag/v10.1.6) - 19 Apr 2020

### Bug Fixes

- **deps:** update dependencies ([e093b1d](https://github.com/okonet/lint-staged/commit/e093b1d))

## [v10.1.5](https://github.com/okonet/lint-staged/releases/tag/v10.1.5) - 18 Apr 2020

### Bug Fixes

- pass correct path to unstaged patch during cleanup ([6066b07](https://github.com/okonet/lint-staged/commit/6066b07))

## [v10.1.4](https://github.com/okonet/lint-staged/releases/tag/v10.1.4) - 17 Apr 2020

### Bug Fixes

- allow lint-staged to run on empty git repo by disabling backup ([0bf1fb0](https://github.com/okonet/lint-staged/commit/0bf1fb0))

## [v10.1.3](https://github.com/okonet/lint-staged/releases/tag/v10.1.3) - 09 Apr 2020

### Bug Fixes

- only run git add on staged files matched to a task ([d39573b](https://github.com/okonet/lint-staged/commit/d39573b))
- run `git add` for staged file chunks serially ([69acfa3](https://github.com/okonet/lint-staged/commit/69acfa3))

## [v10.1.2](https://github.com/okonet/lint-staged/releases/tag/v10.1.2) - 05 Apr 2020

### Bug Fixes

- no longer include untracked files in backup stash ([#827](https://github.com/okonet/lint-staged/issues/827)) ([2f15336](https://github.com/okonet/lint-staged/commit/2f15336))

## [v10.1.1](https://github.com/okonet/lint-staged/releases/tag/v10.1.1) - 31 Mar 2020

### Bug Fixes

- add `--` to `git add` command to denote pathspec starting ([#821](https://github.com/okonet/lint-staged/issues/821)) ([226ccdb](https://github.com/okonet/lint-staged/commit/226ccdb7727c9837fa04528047ced89466c4b833))

## [v10.1.0](https://github.com/okonet/lint-staged/releases/tag/v10.1.0) - 30 Mar 2020

### Bug Fixes

- do not return string from runAll, add info symbol to "No staged files found." message ([1e7298a](https://github.com/okonet/lint-staged/commit/1e7298a23c3c2d09810f6e1a54ead8a449d7fd7d))
- force src and dst prefixes in diff to work around local diff.noprefix setting ([7f2ef33](https://github.com/okonet/lint-staged/commit/7f2ef33dde170e83a8943886a4f1502113dcb50c))
- unset GIT_LITERAL_PATHSPECS env variable before running ([a653c55](https://github.com/okonet/lint-staged/commit/a653c55a397e7e6f04fa5aefb0ddf2c7543569d9))

### Features

- add `--no-stash` option to disable the backup stash, and not revert in case of errors ([c386e4c](https://github.com/okonet/lint-staged/commit/c386e4cf9646dc0953213e9a0ef857cb9664af37))
- only hide/restore unstaged modifications to partially staged files ([52125a9](https://github.com/okonet/lint-staged/commit/52125a9d557e3fc117a421662cf45d6462517d87))

## [v10.0.10](https://github.com/okonet/lint-staged/releases/tag/v10.0.10) - 29 Mar 2020

### Bug Fixes

- support non-ASCII filenames when git is configured with `core.quotepath on` ([2cb26a6](https://github.com/okonet/lint-staged/commit/2cb26a635a313a32c208caf5ba6a9215a68b9c6d))

## [v10.0.9](https://github.com/okonet/lint-staged/releases/tag/v10.0.9) - 24 Mar 2020

### Bug Fixes

- use `path.join` and `normalize` to improve msys compatibility in resolveGitRepo ([1ad263a](https://github.com/okonet/lint-staged/commit/1ad263a5c03d0f3fd90f2dffd0d9083f0ef8112e))

## [v10.0.8](https://github.com/okonet/lint-staged/releases/tag/v10.0.8) - 25 Feb 2020

### Bug Fixes

- do not drop backup stash when reverting to original state fails ([f589336](https://github.com/okonet/lint-staged/commit/f5893365409bf935db058a4f41aeaccc90cd3a18))
- evaluate functional configuration only once ([abe4b92](https://github.com/okonet/lint-staged/commit/abe4b92d7f6213b59d756d172298bc29bb2bd44c))

## [v10.0.7](https://github.com/okonet/lint-staged/releases/tag/v10.0.7) - 31 Jan 2020

### Bug Fixes

- replace fs.promises with util.promisify ([#786](https://github.com/okonet/lint-staged/issues/786)) ([f71c1c9](https://github.com/okonet/lint-staged/commit/f71c1c9ad2d27205199171bf3dc0e908889ba384))

## [v10.0.6](https://github.com/okonet/lint-staged/releases/tag/v10.0.6) - 30 Jan 2020

### Bug Fixes

- make sure deleted files aren't restored due to git bugs ([#778](https://github.com/okonet/lint-staged/issues/778)) ([6bfbe6c](https://github.com/okonet/lint-staged/commit/6bfbe6c204e351bd7055c5ecc810e1f9074304da))

## [v10.0.5](https://github.com/okonet/lint-staged/releases/tag/v10.0.5) - 30 Jan 2020

### Bug Fixes

- always resolve real git config dir location if .git is a file ([#784](https://github.com/okonet/lint-staged/issues/784)) ([b98a5ed](https://github.com/okonet/lint-staged/commit/b98a5ed8d422f637af4157a157676a70e3f1981a))

## [v10.0.4](https://github.com/okonet/lint-staged/releases/tag/v10.0.4) - 29 Jan 2020

### Bug Fixes

- use verbose renderer when TERM=dumb ([#782](https://github.com/okonet/lint-staged/issues/782)) ([9c08e8e](https://github.com/okonet/lint-staged/commit/9c08e8ee0bdf00de7dc6e15cd660e6fc55129832))

## [v10.0.3](https://github.com/okonet/lint-staged/releases/tag/v10.0.3) - 27 Jan 2020

### Bug Fixes

- correctly restore untracked files after running ([#780](https://github.com/okonet/lint-staged/issues/780)) ([4010db0](https://github.com/okonet/lint-staged/commit/4010db09f6d168af677bd4ca1c815ba40460ae80))

## [v10.0.2](https://github.com/okonet/lint-staged/releases/tag/v10.0.2) - 22 Jan 2020

### Bug Fixes

- only warn about git add when it's the exact command ([24febb3](https://github.com/okonet/lint-staged/commit/24febb3c906dd84f8ee19bae74509e42db034380))
- parse command string with string-argv unless --shell is used ([4cb4dde](https://github.com/okonet/lint-staged/commit/4cb4ddee0c6b6500eefd20eb3d1bad249d51b96a))
- print a better warning when the initial commit is missing ([293547d](https://github.com/okonet/lint-staged/commit/293547d46080eac007393709a0d63a63f2063fff))

## [v10.0.1](https://github.com/okonet/lint-staged/releases/tag/v10.0.1) - 20 Jan 2020

### Bug Fixes

- preserve merge states in submodules ([#769](https://github.com/okonet/lint-staged/issues/769)) ([e646b2c](https://github.com/okonet/lint-staged/commit/e646b2c46ad34344b526462200471fa47dcc398f))

## [v10.0.0](https://github.com/okonet/lint-staged/releases/tag/v10.0.0) - 19 Jan 2020

### Bug Fixes

- add all modified files to git index with `git add .` ([bf532c2](https://github.com/okonet/lint-staged/commit/bf532c2af9dbd3514b16768a106fea82ddc99923))
- automatically add modifications only to originally staged files ([083b8e7](https://github.com/okonet/lint-staged/commit/083b8e7d67307a177d427d694ead22cb0c95b0ca))
- better workaround for git stash --keep-index bug ([f3ae378](https://github.com/okonet/lint-staged/commit/f3ae378aa8d7207f990c4ffec854cc8da4d38b1d))
- correctly leave only staged files for running tasks ([cfde9ca](https://github.com/okonet/lint-staged/commit/cfde9ca64bed7fa236eda69e63478c536f9f9068))
- correctly recover when unstaged changes cannot be restored ([d091f71](https://github.com/okonet/lint-staged/commit/d091f71ff50b1eddc59e759b1b09a95ed613c4d2))
- correctly restore untracked files from backup stash ([c7d0592](https://github.com/okonet/lint-staged/commit/c7d05922b24524707795c4045339801c86affe9d))
- error handling skips dropping backup stash after internal git errors ([30b4809](https://github.com/okonet/lint-staged/commit/30b480925a313f5c2b614eb40eb1a340a6cefae5))
- fail with a message when backup stash is missing ([1b64239](https://github.com/okonet/lint-staged/commit/1b64239163f5560b7235843909a9d30ff7ca1b83))
- gitWorkflow handles active merge mode ([2f1e886](https://github.com/okonet/lint-staged/commit/2f1e886cba422844b0496a96696dae5296835862))
- handle git MERGE\_\* files separately; improve error handling ([da22cf2](https://github.com/okonet/lint-staged/commit/da22cf22bbd21be98a73b880a4ce43dbd0129021))
- improve debug logging ([f88e226](https://github.com/okonet/lint-staged/commit/f88e22619b8dea4fbcda3d57a85ca9d1be152908))
- keep untracked files around by backing them up ([fc03fdc](https://github.com/okonet/lint-staged/commit/fc03fdc2e869384eb2d6423ff31f84e3cf22007e))
- max arg length is by default half of the allowed to prevent edge cases ([80406c2](https://github.com/okonet/lint-staged/commit/80406c20fd3d1a86b0a0558c10f6747b2b47698e))
- prevent Listr from hiding git add warning ([cce9809](https://github.com/okonet/lint-staged/commit/cce9809a2ce335a3b2c3f44e4c521270b13f9d4c))
- restore metadata about git merge before running tasks ([f8ddfc2](https://github.com/okonet/lint-staged/commit/f8ddfc22d22fec2b417a67249573e7cd6abdb9fc))
- retry failing apply with 3-way merge ([76cb08f](https://github.com/okonet/lint-staged/commit/76cb08f6eecd68f3ae7e606216b4c5fdc1da94f0))
- support binary files ([7b3a334](https://github.com/okonet/lint-staged/commit/7b3a334ac33ffe1bda930583a055fb1db0b6d181))
- try applying unstaged changes before handling errors ([357934f](https://github.com/okonet/lint-staged/commit/357934fe1e193040d1a138d3d138da1377004be2))
- update warning about git add, and to README ([6467a66](https://github.com/okonet/lint-staged/commit/6467a66b13657f1a39b0f1f3a079dc31a8461fe9))
- workaround for stashing deleted files for git < 2.23 ([1a87333](https://github.com/okonet/lint-staged/commit/1a87333f9ee0704b3bb332bf5fbc11dbd25f7821))

### Features

- automatically stage task modifications ([74ed28d](https://github.com/okonet/lint-staged/commit/74ed28d5edc70c66d769f7658b90b550029a2acf))
- bump Node.js version dependency to at least 10.13.0 ([#747](https://github.com/okonet/lint-staged/issues/747)) ([814b9df](https://github.com/okonet/lint-staged/commit/814b9dfe131f55c18a8996f775dd5dd582d0a766))
- split tasks into chunks to support shells with limited max argument length ([#732](https://github.com/okonet/lint-staged/issues/732)) ([cb43872](https://github.com/okonet/lint-staged/commit/cb43872fb6c05366a8fc25a8bd889b95918f45a3))
- support async function tasks ([20d5c5d](https://github.com/okonet/lint-staged/commit/20d5c5d4cb92f9a4c501e5308cc51379d10581a8))
- throw error to prevent empty commits unless --allow-empty is used ([#762](https://github.com/okonet/lint-staged/issues/762)) ([8bdeec0](https://github.com/okonet/lint-staged/commit/8bdeec067f425150722bd0ee78e310e0992a1444))
- use git stashes for gitWorkflow ([40a5db1](https://github.com/okonet/lint-staged/commit/40a5db1f6b1ad17b5a593974b6db93015f50824c))
- warn when task contains "git add" ([5208399](https://github.com/okonet/lint-staged/commit/52083990166cbea3bfe3d316ad6598c6c198fe1e))

### 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](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.15) - 08 Jan 2020

### Features

- throw error to prevent empty commits unless --allow-empty is used ([#762](https://github.com/okonet/lint-staged/issues/762)) ([8bdeec0](https://github.com/okonet/lint-staged/commit/8bdeec067f425150722bd0ee78e310e0992a1444))

### 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](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.14) - 24 Dec 2019

### Bug Fixes

- error handling skips dropping backup stash after internal git errors ([30b4809](https://github.com/okonet/lint-staged/commit/30b480925a313f5c2b614eb40eb1a340a6cefae5))

## [v10.0.0-beta.13](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.13) - 20 Dec 2019

### Bug Fixes

- handle git MERGE\_\* files separately; improve error handling ([da22cf2](https://github.com/okonet/lint-staged/commit/da22cf22bbd21be98a73b880a4ce43dbd0129021))

## [v10.0.0-beta.12](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.12) - 18 Dec 2019

### Features

- support async function tasks ([20d5c5d](https://github.com/okonet/lint-staged/commit/20d5c5d4cb92f9a4c501e5308cc51379d10581a8))

## [v10.0.0-beta.11](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.11) - 17 Dec 2019

### Bug Fixes

- fail with a message when backup stash is missing ([1b64239](https://github.com/okonet/lint-staged/commit/1b64239163f5560b7235843909a9d30ff7ca1b83))

## [v10.0.0-beta.10](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.10) - 17 Dec 2019

### Bug Fixes

- correctly recover when unstaged changes cannot be restored ([d091f71](https://github.com/okonet/lint-staged/commit/d091f71ff50b1eddc59e759b1b09a95ed613c4d2))

## [v10.0.0-beta.9](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.9) - 16 Dec 2019

### Bug Fixes

- restore metadata about git merge before running tasks ([f8ddfc2](https://github.com/okonet/lint-staged/commit/f8ddfc22d22fec2b417a67249573e7cd6abdb9fc))

## [v10.0.0-beta.8](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.8) - 14 Dec 2019

### Bug Fixes

- better workaround for git stash --keep-index bug ([f3ae378](https://github.com/okonet/lint-staged/commit/f3ae378aa8d7207f990c4ffec854cc8da4d38b1d))

## [v10.0.0-beta.7](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.7) - 05 Dec 2019

### Bug Fixes

- automatically add modifications only to originally staged files ([083b8e7](https://github.com/okonet/lint-staged/commit/083b8e7d67307a177d427d694ead22cb0c95b0ca))

### Features

- bump Node.js version dependency to at least 10.13.0 ([#747](https://github.com/okonet/lint-staged/issues/747)) ([814b9df](https://github.com/okonet/lint-staged/commit/814b9dfe131f55c18a8996f775dd5dd582d0a766))

### BREAKING CHANGES

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

## [v10.0.0-beta.6](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.6) - 27 Nov 2019

### Features

- add support for concurrent CLI option ([6af8307](https://github.com/okonet/lint-staged/commit/6af83070c44003477c00d4c088806af23333ec59))

## [v10.0.0-beta.5](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.5) - 27 Nov 2019

### Bug Fixes

- improve debug logging ([f88e226](https://github.com/okonet/lint-staged/commit/f88e22619b8dea4fbcda3d57a85ca9d1be152908))
- max arg length is by default half of the allowed to prevent edge cases ([80406c2](https://github.com/okonet/lint-staged/commit/80406c20fd3d1a86b0a0558c10f6747b2b47698e))

## [v9.5.0](https://github.com/okonet/lint-staged/releases/tag/v9.5.0) - 27 Nov 2019

### Features

- add support for concurrent CLI option ([6af8307](https://github.com/okonet/lint-staged/commit/6af83070c44003477c00d4c088806af23333ec59))

## [v10.0.0-beta.4](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.4) - 20 Nov 2019

### Features

- split tasks into chunks to support shells with limited max argument length ([#732](https://github.com/okonet/lint-staged/issues/732)) ([cb43872](https://github.com/okonet/lint-staged/commit/cb43872fb6c05366a8fc25a8bd889b95918f45a3))

## [v10.0.0-beta.3](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.3) - 14 Nov 2019

### Bug Fixes

- support binary files ([7b3a334](https://github.com/okonet/lint-staged/commit/7b3a334ac33ffe1bda930583a055fb1db0b6d181))

## [v10.0.0-beta.2](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.2) - 14 Nov 2019

### Bug Fixes

- correctly leave only staged files for running tasks ([cfde9ca](https://github.com/okonet/lint-staged/commit/cfde9ca64bed7fa236eda69e63478c536f9f9068))

### Reverts

- Revert "fix: no need to run `git clean -df` since untracked changes are stashed" ([e58ebbf](https://github.com/okonet/lint-staged/commit/e58ebbfa2dbbcd0c05ae13026a65c33ff791e211))

## [v10.0.0-beta.1](https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.1) - 14 Nov 2019

### Bug Fixes

- add all modified files to git index with `git add .` ([bf532c2](https://github.com/okonet/lint-staged/commit/bf532c2af9dbd3514b16768a106fea82ddc99923))
- correctly restore untracked files from backup stash ([c7d0592](https://github.com/okonet/lint-staged/commit/c7d05922b24524707795c4045339801c86affe9d))
- gitWorkflow handles active merge mode ([2f1e886](https://github.com/okonet/lint-staged/commit/2f1e886cba422844b0496a96696dae5296835862))
- keep untracked files around by backing them up ([fc03fdc](https://github.com/okonet/lint-staged/commit/fc03fdc2e869384eb2d6423ff31f84e3cf22007e))
- no need to run `git clean -df` since untracked changes are stashed ([869bac6](https://github.com/okonet/lint-staged/commit/869bac617dd1ef46e6689027c9d3ec67b3a00934))
- prevent Listr from hiding git add warning ([cce9809](https://github.com/okonet/lint-staged/commit/cce9809a2ce335a3b2c3f44e4c521270b13f9d4c))
- retry failing apply with 3-way merge ([76cb08f](https://github.com/okonet/lint-staged/commit/76cb08f6eecd68f3ae7e606216b4c5fdc1da94f0))
- try applying unstaged changes before handling errors ([357934f](https://github.com/okonet/lint-staged/commit/357934fe1e193040d1a138d3d138da1377004be2))
- update warning about git add, and to README ([6467a66](https://github.com/okonet/lint-staged/commit/6467a66b13657f1a39b0f1f3a079dc31a8461fe9))
- workaround for stashing deleted files for git < 2.23 ([1a87333](https://github.com/okonet/lint-staged/commit/1a87333f9ee0704b3bb332bf5fbc11dbd25f7821))

### Features

- automatically stage task modifications ([74ed28d](https://github.com/okonet/lint-staged/commit/74ed28d5edc70c66d769f7658b90b550029a2acf))
- use git stashes for gitWorkflow ([40a5db1](https://github.com/okonet/lint-staged/commit/40a5db1f6b1ad17b5a593974b6db93015f50824c))
- warn when task contains "git add" ([5208399](https://github.com/okonet/lint-staged/commit/52083990166cbea3bfe3d316ad6598c6c198fe1e))

### 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](https://github.com/okonet/lint-staged/releases/tag/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](https://github.com/okonet/lint-staged/issues/722)) ([ed84d8e](https://github.com/okonet/lint-staged/commit/ed84d8e812010f6da333eff7ca31c71ebf35e7df))

## [v9.5.0-beta.2 (v9.5.0-beta.2@beta)](https://github.com/okonet/lint-staged/releases/tag/v9.5.0-beta.2@beta) - 03 Nov 2019

### Bug Fixes

- no need to run `git clean -df` since untracked changes are stashed ([bbfae43](https://github.com/okonet/lint-staged/commit/bbfae432c319eabb980bf9491c64f545521f5f64))
- update warning about git add, and to README ([4fe53ef](https://github.com/okonet/lint-staged/commit/4fe53efbc6a7b68afe1786fc0c17b688dcc5fa0e))

### 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.5.0-beta.1 (v9.5.0-beta.1@beta)](https://github.com/okonet/lint-staged/releases/tag/v9.5.0-beta.1@beta) - 31 Oct 2019

### Bug Fixes

- correctly restore untracked files from backup stash ([0111f48](https://github.com/okonet/lint-staged/commit/0111f4848e4043cfaf45b528e952db6ea7182cb4))
- gitWorkflow handles active merge mode ([959d9d9](https://github.com/okonet/lint-staged/commit/959d9d926d42958feca74a0ca355ffd04c42d113))
- keep untracked files around by backing them up ([d20c5be](https://github.com/okonet/lint-staged/commit/d20c5be11acd3dc2fca3e74830305f3309617ad2))
- prevent Listr from hiding git add warning ([2b57db0](https://github.com/okonet/lint-staged/commit/2b57db07ac44870063e15d7f6aaea0d54f9833bf))
- retry failing apply with 3-way merge ([30939b9](https://github.com/okonet/lint-staged/commit/30939b91b52a53b0045cffdcacd8cb0ec15e2c05))
- try applying unstaged changes before handling errors ([080f1c6](https://github.com/okonet/lint-staged/commit/080f1c62c74c2ffb26df2e7a8f44d349584db53b))
- workaround for stashing deleted files for git < 2.23 ([50afea0](https://github.com/okonet/lint-staged/commit/50afea0ffc6d08f89dd98372a3ff8f48d76f3070))

### Features

- automatically stage task modifications ([7d0379d](https://github.com/okonet/lint-staged/commit/7d0379db4f61a0ef460133e0488d2766777bbf32))
- use git stashes for gitWorkflow ([bfd2adc](https://github.com/okonet/lint-staged/commit/bfd2adc27dff016b7aa84df1cb0570ed836c6426))
- warn when task contains "git add" ([4014f3c](https://github.com/okonet/lint-staged/commit/4014f3c926be1fca183c35de17eb35f939690283))

## [v9.4.2](https://github.com/okonet/lint-staged/releases/tag/v9.4.2) - 08 Oct 2019

### Bug Fixes

- create fn title with mock file list of correct length ([8c3ca58](https://github.com/okonet/lint-staged/commit/8c3ca58))

## [v9.4.1](https://github.com/okonet/lint-staged/releases/tag/v9.4.1) - 01 Oct 2019

### Bug Fixes

- add note about next version ([#708](https://github.com/okonet/lint-staged/issues/708)) ([8ec040c](https://github.com/okonet/lint-staged/commit/8ec040c))

## [v9.4.0](https://github.com/okonet/lint-staged/releases/tag/v9.4.0) - 26 Sep 2019

### Features

- Use shorter title for function tasks with many staged files ([#706](https://github.com/okonet/lint-staged/issues/706)) ([1dcdb89](https://github.com/okonet/lint-staged/commit/1dcdb89)), closes [#674](https://github.com/okonet/lint-staged/issues/674)

## [v9.3.0](https://github.com/okonet/lint-staged/releases/tag/v9.3.0) - 22 Sep 2019

### Features

- allow to pass config instead of configPath ([14c46d2](https://github.com/okonet/lint-staged/commit/14c46d2))

## [v9.2.5](https://github.com/okonet/lint-staged/releases/tag/v9.2.5) - 27 Aug 2019

### Bug Fixes

- validateConfig validates function task return values ([d8fad78](https://github.com/okonet/lint-staged/commit/d8fad78))

## [v9.2.4](https://github.com/okonet/lint-staged/releases/tag/v9.2.4) - 25 Aug 2019

### Bug Fixes

- include renames when getting list of staged files ([2243a83](https://github.com/okonet/lint-staged/commit/2243a83))

## [v9.2.3](https://github.com/okonet/lint-staged/releases/tag/v9.2.3) - 17 Aug 2019

### Bug Fixes

- don't normalize path gitDir path for better Windows compatibility ([eb3fa83](https://github.com/okonet/lint-staged/commit/eb3fa83))
- generateTasks handles parent dir globs correctly ([82b5182](https://github.com/okonet/lint-staged/commit/82b5182))
- normalize gitDir path to posix using normalize-path ([f485e51](https://github.com/okonet/lint-staged/commit/f485e51))

## [v9.2.2](https://github.com/okonet/lint-staged/releases/tag/v9.2.2) - 17 Aug 2019

### Bug Fixes

- apply patch only if there's a diff ([e70e08f](https://github.com/okonet/lint-staged/commit/e70e08f))

## [v9.2.1](https://github.com/okonet/lint-staged/releases/tag/v9.2.1) - 25 Jul 2019

### Bug Fixes

- pin commitizen@3.1.2 to support node 8 ([ee774e3](https://github.com/okonet/lint-staged/commit/ee774e3))
- pin cz-conventional-changelog@2.1.0 to support node 8 ([e879b6a](https://github.com/okonet/lint-staged/commit/e879b6a))
- remove empty spaces from warning ([6126b72](https://github.com/okonet/lint-staged/commit/6126b72))

## [v9.2.0](https://github.com/okonet/lint-staged/releases/tag/v9.2.0) - 10 Jul 2019

### Features

- add --relative option for controlling file paths ([242deb5](https://github.com/okonet/lint-staged/commit/242deb5))

## [v9.1.0](https://github.com/okonet/lint-staged/releases/tag/v9.1.0) - 06 Jul 2019

### Bug Fixes

- snapshot with fully-resolved path name ([b1a08b8](https://github.com/okonet/lint-staged/commit/b1a08b8))

### Features

- make node-api accessible ([ca37906](https://github.com/okonet/lint-staged/commit/ca37906))

## [v9.0.2](https://github.com/okonet/lint-staged/releases/tag/v9.0.2) - 03 Jul 2019

### Bug Fixes

- run all commands returned by function linters ([0dd0c94](https://github.com/okonet/lint-staged/commit/0dd0c94))

## [v9.0.1](https://github.com/okonet/lint-staged/releases/tag/v9.0.1) - 02 Jul 2019

### Bug Fixes

- Update node version requirement ([#646](https://github.com/okonet/lint-staged/issues/646)) ([6c1e42f](https://github.com/okonet/lint-staged/commit/6c1e42f))

## [v9.0.0](https://github.com/okonet/lint-staged/releases/tag/v9.0.0) - 01 Jul 2019

### Bug Fixes

- parse titles for function linters ([e24aaf2](https://github.com/okonet/lint-staged/commit/e24aaf2))

### Code Refactoring

- remove advanced configuration options ([04190c8](https://github.com/okonet/lint-staged/commit/04190c8))
- remove support for chunking ([2ca9050](https://github.com/okonet/lint-staged/commit/2ca9050))
- use execa's shell option to run commands ([bed9127](https://github.com/okonet/lint-staged/commit/bed9127))

### Features

- add --shell and --quiet flags ([ecf9227](https://github.com/okonet/lint-staged/commit/ecf9227))
- add deprecation error for advanced configuration ([4bef26e](https://github.com/okonet/lint-staged/commit/4bef26e))
- support function linter returning array of commands ([36e54a2](https://github.com/okonet/lint-staged/commit/36e54a2))
- support functions as linter commands ([f76c0d1](https://github.com/okonet/lint-staged/commit/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](https://github.com/okonet/lint-staged/releases/tag/v8.2.1) - 13 Jun 2019

### Bug Fixes

- Override env GIT_DIR variable to resolve to the correct git dir path ([#629](https://github.com/okonet/lint-staged/issues/629)) ([5892455](https://github.com/okonet/lint-staged/commit/5892455)), closes [#627](https://github.com/okonet/lint-staged/issues/627)

## [v8.2.0](https://github.com/okonet/lint-staged/releases/tag/v8.2.0) - 06 Jun 2019

### Bug Fixes

- normalize gitDir path for Windows compatibility ([90e343b](https://github.com/okonet/lint-staged/commit/90e343b))

### Features

- throw error in runAll if outside git directory ([6ac666d](https://github.com/okonet/lint-staged/commit/6ac666d))

## [v8.1.7](https://github.com/okonet/lint-staged/releases/tag/v8.1.7) - 15 May 2019

### Bug Fixes

- Resolve security vulnerability in dependencies ([#615](https://github.com/okonet/lint-staged/issues/615)) ([315890a](https://github.com/okonet/lint-staged/commit/315890a)), closes [#600](https://github.com/okonet/lint-staged/issues/600)

## [v8.1.6](https://github.com/okonet/lint-staged/releases/tag/v8.1.6) - 03 May 2019

### Bug Fixes

- update yup to 0.27.0 ([#607](https://github.com/okonet/lint-staged/issues/607)) ([0984524](https://github.com/okonet/lint-staged/commit/0984524))

## [v8.1.5](https://github.com/okonet/lint-staged/releases/tag/v8.1.5) - 01 Mar 2019

### Bug Fixes

- fix issue with scoped pkg listr-update-renderer ([#587](https://github.com/okonet/lint-staged/issues/587)) ([63b085f](https://github.com/okonet/lint-staged/commit/63b085f)), closes [#585](https://github.com/okonet/lint-staged/issues/585)

## [v8.1.4](https://github.com/okonet/lint-staged/releases/tag/v8.1.4) - 14 Feb 2019

### Bug Fixes

- Use lodash version with prototype pollution fix ([#578](https://github.com/okonet/lint-staged/issues/578)) ([0be88a0](https://github.com/okonet/lint-staged/commit/0be88a0))

## [v8.1.3](https://github.com/okonet/lint-staged/releases/tag/v8.1.3) - 02 Feb 2019

### Bug Fixes

- Display package name when node-please-upgrade is being used ([#575](https://github.com/okonet/lint-staged/issues/575)) ([f5bed7b](https://github.com/okonet/lint-staged/commit/f5bed7b))

## [v8.1.2](https://github.com/okonet/lint-staged/releases/tag/v8.1.2) - 02 Feb 2019

### Bug Fixes

- Avoid stashing if no staged files has been changed ([#570](https://github.com/okonet/lint-staged/issues/570)) ([#573](https://github.com/okonet/lint-staged/issues/573)) ([8c4d9c9](https://github.com/okonet/lint-staged/commit/8c4d9c9))

## [v8.1.1](https://github.com/okonet/lint-staged/releases/tag/v8.1.1) - 28 Jan 2019

### Bug Fixes

- Fix configuration validation and allow specifying custom renderers ([#572](https://github.com/okonet/lint-staged/issues/572)) ([d5e738d](https://github.com/okonet/lint-staged/commit/d5e738d)), closes [#567](https://github.com/okonet/lint-staged/issues/567)

## [v8.1.0](https://github.com/okonet/lint-staged/releases/tag/v8.1.0) - 21 Nov 2018

### Features

- Add `relative` option to allow passing relative paths to linters ([#534](http://git+https/github.com/okonet/lint-staged/issues/534)) ([fcb774b](http://git+https/github.com/okonet/lint-staged/commit/fcb774b))

## [v8.0.5](https://github.com/okonet/lint-staged/releases/tag/v8.0.5) - 17 Nov 2018

### Bug Fixes

- Use listr-update-renderer from npm ([#542](http://git+https/github.com/okonet/lint-staged/issues/542)) ([503110d](http://git+https/github.com/okonet/lint-staged/commit/503110d)), closes [#533](http://git+https/github.com/okonet/lint-staged/issues/533)

## [v8.0.4](https://github.com/okonet/lint-staged/releases/tag/v8.0.4) - 31 Oct 2018

### Bug Fixes

- **package:** update staged-git-files to version 1.1.2 ([ce434d3](http://git+https/github.com/okonet/lint-staged/commit/ce434d3))

## [v8.0.3](https://github.com/okonet/lint-staged/releases/tag/v8.0.3) - 30 Oct 2018

### Bug Fixes

- Allow to use lint-staged on CI ([#523](http://git+https/github.com/okonet/lint-staged/issues/523)) ([225a904](http://git+https/github.com/okonet/lint-staged/commit/225a904))

## [v8.0.2](https://github.com/okonet/lint-staged/releases/tag/v8.0.2) - 29 Oct 2018

### Bug Fixes

- **git:** Use resolveGitDir in hasPartiallyStagedFiles ([#520](http://git+https/github.com/okonet/lint-staged/issues/520)) ([af99172](http://git+https/github.com/okonet/lint-staged/commit/af99172)), closes [#514](http://git+https/github.com/okonet/lint-staged/issues/514)

## [v8.0.1](https://github.com/okonet/lint-staged/releases/tag/v8.0.1) - 29 Oct 2018

### Bug Fixes

- **git:** Use resolveGitDir to resolve to .git for git commands ([#518](http://git+https/github.com/okonet/lint-staged/issues/518)) ([da42f8a](http://git+https/github.com/okonet/lint-staged/commit/da42f8a)), closes [#514](http://git+https/github.com/okonet/lint-staged/issues/514)

## [v8.0.0](https://github.com/okonet/lint-staged/releases/tag/v8.0.0) - 29 Oct 2018

### Features

- Add support for partially staged files ([#75](http://git+https/github.com/okonet/lint-staged/issues/75)) ([f82443c](http://git+https/github.com/okonet/lint-staged/commit/f82443c)), closes [#62](http://git+https/github.com/okonet/lint-staged/issues/62)

### BREAKING CHANGES

- Node >= 8.6 is required

## [v7.3.0](https://github.com/okonet/lint-staged/releases/tag/v7.3.0) - 20 Sep 2018

### Features

- Allow linting files outside of project folder ([#495](https://github.com/okonet/lint-staged/issues/495)) ([d386c80](https://github.com/okonet/lint-staged/commit/d386c80))

## [v7.2.2](https://github.com/okonet/lint-staged/releases/tag/v7.2.2) - 12 Aug 2018

### Bug Fixes

- Make app package.json load error tolerant ([#479](https://github.com/okonet/lint-staged/issues/479)) ([d59fad7](https://github.com/okonet/lint-staged/commit/d59fad7))

## [v7.2.1](https://github.com/okonet/lint-staged/releases/tag/v7.2.1) - 12 Aug 2018

### Bug Fixes

- Disable recursive checks for jest-validate ([#483](https://github.com/okonet/lint-staged/issues/483)) ([c350a0e](https://github.com/okonet/lint-staged/commit/c350a0e))

## [v7.2.0](https://github.com/okonet/lint-staged/releases/tag/v7.2.0) - 11 Jun 2018

### Features

- Resolve a npm package passed as --config ([#464](https://github.com/okonet/lint-staged/issues/464)) ([c34a3f7](https://github.com/okonet/lint-staged/commit/c34a3f7))

## [v7.1.3](https://github.com/okonet/lint-staged/releases/tag/v7.1.3) - 01 Jun 2018

### Bug Fixes

- **package:** Update jest-validate to version 23.0.0 ([#458](https://github.com/okonet/lint-staged/issues/458)) ([3d0ccb2](https://github.com/okonet/lint-staged/commit/3d0ccb2))

## [v7.1.2](https://github.com/okonet/lint-staged/releases/tag/v7.1.2) - 21 May 2018

### Bug Fixes

- **package:** Update cosmiconfig to version 5.0.2 ([#444](https://github.com/okonet/lint-staged/issues/444)) ([2fc7aa3](https://github.com/okonet/lint-staged/commit/2fc7aa3)), closes [#441](https://github.com/okonet/lint-staged/issues/441)
- **package:** Update listr to version 0.14.1 ([#445](https://github.com/okonet/lint-staged/issues/445)) ([a56d7c9](https://github.com/okonet/lint-staged/commit/a56d7c9)), closes [#426](https://github.com/okonet/lint-staged/issues/426)
- Add .lintstagedrc.js to list of config files to search ([9e27620](https://github.com/okonet/lint-staged/commit/9e27620))

## [v7.1.1](https://github.com/okonet/lint-staged/releases/tag/v7.1.1) - 18 May 2018

### Bug Fixes

- **cli:** Correct value for FORCE_COLOR env var ([#451](https://github.com/okonet/lint-staged/issues/451)) ([9823d26](https://github.com/okonet/lint-staged/commit/9823d26)), closes [#448](https://github.com/okonet/lint-staged/issues/448)

## [v7.1.0](https://github.com/okonet/lint-staged/releases/tag/v7.1.0) - 07 May 2018

### Features

- Chunked execution of linters on Windows only ([#439](https://github.com/okonet/lint-staged/issues/439)) ([1601c02](https://github.com/okonet/lint-staged/commit/1601c02))

## [v7.0.5](https://github.com/okonet/lint-staged/releases/tag/v7.0.5) - 26 Apr 2018

### Bug Fixes

- Update "please-upgrade-node" to version 3.0.2 ([#434](https://github.com/okonet/lint-staged/issues/434)) ([b9d84ce](https://github.com/okonet/lint-staged/commit/b9d84ce))

## [v7.0.4](https://github.com/okonet/lint-staged/releases/tag/v7.0.4) - 05 Apr 2018

### Bug Fixes

- Parse arguments with single quotes properly. Better tests. ([29fc479](https://github.com/okonet/lint-staged/commit/29fc479)), closes [#419](https://github.com/okonet/lint-staged/issues/419)

## [v7.0.3](https://github.com/okonet/lint-staged/releases/tag/v7.0.3) - 03 Apr 2018

### Bug Fixes

- Fix cli-command-parser to parse arguments for execa ([b4fbc3b](https://github.com/okonet/lint-staged/commit/b4fbc3b)), closes [#419](https://github.com/okonet/lint-staged/issues/419)
- Use double quotes to make command work on Windows ([06635c6](https://github.com/okonet/lint-staged/commit/06635c6))

## [v7.0.2](https://github.com/okonet/lint-staged/releases/tag/v7.0.2) - 01 Apr 2018

### Bug Fixes

- Hide error message in a private field to avoid duplicate logs ([#421](https://github.com/okonet/lint-staged/issues/421)) ([4d6f165](https://github.com/okonet/lint-staged/commit/4d6f165))

## [v7.0.1](https://github.com/okonet/lint-staged/releases/tag/v7.0.1) - 30 Mar 2018

### Bug Fixes

- **package:** update staged-git-files to version 1.1.1 ([31176c9](https://github.com/okonet/lint-staged/commit/31176c9))

## [v7.0.0](https://github.com/okonet/lint-staged/releases/tag/v7.0.0) - 21 Feb 2018

### Bug Fixes

- **package:** Bump dependencies ([267ff0f](https://github.com/okonet/lint-staged/commit/267ff0f))

### Code Refactoring

- Drop support for Node.js 4 ([#399](https://github.com/okonet/lint-staged/issues/399)) ([05a062d](https://github.com/okonet/lint-staged/commit/05a062d))

### Features

- Remove support for npm scripts ([#390](https://github.com/okonet/lint-staged/issues/390)) ([d8b836c](https://github.com/okonet/lint-staged/commit/d8b836c))

### Performance Improvements

- Switch from minimatch to micromatch ([#388](https://github.com/okonet/lint-staged/issues/388)) ([5a333a0](https://github.com/okonet/lint-staged/commit/5a333a0))

### BREAKING CHANGES

- **Requires Node.js v6 or later.**
- **Remove implicit support for running npm scripts.**

  Consider example `lint-staged` config:

  ```json
  {
    "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`:**
  - `nocomment`: https://github.com/isaacs/minimatch#nocomment
  - `flipnegate`: https://github.com/isaacs/minimatch#flipnegate

## [v6.1.1](https://github.com/okonet/lint-staged/releases/tag/v6.1.1) - 16 Feb 2018

### Bug Fixes

- **package:** Update staged-git-files to version 1.0.0 ([677e860](https://github.com/okonet/lint-staged/commit/677e860))

## [v6.1.0](https://github.com/okonet/lint-staged/releases/tag/v6.1.0) - 26 Jan 2018

### Features

- **config:** Add `ignore` config option ([#385](https://github.com/okonet/lint-staged/issues/385)) ([5b7bc67](https://github.com/okonet/lint-staged/commit/5b7bc67))

## [v6.0.1](https://github.com/okonet/lint-staged/releases/tag/v6.0.1) - 19 Jan 2018

### Bug Fixes

- **package:** update cosmiconfig to version 4.0.0 ([80596c3](https://github.com/okonet/lint-staged/commit/80596c3))

## [v6.0.0](https://github.com/okonet/lint-staged/releases/tag/v6.0.0) - 01 Dec 2017

### Features

- Add debug mode, deprecate verbose option ([#344](https://github.com/okonet/lint-staged/issues/344)) ([8f214f0](https://github.com/okonet/lint-staged/commit/8f214f0))

### BREAKING CHANGES

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

## [v5.0.0](https://github.com/okonet/lint-staged/releases/tag/v5.0.0) - 11 Nov 2017

### Features

- Remove gitDir option and resolve it automatically ([#327](https://github.com/okonet/lint-staged/issues/327)) ([0ed5135](https://github.com/okonet/lint-staged/commit/0ed5135)), closes [#271](https://github.com/okonet/lint-staged/issues/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:

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

With `lint-staged@5`, this simplifies to:

```yml
linters:
  src/*.js:
    - eslint --fix
    - git add
```

<details>

<summary><code>diff</code> view</summary>

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

</details>

## [v4.3.0](https://github.com/okonet/lint-staged/releases/tag/v4.3.0) - 18 Oct 2017

### Features

- Allow config to be provided via command-line ([#304](https://github.com/okonet/lint-staged/issues/304)) ([54809ae](https://github.com/okonet/lint-staged/commit/54809ae))

## [v4.2.3](https://github.com/okonet/lint-staged/releases/tag/v4.2.3) - 25 Sep 2017

### Bug Fixes

- **findBin:** Add separator before npm args ([#297](https://github.com/okonet/lint-staged/issues/297)) ([065f362](https://github.com/okonet/lint-staged/commit/065f362))

## [v4.2.2](https://github.com/okonet/lint-staged/releases/tag/v4.2.2) - 22 Sep 2017

### Bug Fixes

- **findBin:** Resolve package script with args ([#295](https://github.com/okonet/lint-staged/issues/295)) ([1dc3bd6](https://github.com/okonet/lint-staged/commit/1dc3bd6))

## [v4.2.1](https://github.com/okonet/lint-staged/releases/tag/v4.2.1) - 15 Sep 2017

### Bug Fixes

- Missing entry file ([#283](https://github.com/okonet/lint-staged/issues/283)) ([e17ba5f](https://github.com/okonet/lint-staged/commit/e17ba5f)), closes [#284](https://github.com/okonet/lint-staged/issues/284)

## [v4.2.0](https://github.com/okonet/lint-staged/releases/tag/v4.2.0) - 15 Sep 2017

### Features

- Print friendlier error if config is missing ([#281](https://github.com/okonet/lint-staged/issues/281)) ([30fa594](https://github.com/okonet/lint-staged/commit/30fa594))

## [v4.1.3](https://github.com/okonet/lint-staged/releases/tag/v4.1.3) - 07 Sep 2017

### Bug Fixes

- Unicode symbols compatibility on Windows ([#248](https://github.com/okonet/lint-staged/issues/248)) ([49b11e4](https://github.com/okonet/lint-staged/commit/49b11e4))

## [v4.1.2](https://github.com/okonet/lint-staged/releases/tag/v4.1.2) - 06 Sep 2017

### Bug Fixes

- Handle the case when staged-git-files errors properly ([#267](https://github.com/okonet/lint-staged/issues/267)) ([a8a585a](https://github.com/okonet/lint-staged/commit/a8a585a)), closes [#264](https://github.com/okonet/lint-staged/issues/264)

## [v4.1.1](https://github.com/okonet/lint-staged/releases/tag/v4.1.1) - 06 Sep 2017

### Bug Fixes

- Use lodash `has` to check config keys presence ([#265](https://github.com/okonet/lint-staged/issues/265)) ([c0287e6](https://github.com/okonet/lint-staged/commit/c0287e6)), closes [#263](https://github.com/okonet/lint-staged/issues/263)

## [v4.1.0](https://github.com/okonet/lint-staged/releases/tag/v4.1.0) - 04 Sep 2017

### Features

- **config:** Config validation ([#141](https://github.com/okonet/lint-staged/issues/141)) ([d99eb38](https://github.com/okonet/lint-staged/commit/d99eb38))

## [v4.0.4](https://github.com/okonet/lint-staged/releases/tag/v4.0.4) - 24 Aug 2017

### Bug Fixes

- Disable concurrent sub task execution by default ([#229](https://github.com/okonet/lint-staged/issues/229)) ([48c8c6ff](https://github.com/okonet/lint-staged/commit/48c8c6ff), closes [#225](https://github.com/okonet/lint-staged/issues/225))

## [v4.0.3](https://github.com/okonet/lint-staged/releases/tag/v4.0.3) - 06 Aug 2017

### Bug Fixes

- **package:** update execa to version 0.8.0 ([#222](https://github.com/okonet/lint-staged/issues/222)) ([27adf8bb](https://github.com/okonet/lint-staged/commit/27adf8bb))

## [v4.0.2](https://github.com/okonet/lint-staged/releases/tag/v4.0.2) - 17 Jul 2017

### Bug Fixes

- Remove unportable postinstall step ([#213](https://github.com/okonet/lint-staged/issues/213)) ([a2dcd047](https://github.com/okonet/lint-staged/commit/a2dcd047), closes [#212](https://github.com/okonet/lint-staged/issues/212), [#192](https://github.com/okonet/lint-staged/issues/192))

## [v4.0.1](https://github.com/okonet/lint-staged/releases/tag/v4.0.1) - 06 Jul 2017

### Bug Fixes

- Bail on fatal errors ([#208](https://github.com/okonet/lint-staged/issues/208)) ([ca85d82a](https://github.com/okonet/lint-staged/commit/ca85d82a))

## [v4.0.0](https://github.com/okonet/lint-staged/releases/tag/v4.0.0) - 18 Jun 2017

### Bug Fixes

- Skip '--' argument for non-npm commands ([#196](https://github.com/okonet/lint-staged/issues/196)) ([ad265664](https://github.com/okonet/lint-staged/commit/ad265664), closes [#195](https://github.com/okonet/lint-staged/issues/195))

### Breaking Changes

-

This might affect existing setups which depend on the `--` argument.
([ad265664](https://github.com/okonet/lint-staged/commit/ad265664))

## [v3.6.1](https://github.com/okonet/lint-staged/releases/tag/v3.6.1) - 10 Jun 2017

### Bug Fixes

- **package:** update execa to version 0.7.0 ([#187](https://github.com/okonet/lint-staged/issues/187)) ([4bfe017d](https://github.com/okonet/lint-staged/commit/4bfe017d))

## [v3.6.0](https://github.com/okonet/lint-staged/releases/tag/v3.6.0) - 01 Jun 2017

### Features

- Add advanced option `globOptions` to customise minimatch ([#179](https://github.com/okonet/lint-staged/issues/179)) ([c5b9804b](https://github.com/okonet/lint-staged/commit/c5b9804b), closes [#173](https://github.com/okonet/lint-staged/issues/173))

## [v3.5.1](https://github.com/okonet/lint-staged/releases/tag/v3.5.1) - 29 May 2017

### Bug Fixes

- **gitDir:** Fix for checking if task contains `git.exe` on Windows ([#178](https://github.com/okonet/lint-staged/issues/178)) ([4c600178](https://github.com/okonet/lint-staged/commit/4c600178))

## [v3.5.0](https://github.com/okonet/lint-staged/releases/tag/v3.5.0) - 25 May 2017

### Features

- Run linters with configurable concurrency ([#149](https://github.com/okonet/lint-staged/issues/149)) ([79ad8b3f](https://github.com/okonet/lint-staged/commit/79ad8b3f), closes [#147](https://github.com/okonet/lint-staged/issues/147))

## [v3.4.2](https://github.com/okonet/lint-staged/releases/tag/v3.4.2) - 17 May 2017

### Bug Fixes

- Only pass gitDir for git specific executables ([#162](https://github.com/okonet/lint-staged/issues/162)) ([c7283b77](https://github.com/okonet/lint-staged/commit/c7283b77), closes [#158](https://github.com/okonet/lint-staged/issues/158))

## [v3.4.1](https://github.com/okonet/lint-staged/releases/tag/v3.4.1) - 28 Apr 2017

### Bug Fixes

- **package:** update listr to version 0.12.0 ([#155](https://github.com/okonet/lint-staged/issues/155)) ([21df53ec](https://github.com/okonet/lint-staged/commit/21df53ec), closes [#142](https://github.com/okonet/lint-staged/issues/142))

## [v3.4.0](https://github.com/okonet/lint-staged/releases/tag/v3.4.0) - 13 Mar 2017

### Features

- Display a message if there are no files that match a pattern. ([#139](https://github.com/okonet/lint-staged/issues/139)) ([b0204ee4](https://github.com/okonet/lint-staged/commit/b0204ee4), closes [#135](https://github.com/okonet/lint-staged/issues/135))

## [v3.3.2](https://github.com/okonet/lint-staged/releases/tag/v3.3.2) - 13 Mar 2017

### Bug Fixes

- Remove unnecessary `which` dependency and code block in findBin.js ([3acd6c7b](https://github.com/okonet/lint-staged/commit/3acd6c7b))

## [v3.3.1](https://github.com/okonet/lint-staged/releases/tag/v3.3.1) - 19 Feb 2017

### Bug Fixes

- **concurrent:** Wait for all tasks to finish before showing errors ([5a44bea4](https://github.com/okonet/lint-staged/commit/5a44bea4), closes [#86](https://github.com/okonet/lint-staged/issues/86))
- **package:** update listr to version 0.11.0 ([3c75c16b](https://github.com/okonet/lint-staged/commit/3c75c16b))

## [v3.3.0](https://github.com/okonet/lint-staged/releases/tag/v3.3.0) - 30 Jan 2017

### Bug Fixes

- **gitDir:** Run `npm run` scripts in the current working directory instead of git directory. ([9c45d8ee](https://github.com/okonet/lint-staged/commit/9c45d8ee), closes [#122](https://github.com/okonet/lint-staged/issues/122))

### Features

- **verbose:** Add verbose option ([9dae19f9](https://github.com/okonet/lint-staged/commit/9dae19f9))

## [v3.2.9](https://github.com/okonet/lint-staged/releases/tag/v3.2.9) - 30 Jan 2017

### Bug Fixes

- **concurrent:** Fix `concurrent: false` could not be set using config ([22a1d774](https://github.com/okonet/lint-staged/commit/22a1d774))

## [v3.2.8](https://github.com/okonet/lint-staged/releases/tag/v3.2.8) - 24 Jan 2017

### Bug Fixes

- **windows:** Do not reuse execa options object for runners since it breaks on Windows ([#124](https://github.com/okonet/lint-staged/issues/124)) ([be8aa3f0](https://github.com/okonet/lint-staged/commit/be8aa3f0), closes [#114](https://github.com/okonet/lint-staged/issues/114))

## [v3.2.7](https://github.com/okonet/lint-staged/releases/tag/v3.2.7) - 18 Jan 2017

### Bug Fixes

- Generate absolute paths for all paths relative to git root ([#121](https://github.com/okonet/lint-staged/issues/121)) ([41ae0cb3](https://github.com/okonet/lint-staged/commit/41ae0cb3), closes [#118](https://github.com/okonet/lint-staged/issues/118), [#120](https://github.com/okonet/lint-staged/issues/120))

## [v3.2.6](https://github.com/okonet/lint-staged/releases/tag/v3.2.6) - 09 Jan 2017

### Bug Fixes

- **package:** update execa to version 0.6.0 ([#117](https://github.com/okonet/lint-staged/issues/117)) ([6fd017bf](https://github.com/okonet/lint-staged/commit/6fd017bf))

## [v3.2.5](https://github.com/okonet/lint-staged/releases/tag/v3.2.5) - 30 Dec 2016

### Bug Fixes

- **resolvePaths:** Use cwd-relative paths instead of absolute paths ([#116](https://github.com/okonet/lint-staged/issues/116)) ([968e0d8f](https://github.com/okonet/lint-staged/commit/968e0d8f), closes [#115](https://github.com/okonet/lint-staged/issues/115), [#115](https://github.com/okonet/lint-staged/issues/115))

## [v3.2.4](https://github.com/okonet/lint-staged/releases/tag/v3.2.4) - 19 Dec 2016

### Bug Fixes

- When rejecting, use new Error and error.message respectively. ([#113](https://github.com/okonet/lint-staged/issues/113)) ([97ad4b46](https://github.com/okonet/lint-staged/commit/97ad4b46), closes [#112](https://github.com/okonet/lint-staged/issues/112))

## [v3.2.3](https://github.com/okonet/lint-staged/releases/tag/v3.2.3) - 14 Dec 2016

### Bug Fixes

- Run commands in the context of `gitDir` if it is set ([#110](https://github.com/okonet/lint-staged/issues/110)) ([a74135d6](https://github.com/okonet/lint-staged/commit/a74135d6), closes [#109](https://github.com/okonet/lint-staged/issues/109))

## [v3.2.2](https://github.com/okonet/lint-staged/releases/tag/3.2.2) - 07 Dec 2016

- [fix]: Force colors only when running in TTY ([#108](https://github.com/okonet/lint-staged/issues/108))
- [docs]: Added npm version badge

## [v3.2.1](https://github.com/okonet/lint-staged/releases/tag/3.2.1) - 04 Nov 2016

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

## [v3.2.0](https://github.com/okonet/lint-staged/releases/tag/3.2.0) - 18 Oct 2016

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

## [v3.1.1](https://github.com/okonet/lint-staged/releases/tag/3.1.1) - 17 Oct 2016

- [fix] Properly resolve paths when the git directory differs from the current working directory. [#78](https://github.com/okonet/lint-staged/issues/78)
- [fix] Fixed `TypeError: Path must be a string. Received undefined` when `gitDir` isn't defined in the config.

## [v3.1.0](https://github.com/okonet/lint-staged/releases/tag/3.1.0) - 13 Oct 2016

- Split code into smaller modules + added tests for them. Closes [#68](https://github.com/okonet/lint-staged/issues/68)
- Support for different configs via https://github.com/davidtheclark/cosmiconfig. Closes [#64](https://github.com/okonet/lint-staged/issues/64)
- Run separate linters concurrently by default
- Added concurrent option to the config. Closes [#63](https://github.com/okonet/lint-staged/issues/63)
- Switched to https://github.com/okonet/eslint-config-okonet
- lint-staged now work from sub-directories. [#65](https://github.com/okonet/lint-staged/issues/65) by [@TheWolfNL](https://github.com/TheWolfNL)
- Output both `stdout` and `stderr` in case of error. Closes [#66](https://github.com/okonet/lint-staged/issues/66)

## [v3.0.3](https://github.com/okonet/lint-staged/releases/tag/3.0.3) - 22 Sep 2016

- Added `FORCE_COLOR` env variable to force colors for packages that depend on https://www.npmjs.com/package/supports-color. Closes [#50](https://github.com/okonet/lint-staged/issues/50)

## [v3.0.2](https://github.com/okonet/lint-staged/releases/tag/3.0.2) - 12 Sep 2016

- Removed unused dependecies

## [v3.0.1](https://github.com/okonet/lint-staged/releases/tag/3.0.1) - 08 Sep 2016

- Switched to listr. Simplified code and more beautiful output.
- Switched to execa. Should fix [#30](https://github.com/okonet/lint-staged/issues/30)
- Use ES2015. Dropped support for Node < 4.x
- Support commands with arguments in the lint-staged config. Closes [#47](https://github.com/okonet/lint-staged/issues/47)
- Support binaries from $PATH. Closes [#47](https://github.com/okonet/lint-staged/issues/47)
- Removed `--color` option from runner. You should pass arguments yourself.

## [v2.0.3](https://github.com/okonet/lint-staged/releases/tag/2.0.3) - 02 Aug 2016

- Use `cross-spawn` to fix issues with Windows. Closes [#30](https://github.com/okonet/lint-staged/issues/30). ([#34](https://github.com/okonet/lint-staged/issues/34))
- Updated dependencies

## [v2.0.2](https://github.com/okonet/lint-staged/releases/tag/2.0.2) - 11 Jul 2016

- Fixes an error when running a config with just one task ([#28](https://github.com/okonet/lint-staged/issues/28)). [#27](https://github.com/okonet/lint-staged/issues/27) [@Anber](https://github.com/Anber).
- Beautiful string representation for multiple linters in case of error.
- Added tests to getLintersAsString.

## [v2.0.1](https://github.com/okonet/lint-staged/releases/tag/2.0.1) - 08 Jul 2016

- When on of the sequential tasks fails, exit the process. Closes [#26](https://github.com/okonet/lint-staged/issues/26)

## [v2.0.0](https://github.com/okonet/lint-staged/releases/tag/2.0.0) - 08 Jul 2016

- Support for sequences of commands. Needs config update! [#25](https://github.com/okonet/lint-staged/issues/25) [@okonet](https://github.com/okonet)
- Allow adding files to the commit after running a task. [#16](https://github.com/okonet/lint-staged/issues/16) [@okonet](https://github.com/okonet)

## [v1.0.2](https://github.com/okonet/lint-staged/releases/tag/1.0.2) - 30 Jun 2016

- Fixed path resolution to the app root on Windows. [#19](https://github.com/okonet/lint-staged/issues/19) by <OJ Kwon>

## [v1.0.1](https://github.com/okonet/lint-staged/releases/tag/1.0.1) - 07 Jun 2016

- Fixed support of local npm scripts from package.json

## [v1.0.0](https://github.com/okonet/lint-staged/releases/tag/1.0.0) - 07 Jun 2016

- Complete re-write using Node.js API to fix [#5](https://github.com/okonet/lint-staged/issues/5), [#6](https://github.com/okonet/lint-staged/issues/6), [#7](https://github.com/okonet/lint-staged/issues/7), [#8](https://github.com/okonet/lint-staged/issues/8)
- Switched to staged-git-files that supports git filter. Exclude deleted files. Closes [#12](https://github.com/okonet/lint-staged/issues/12)

## [v0.2.2](https://github.com/okonet/lint-staged/releases/tag/v0.2.2) - 02 May 2016

- Switch to bin/bash and fix file existncy check [#9](https://github.com/okonet/lint-staged/issues/9) [@fubhy](https://github.com/fubhy)
- Switch to `$(npm bin)` instead of hardcoding path [#9](https://github.com/okonet/lint-staged/issues/9) [@fubhy](https://github.com/fubhy)
- Updated flow installation instructions [@okonet](https://github.com/okonet)

## [v0.2.1](https://github.com/okonet/lint-staged/releases/tag/v0.2.1) - 02 May 2016

- Fixed path for flow binary [#4](https://github.com/okonet/lint-staged/issues/4) [@nikgraf](https://github.com/nikgraf)

## [v0.2.0](https://github.com/okonet/lint-staged/releases/tag/v0.2.0) - 02 May 2016

- Added more linters: flow, JSCS [@okonet](https://github.com/okonet)
- Better console output when no binary is found [@okonet](https://github.com/okonet)
- Better README [@okonet](https://github.com/okonet)

## [v0.1.1](https://github.com/okonet/lint-staged/releases/tag/v0.1.1) - 02 May 2016

- Initial release


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

Bug reports are welcome. New feature requests are probably not going to be implemented because _lint-staged_ should stay as a simple tool, and most complex behavior can already be achieved by running custom scripts via _lint-staged_. However, if you really think a new feature would simplify the tool for everyone, do share it!

Use the issue template and fill in all sections, including debug logs for bugs. Do not submit content purely generately by an LLM ("AI"), because it most likely will not be considered.


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2016 Andrey Okonetchnikov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: MIGRATION.md
================================================
## v16

#### Updated Node.js version requirement

For version `lint-staged@16.0.0` the lowest supported Node.js version is `20.19.0`, following requirements of `nano-spawn`. Please upgrade your Node.js version.

For version `lint-staged@16.1.0` this is lowered to `20.17.0`, again following `nano-spawn`.

#### Removed validation for removed advanced configuration file options

Advanced configuration options (removed in v9) are no longer validated separately, and might be treated as valid globs for tasks. Please do not try to use advanced config options anymore, they haven't been supported since v8.

#### Removed the `--shell` option

The `--shell` flag has been removed and _lint-staged_ no longer supports evaluating commands directly via a shell. To migrate existing commands, you can create a shell script and invoke it instead. Lint-staged will pass matched staged files as a list of arguments, accessible via `"$@"`:

```shell
# my-script.sh
#!/bin/bash

echo "Staged files: $@"
```

and

```json
{ "*.js": "my-script.sh" }
```

If you were using the shell option to avoid passing filenames to tasks, for example `bash -c 'tsc --noEmit'`, use the function syntax instead:

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

#### Processes are spawned using `nano-spawn`

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"
}
```

## v15

- Since `v15.0.0` _lint-staged_ no longer supports Node.js 16. Please upgrade your Node.js version to at least `18.12.0`.

## v14

- Since `v14.0.0` _lint-staged_ no longer supports Node.js 14. Please upgrade your Node.js version to at least `16.14.0`.

## v13

- Since `v13.0.0` _lint-staged_ no longer supports Node.js 12. Please upgrade your Node.js version to at least `14.13.1`, or `16.0.0` onward.
- Version `v13.3.0` was incorrectly released including code of version `v14.0.0`. This means the breaking changes of `v14` are also included in `v13.3.0`, the last `v13` version released

## v12

- Since `v12.0.0` _lint-staged_ is a pure ESM module, so make sure your Node.js version is at least `12.20.0`, `14.13.1`, or `16.0.0`. Read more about ESM modules from the official [Node.js Documentation site here](https://nodejs.org/api/esm.html#introduction).

## v10

- From `v10.0.0` onwards any new modifications to originally staged files will be automatically added to the commit.
  If your task previously contained a `git add` step, please remove this.
  The automatic behaviour ensures there are less race-conditions,
  since trying to run multiple git operations at the same time usually results in an error.
- From `v10.0.0` onwards, lint-staged uses git stashes to improve speed and provide backups while running.
  Since git stashes require at least an initial commit, you shouldn't run lint-staged in an empty repo.
- From `v10.0.0` onwards, lint-staged requires Node.js version 10.13.0 or later.
- From `v10.0.0` onwards, lint-staged will abort the commit if linter tasks undo all staged changes. To allow creating an empty commit, please use the `--allow-empty` option.


================================================
FILE: README.md
================================================
# 🚫💩 lint-staged

[![npm version](https://badge.fury.io/js/lint-staged.svg)](https://badge.fury.io/js/lint-staged)

---

Run tasks like formatters and linters against staged git files and don't let :poop: slip into your code base!

```bash
npm install --save-dev lint-staged # requires further setup
```

```
$ git commit

✔ Backed up original state in git stash (5bda95f)
❯ Running tasks for staged files...
  ❯ packages/frontend/.lintstagedrc.json — 1 file
    ↓ *.js — no files [SKIPPED]
    ❯ *.{json,md} — 1 file
      ⠹ prettier --write
  ↓ packages/backend/.lintstagedrc.json — 2 files
    ❯ *.js — 2 files
      ⠼ eslint --fix
    ↓ *.{json,md} — no files [SKIPPED]
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
```

<details>
<summary>See asciinema video</summary>

[![asciicast](https://asciinema.org/a/199934.svg)](https://asciinema.org/a/199934)

</details>

> [!Tip]
> Do you only want to check staged files for errors, but not edit them automatically?  
> You might be interested in this simpler shell script: [`lint-staged.sh`](https://github.com/lint-staged/lint-staged.sh).

## Table of Contents

- [Why](#why)
- [Installation and setup](#installation-and-setup)
- [Changelog](#changelog)
- [Command line flags](#command-line-flags)
- [Configuration](#configuration)
- [Filtering files](#filtering-files)
- [What commands are supported?](#what-commands-are-supported)
- [Running multiple commands in a sequence](#running-multiple-commands-in-a-sequence)
- [Using JS configuration files](#using-js-configuration-files)
- [Reformatting the code](#reformatting-the-code)
- [Examples](#examples)
- [Frequently Asked Questions](#frequently-asked-questions)

## Why

Code quality tasks like formatters and linters make more sense when run before committing your code. By doing so you can ensure no errors go into the repository and enforce code style. But running a task on a whole project can be slow, and opinionated tasks such as linting can sometimes produce irrelevant results. Ultimately you only want to check files that will be committed.

This project contains a script that will run arbitrary shell tasks with a list of staged files as an argument, filtered by a specified glob pattern.

### Related blog posts and talks

- [Introductory Medium post - Andrey Okonetchnikov, 2016](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8#.8qepn2b5l)
- [Running Jest Tests Before Each Git Commit - Ben McCormick, 2017](https://benmccormick.org/2017/02/26/running-jest-tests-before-each-git-commit/)
- [AgentConf presentation - Andrey Okonetchnikov, 2018](https://www.youtube.com/watch?v=-mhY7e-EsC4)
- [SurviveJS interview - Juho Vepsäläinen and Andrey Okonetchnikov, 2018](https://survivejs.com/blog/lint-staged-interview/)
- [Prettier your CSharp with `dotnet-format` and `lint-staged`](https://johnnyreilly.com/2020/12/22/prettier-your-csharp-with-dotnet-format-and-lint-staged)

## Installation and setup

To install _lint-staged_ in the recommended way, you need to:

1. Install _lint-staged_ itself:
   - `npm install --save-dev lint-staged`
1. Set up the `pre-commit` git hook to run _lint-staged_
   - [Husky](https://github.com/typicode/husky) is a popular choice for configuring git hooks
   - Read more about git hooks [here](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
1. Install some tools like [ESLint](https://eslint.org) or [Prettier](https://prettier.io)
1. Configure _lint-staged_ to run code checkers and other tasks:
   - for example: `{ "*.js": "eslint" }` to run ESLint for all staged JS files
   - See [Configuration](#configuration) for more info

Don't forget to commit changes to `package.json` and `.husky` to share this setup with your team!

Now change a few files, `git add` or `git add --patch` some of them to your commit, and try to `git commit` them.

See [examples](#examples) and [configuration](#configuration) for more information.

> [!CAUTION]  
> _Lint-staged_ runs `git` operations affecting the files in your repository. By default _lint-staged_ creates a `git stash` as a backup of the original state before running any configured tasks to help prevent data loss.

## Changelog

See [Releases](https://github.com/okonet/lint-staged/releases).

### Migration

For breaking changes, see [MIGRATION.md](./MIGRATION.md).

## Command line flags

```
❯ npx lint-staged --help
Usage: lint-staged [options]

Options:
  -V, --version                      output the version number
  --allow-empty                      allow empty commits when tasks revert all staged changes (default: false)
  -p, --concurrent <number|boolean>  the number of tasks to run concurrently, or false for serial (default: true)
  -c, --config [path]                path to configuration file, or - to read from stdin
  --cwd [path]                       run all tasks in specific directory, instead of the current
  -d, --debug                        print additional debug information (default: false)
  --diff [string]                    override the default "--staged" flag of "git diff" to get list of files. Implies
                                     "--no-stash".
  --diff-filter [string]             override the default "--diff-filter=ACMR" flag of "git diff" to get list of files
  --continue-on-error                run all tasks to completion even if one fails (default: false)
  --fail-on-changes                  fail with exit code 1 when tasks modify tracked files (default: false)
  --max-arg-length [number]          maximum length of the command-line argument string (default: 0)
  --no-revert                        do not revert to original state in case of errors.
  --no-stash                         disable the backup stash. Implies "--no-revert".
  --no-hide-partially-staged         disable hiding unstaged changes from partially staged files
  --hide-unstaged                    hide all unstaged changes, instead of just partially staged (default: false)
  -q, --quiet                        disable lint-staged’s own console output (default: false)
  -r, --relative                     pass relative filepaths to tasks (default: false)
  -v, --verbose                      show task output even when tasks succeed; by default only failed output is shown
                                     (default: false)
  -h, --help                         display help for command

Any lost modifications can be restored from a git stash:

  > git stash list --format="%h %s"
  h0a0s0h0 On main: lint-staged automatic backup
  > git apply --index h0a0s0h0
```

#### `--allow-empty`

By default, when tasks undo all staged changes, lint-staged will exit with an error and abort the commit. Use this flag to allow creating empty git commits.

#### `--concurrent [number|boolean]`

Controls the [concurrency of tasks](#task-concurrency) being run by lint-staged. **NOTE**: This does NOT affect the concurrency of subtasks (they will always be run sequentially). Possible values are:

- `false`: Run all tasks serially
- `true` (default) : _Infinite_ concurrency. Runs as many tasks in parallel as possible.
- `{number}`: Run the specified number of tasks in parallel, where `1` is equivalent to `false`.

#### `--config [path]`

Manually specify a path to a config file or npm package name. Note: when used, lint-staged won't perform the config file search and will print an error if the specified file cannot be found. If '-' is provided as the filename then the config will be read from stdin, allowing piping in the config like `cat my-config.json | npx lint-staged --config -`.

#### `--cwd [path]`

By default tasks run in the current working directory. Use the `--cwd some/directory` to override this. The path can be absolute or relative to the current working directory.

#### `--debug`

Run in debug mode. When set, it does the following:

- log additional information about staged files, commands being executed, location of binaries, etc.
- uses [`verbose` renderer](https://listr2.kilic.dev/renderers/verbose-renderer/) for `listr2`; this causes serial, uncoloured output to the terminal, instead of the default (beautified, dynamic) output.
  (the [`verbose` renderer](https://listr2.kilic.dev/renderers/verbose-renderer/) can also be activated by setting the `TERM=dumb` or `NODE_ENV=test` environment variables)

#### `--diff`

By default tasks are filtered against all files staged in git, generated from `git diff --staged`. This option allows you to override the `--staged` flag with arbitrary revisions. For example to get a list of changed files between two branches, use `--diff="branch1...branch2"`. You can also read more from about [git diff](https://git-scm.com/docs/git-diff) and [gitrevisions](https://git-scm.com/docs/gitrevisions). This option also implies `--no-stash`.

#### `--diff-filter [string]`

By default only files that are _added_, _copied_, _modified_, or _renamed_ are included. Use this flag to override the default `ACMR` value with something else: _added_ (`A`), _copied_ (`C`), _deleted_ (`D`), _modified_ (`M`), _renamed_ (`R`), _type changed_ (`T`), _unmerged_ (`U`), _unknown_ (`X`), or _pairing broken_ (`B`). See also the `git diff` docs for [--diff-filter](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203).

#### `--continue-on-error`

By default _lint-staged_ will "exit early" when any of the configured tasks fails, to make sure the runtime is short. With this flag, _lint-staged_ will instead run all tasks to completion and only fail at the end, allowing all task output to be seen.

#### `--fail-on-changes`

By default changes made by tasks are automatically staged and added to the commit. This flag disables the behavior and makes _lint-staged_ exit with code 1, failing the commit instead. Using this flag also implies the `--no-revert` flag which means any changes made my tasks will be left in the working tree after failing, so that they can be manually staged and the commit tried again.

#### `--max-arg-length [number]`

long commands (a lot of files) are automatically split into multiple chunks when it detects the current shell cannot handle them. Use this flag to override the maximum length of the generated command string.

#### `--no-stash`

By default a backup stash will be created before running the tasks, and all task modifications will be reverted in case of an error. This option will disable creating the stash, and instead leave all modifications in the index when aborting the commit.

#### `--no-hide-partially-staged`

By default, unstaged changes from partially staged files will be hidden and applied back after running tasks. This option will disable this behavior, causing those changes to also be committed.

#### `--hide-unstaged`

Use this option to 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`.

#### `--quiet`

Suppress all CLI output, except from tasks.

#### `--relative`

Pass filepaths relative to `process.cwd()` (where `lint-staged` runs) to tasks. Default is `false`.

#### `--no-revert`

By default all task modifications will be reverted in case of an error. This option will disable the behavior, and apply task modifications to the index before aborting the commit.

#### `--verbose`

Show task output even when tasks succeed. By default only failed output is shown.

## Configuration

_Lint-staged_ can be configured in many ways:

- `lint-staged` object in your `package.json`, or [`package.yaml`](https://github.com/pnpm/pnpm/pull/1799)
- `.lintstagedrc` file in JSON or YML format, or you can be explicit with the file extension:
  - `.lintstagedrc.json`
  - `.lintstagedrc.yaml`
  - `.lintstagedrc.yml`
- `.lintstagedrc.mjs` or `lint-staged.config.mjs` file in ESM format
  - the default export value should be a configuration: `export default { ... }`
- `.lintstagedrc.cjs` or `lint-staged.config.cjs` file in CommonJS format
  - the exports value should be a configuration: `module.exports = { ... }`
- `lint-staged.config.js` or `.lintstagedrc.js` in either ESM or CommonJS format, depending on
  whether your project's _package.json_ contains the `"type": "module"` option or not.
- Pass a configuration file using the `--config` or `-c` flag

Configuration should be an object where each value is a **command** to run and its key is a glob pattern to use for this command. This package uses [picomatch](https://github.com/micromatch/picomatch) for glob patterns. JavaScript files can also export advanced configuration as a function. See [Using JS configuration files](#using-js-configuration-files) for more info.

You can also place multiple configuration files in different directories inside a project. For a given staged file, the closest configuration file will always be used. See ["How to use `lint-staged` in a multi-package monorepo?"](#how-to-use-lint-staged-in-a-multi-package-monorepo) for more info and an example.

#### `package.json` example:

```json
{
  "lint-staged": {
    "*": "your-cmd"
  }
}
```

#### `.lintstagedrc` example

```json
{
  "*": "your-cmd"
}
```

This config will execute `your-cmd` with the list of currently staged files passed as arguments.

So, considering you did `git add file1.ext file2.ext`, lint-staged will run the following command:

`your-cmd file1.ext file2.ext`

### TypeScript

_Lint-staged_ provides TypeScript types for the configuration and main Node.js API. You can use the JSDoc syntax in your JS configuration files:

```js
/**
 * @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](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
```

### Task concurrency

By default _lint-staged_ will run configured tasks concurrently. This means that for every glob, all the commands will be started at the same time. With the following config, both `eslint` and `prettier` will run at the same time:

```json
{
  "*.ts": "eslint",
  "*.md": "prettier --list-different"
}
```

This is typically not a problem since the globs do not overlap, and the commands do not make changes to the files, but only report possible errors (aborting the git commit). If you want to run multiple commands for the same set of files, you can use the array syntax to make sure commands are run in order. In the following example, `prettier` will run for both globs, and in addition `eslint` will run for `*.ts` files _after_ it. Both sets of commands (for each glob) are still started at the same time (but do not overlap).

```json
{
  "*.ts": ["prettier --list-different", "eslint"],
  "*.md": "prettier --list-different"
}
```

Pay extra attention when the configured globs overlap, and tasks make edits to files. For example, in this configuration `prettier` and `eslint` might try to make changes to the same `*.ts` file at the same time, causing a _race condition_:

```json
{
  "*": "prettier --write",
  "*.ts": "eslint --fix"
}
```

You can solve it using the negation pattern and the array syntax:

```json
{
  "!(*.ts)": "prettier --write",
  "*.ts": ["eslint --fix", "prettier --write"]
}
```

Another example in which tasks make edits to files and globs match multiple files but don't overlap:

```json
{
  "*.css": ["stylelint --fix", "prettier --write"],
  "*.{js,jsx}": ["eslint --fix", "prettier --write"],
  "!(*.css|*.js|*.jsx)": ["prettier --write"]
}
```

Or, if necessary, you can limit the concurrency using `--concurrent <number>` or disable it entirely with `--concurrent false`.

## Filtering files

Task commands work on a subset of all staged files, defined by a _glob pattern_. lint-staged uses [picomatch](https://github.com/micromatch/picomatch) for matching files with the following rules:

- If the glob pattern contains no slashes (`/`), picomatch's `matchBase` option will be enabled, so globs match a file's basename regardless of directory:
  - `"*.js"` will match all JS files, like `/test.js` and `/foo/bar/test.js`
  - `"!(*test).js"` will match all JS files, except those ending in `test.js`, so `foo.js` but not `foo.test.js`
  - `"!(*.css|*.js)"` will match all files except CSS and JS files
- If the glob pattern does contain a slash (`/`), it will match for paths as well:
  - `"./*.js"` will match all JS files in the git repo root, so `/test.js` but not `/foo/bar/test.js`
  - `"foo/**/*.js"` will match all JS files inside the `/foo` directory, so `/foo/bar/test.js` but not `/test.js`

When matching, lint-staged will do the following

- Resolve the git root automatically, no configuration needed.
- Pick the staged files which are present inside the project directory.
- Filter them using the specified glob patterns.
- Pass absolute paths to the tasks as arguments.

**NOTE:** `lint-staged` will pass _absolute_ paths to the tasks to avoid any confusion in case they're executed in a different working directory (i.e. when your `.git` directory isn't the same as your `package.json` directory).

Also see [How to use `lint-staged` in a multi-package monorepo?](#how-to-use-lint-staged-in-a-multi-package-monorepo)

### Ignoring files

The concept of `lint-staged` is to run configured linter tasks (or other tasks) on files that are staged in git. `lint-staged` will always pass a list of all staged files to the task, and ignoring any files should be configured in the task itself.

Consider a project that uses [`prettier`](https://prettier.io/) to keep code format consistent across all files. The project also stores minified 3rd-party vendor libraries in the `vendor/` directory. To keep `prettier` from throwing errors on these files, the vendor directory should be added to prettier's ignore configuration, the `.prettierignore` file. Running `npx prettier .` will ignore the entire vendor directory, throwing no errors. When `lint-staged` is added to the project and configured to run prettier, all modified and staged files in the vendor directory will be ignored by prettier, even though it receives them as input.

In advanced scenarios, where it is impossible to configure the linter task itself to ignore files, but some staged files should still be ignored by `lint-staged`, it is possible to filter filepaths before passing them to tasks by using the function syntax. See [Example: Ignore files from match](#example-ignore-files-from-match).

## What commands are supported?

Supported are any executables installed locally or globally via `npm` as well as any executable from your \$PATH.

> Using globally installed scripts is discouraged, since lint-staged may not work for someone who doesn't have it installed.

`lint-staged` uses [tinyexec](https://github.com/tinylibs/tinyexec) to spawn locally installed commands. So in your `.lintstagedrc` you can write:

```json
{
  "*.js": "eslint --fix"
}
```

This will result in _lint-staged_ running `eslint --fix file-1.js file-2.js`, when you have staged files `file-1.js`, `file-2.js` and `README.md`.

Pass arguments to your commands separated by space as you would do in the shell. See [examples](#examples) below.

## Running multiple commands in a sequence

You can run multiple commands in a sequence on every glob. To do so, pass an array of commands instead of a single one. This is useful for running autoformatting tools like `eslint --fix` or `stylefmt` but can be used for any arbitrary sequences.

For example:

```json
{
  "*.js": ["eslint", "prettier --write"]
}
```

going to execute `eslint` and if it exits with `0` code, it will execute `prettier --write` on all staged `*.js` files.

This will result in _lint-staged_ running `eslint file-1.js file-2.js`, when you have staged files `file-1.js`, `file-2.js` and `README.md`, and if it passes, `prettier --write file-1.js file-2.js`.

## Using JS configuration files

Writing the configuration file in JavaScript is the most powerful way to configure lint-staged (`lint-staged.config.js`, [similar](https://github.com/okonet/lint-staged#configuration), or passed via `--config`). From the configuration file, you can export either a single function or an object.

If the `exports` value is a function, it will receive an array of all staged filenames. You can then build your own matchers for the files and return a command string or an array of command strings. These strings are considered complete and should include the filename arguments, if wanted.

If the `exports` value is an object, its keys should be glob matches (like in the normal non-js config format). The values can either be like in the normal config or individual functions like described above. Instead of receiving all matched files, the functions in the exported object will only receive the staged files matching the corresponding glob key.

To summarize, by default _lint-staged_ automatically adds the list of matched staged files to your command, but when building the command using JS functions it is expected to do this manually. For example:

```js
export default {
  '*.js': (stagedFiles) => [`eslint .`, `prettier --write ${stagedFiles.join(' ')}`],
}
```

This will result in _lint-staged_ first running `eslint .` (matching _all_ files), and if it passes, `prettier --write file-1.js file-2.js`, when you have staged files `file-1.js`, `file-2.js` and `README.md`.

### JavaScript Functions

You can also configure _lint-staged_ to run a JavaScript/Node.js script directly, passing the list of staged files as an argument:

```js
export default {
  '*.js': {
    title: 'Log staged JS files to console',
    task: async (files) => {
      console.log('Staged JS files:', files)
    },
  },
}
```

### Example: Export a function to build your own matchers

<details>
  <summary>Click to expand</summary>

```js
// lint-staged.config.js
import picomatch from 'picomatch'

export default (allStagedFiles) => {
  const shFiles = allStagedFiles.filter((file) => picomatch.isMatch(file, ['**/src/**/*.sh']))
  if (shFiles.length) {
    return `printf '%s\n' "Script files aren't allowed in src directory" >&2`
  }
  const codeFiles = allStagedFiles.filter((file) => picomatch.isMatch(file, ['**/*.js', '**/*.ts']))
  const docFiles = allStagedFiles.filter((file) => picomatch.isMatch(file, ['**/*.md']))
  return [`eslint ${codeFiles.join(' ')}`, `mdl ${docFiles.join(' ')}`]
}
```

</details>

### Example: Wrap filenames in single quotes and run once per file

<details>
  <summary>Click to expand</summary>

```js
// .lintstagedrc.js
export default {
  '**/*.js?(x)': (filenames) => filenames.map((filename) => `prettier --write '${filename}'`),
}
```

</details>

### Example: Run `tsc` on changes to TypeScript files, but do not pass any filename arguments

<details>
  <summary>Click to expand</summary>

```js
// lint-staged.config.js
export default {
  '**/*.ts?(x)': () => 'tsc -p tsconfig.json --noEmit',
}
```

</details>

### Example: Run ESLint on entire repo if more than 10 staged files

<details>
  <summary>Click to expand</summary>

```js
// .lintstagedrc.js
export default {
  '**/*.js?(x)': (filenames) =>
    filenames.length > 10 ? 'eslint .' : `eslint ${filenames.join(' ')}`,
}
```

</details>

### Example: Use your own globs

<details>
  <summary>Click to expand</summary>

It's better to use the [function-based configuration (seen above)](https://github.com/okonet/lint-staged#example-export-a-function-to-build-your-own-matchers), if your use case is this.

```js
// lint-staged.config.js
import picomatch from 'picomatch'

export default {
  '*': (allFiles) => {
    const codeFiles = allFiles.filter((file) => picomatch.isMatch(file, ['**/*.js', '**/*.ts']))
    const docFiles = allFiles.filter((file) => picomatch.isMatch(file, ['**/*.md']))
    return [`eslint ${codeFiles.join(' ')}`, `mdl ${docFiles.join(' ')}`]
  },
}
```

</details>

### Example: Ignore files from match

<details>
  <summary>Click to expand</summary>

If for some reason you want to ignore files from the glob match, you can use `picomatch.isMatch()` with negated pattern(s):

```js
// lint-staged.config.js
import picomatch from 'picomatch'

export default {
  '*.js': (files) => {
    // from `files` filter those _NOT_ matching `*test.js`
    const match = files.filter((file) => picomatch.isMatch(file, '!*test.js'))
    return `eslint ${match.join(' ')}`
  },
}
```

Please note that for most cases, globs can achieve the same effect. For the above example, a matching glob would be `!(*test).js`.

</details>

### Example: Use relative paths for commands

<details>
  <summary>Click to expand</summary>

```js
import path from 'path'

export default {
  '*.ts': (absolutePaths) => {
    const cwd = process.cwd()
    const relativePaths = absolutePaths.map((file) => path.relative(cwd, file))
    return `ng lint myProjectName --files ${relativePaths.join(' ')}`
  },
}
```

</details>

## Reformatting the code

Tools like [Prettier](https://prettier.io), ESLint/TSLint, or stylelint can reformat your code according to an appropriate config by running `prettier --write`/`eslint --fix`/`tslint --fix`/`stylelint --fix`. Lint-staged will automatically add any modifications to the commit as long as there are no errors.

```json
{
  "*.js": "prettier --write"
}
```

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.

## Examples

All examples assume you've already set up lint-staged in the `package.json` file and [husky](https://github.com/typicode/husky) in its own config file.

```json
{
  "name": "My project",
  "version": "0.1.0",
  "scripts": {
    "my-custom-script": "linter --arg1 --arg2"
  },
  "lint-staged": {}
}
```

In `.husky/pre-commit`

```shell
# .husky/pre-commit

npx lint-staged
```

_Note: we don't pass a path as an argument for the runners. This is important since lint-staged will do this for you._

### ESLint with default parameters for `*.js` and `*.jsx` running as a pre-commit hook

<details>
  <summary>Click to expand</summary>

```json
{
  "*.{js,jsx}": "eslint"
}
```

</details>

### Automatically fix code style with `--fix` and add to commit

<details>
  <summary>Click to expand</summary>

```json
{
  "*.js": "eslint --fix"
}
```

This will run `eslint --fix` and automatically add changes to the commit.

</details>

### Reuse npm script

<details>
  <summary>Click to expand</summary>

If you wish to reuse a npm script defined in your package.json:

```json
{
  "*.js": "npm run my-custom-script --"
}
```

The following is equivalent:

```json
{
  "*.js": "linter --arg1 --arg2"
}
```

</details>

### Use environment variables with task commands

<details>
  <summary>Click to expand</summary>

Task commands _do not_ support the shell convention of expanding environment variables. To enable the convention yourself, use a tool like [`cross-env`](https://github.com/kentcdodds/cross-env).

For example, here is `jest` running on all `.js` files with the `NODE_ENV` variable being set to `"test"`:

```json
{
  "*.js": ["cross-env NODE_ENV=test jest --bail --findRelatedTests"]
}
```

</details>

### Automatically fix code style with `prettier` for any format Prettier supports

<details>
  <summary>Click to expand</summary>

```json
{
  "*": "prettier --ignore-unknown --write"
}
```

</details>

### Automatically fix code style with `prettier` for JavaScript, TypeScript, Markdown, HTML, or CSS

<details>
  <summary>Click to expand</summary>

```json
{
  "*.{js,jsx,ts,tsx,md,html,css}": "prettier --write"
}
```

</details>

### Stylelint for CSS with defaults and for SCSS with SCSS syntax

<details>
  <summary>Click to expand</summary>

```json
{
  "*.css": "stylelint",
  "*.scss": "stylelint --syntax=scss"
}
```

</details>

### Run PostCSS sorting and Stylelint to check

<details>
  <summary>Click to expand</summary>

```json
{
  "*.scss": ["postcss --config path/to/your/config --replace", "stylelint"]
}
```

</details>

### Minify the images

<details>
  <summary>Click to expand</summary>

```json
{
  "*.{png,jpeg,jpg,gif,svg}": "imagemin-lint-staged"
}
```

<details>
  <summary>More about <code>imagemin-lint-staged</code></summary>

[imagemin-lint-staged](https://github.com/tomchentw/imagemin-lint-staged) is a CLI tool designed for lint-staged usage with sensible defaults.

See more on [this blog post](https://medium.com/@tomchentw/imagemin-lint-staged-in-place-minify-the-images-before-adding-to-the-git-repo-5acda0b4c57e) for benefits of this approach.

</details>
</details>

### Typecheck your staged files with flow

<details>
  <summary>Click to expand</summary>

```json
{
  "*.{js,jsx}": "flow focus-check"
}
```

</details>

### Integrate with Next.js

<details>
  <summary>Click to expand</summary>

```js
// .lintstagedrc.js
// See https://nextjs.org/docs/basic-features/eslint#lint-staged for details

const path = require('path')

const buildEslintCommand = (filenames) =>
  `next lint --fix --file ${filenames.map((f) => path.relative(process.cwd(), f)).join(' --file ')}`

module.exports = {
  '*.{js,jsx,ts,tsx}': [buildEslintCommand],
}
```

</details>

## Frequently Asked Questions

### The output of commit hook looks weird (no colors, duplicate lines, verbose output on Windows, …)

<details>
  <summary>Click to expand</summary>

Git 2.36.0 introduced a change to hooks where they were no longer run in the original TTY.
This was fixed in 2.37.0:

https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes/2.37.0.txt

> - In Git 2.36 we revamped the way how hooks are invoked. One change
>   that is end-user visible is that the output of a hook is no longer
>   directly connected to the standard output of "git" that spawns the
>   hook, which was noticed post release. This is getting corrected.
>   (merge [a082345372](https://github.com/git/git/commit/a082345372) ab/hooks-regression-fix later to maint).

If updating Git doesn't help, you can try to manually redirect the output in your Git hook; for example:

```shell
# .husky/pre-commit

if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec >/dev/tty 2>&1; fi

npx lint-staged
```

Source: https://github.com/typicode/husky/issues/968#issuecomment-1176848345

</details>

### Can I use `lint-staged` via node?

<details>
  <summary>Click to expand</summary>

Yes!

```js
import lintStaged from 'lint-staged'

try {
  const success = await lintStaged()
  console.log(success ? 'Linting was successful!' : 'Linting failed!')
} catch (e) {
  // Failed to load configuration
  console.error(e)
}
```

Parameters to `lintStaged` are equivalent to their CLI counterparts:

```js
const success = await lintStaged({
  allowEmpty: false,
  concurrent: true,
  configPath: './path/to/configuration/file',
  cwd: process.cwd(),
  debug: false,
  maxArgLength: null,
  quiet: false,
  relative: false,
  stash: true,
  verbose: false,
})
```

You can also pass config directly with `config` option:

```js
const success = await lintStaged({
  allowEmpty: false,
  concurrent: true,
  config: { '*.js': 'eslint --fix' },
  cwd: process.cwd(),
  debug: false,
  maxArgLength: null,
  quiet: false,
  relative: false,
  stash: true,
  verbose: false,
})
```

The `maxArgLength` option configures chunking of tasks into multiple parts that are run one after the other. This is to avoid issues on Windows platforms where the maximum length of the command line argument string is limited to 8192 characters. Lint-staged might generate a very long argument string when there are many staged files. This option is set automatically from the cli, but not via the Node.js API by default.

</details>

### Using with JetBrains IDEs _(WebStorm, PyCharm, IntelliJ IDEA, RubyMine, etc.)_

<details>
  <summary>Click to expand</summary>

_**Update**_: The latest version of JetBrains IDEs now support running hooks as you would expect.

When using the IDE's GUI to commit changes with the `precommit` hook, you might see inconsistencies in the IDE and command line. This is [known issue](https://youtrack.jetbrains.com/issue/IDEA-135454) at JetBrains so if you want this fixed, please vote for it on YouTrack.

Until the issue is resolved in the IDE, you can use the following config to work around it:

husky v1.x

```json
{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged",
      "post-commit": "git update-index --again"
    }
  }
}
```

husky v0.x

```json
{
  "scripts": {
    "precommit": "lint-staged",
    "postcommit": "git update-index --again"
  }
}
```

_Thanks to [this comment](https://youtrack.jetbrains.com/issue/IDEA-135454#comment=27-2710654) for the fix!_

</details>

### How to use `lint-staged` in a multi-package monorepo?

<details>
  <summary>Click to expand</summary>

Install _lint-staged_ on the monorepo root level, and add separate configuration files in each package. When running, _lint-staged_ will always use the configuration closest to a staged file, so having separate configuration files makes sure tasks do not "leak" into other packages.

For example, in a monorepo with `packages/frontend/.lintstagedrc.json` and `packages/backend/.lintstagedrc.json`, a staged file inside `packages/frontend/` will only match that configuration, and not the one in `packages/backend/`.

**Note**: _lint-staged_ discovers the closest configuration to each staged file, even if that configuration doesn't include any matching globs. Given these example configurations:

```js
// ./.lintstagedrc.json
{ "*.md": "prettier --write" }
```

```js
// ./packages/frontend/.lintstagedrc.json
{ "*.js": "eslint --fix" }
```

When committing `./packages/frontend/README.md`, it **will not run** _prettier_, because the configuration in the `frontend/` directory is closer to the file and doesn't include it. You should treat all _lint-staged_ configuration files as isolated and separated from each other. You can always use JS files to "extend" configurations, for example:

```js
import baseConfig from '../.lintstagedrc.js'

export default {
  ...baseConfig,
  '*.js': 'eslint --fix',
}
```

To support backwards-compatibility, monorepo features require multiple _lint-staged_ configuration files present in the git repo. If you still want to run _lint-staged_ in only one of the packages in a monorepo, you can use the `--cwd` option (for example, `lint-staged --cwd packages/frontend`).

</details>

### Can I lint files outside of the current project folder?

<details>
  <summary>Click to expand</summary>

tl;dr: Yes, but the pattern should start with `../`.

By default, `lint-staged` executes tasks only on the files present inside the project folder(where `lint-staged` is installed and run from).
So this question is relevant _only_ when the project folder is a child folder inside the git repo.
In certain project setups, it might be desirable to bypass this restriction. See [#425](https://github.com/okonet/lint-staged/issues/425), [#487](https://github.com/okonet/lint-staged/issues/487) for more context.

`lint-staged` provides an escape hatch for the same(`>= v7.3.0`). For patterns that start with `../`, all the staged files are allowed to match against the pattern.
Note that patterns like `*.js`, `**/*.js` will still only match the project files and not any of the files in parent or sibling directories.

Example repo: [sudo-suhas/lint-staged-django-react-demo](https://github.com/sudo-suhas/lint-staged-django-react-demo).

</details>

### Can I run `lint-staged` in CI, or when there are no staged files?

<details>
  <summary>Click to expand</summary>

Lint-staged will by default run against files staged in git, and should be run during the git pre-commit hook, for example. It's also possible to override this default behaviour and run against files in a specific diff, for example
all changed files between two different branches. If you want to run _lint-staged_ in the CI, maybe you can set it up to compare the branch in a _Pull Request_/_Merge Request_ to the target branch.

Try out the `git diff` command until you are satisfied with the result, for example:

```
git diff --diff-filter=ACMR --name-only main...my-branch
```

This will print a list of _added_, _changed_, _modified_, and _renamed_ files between `main` and `my-branch`.

You can then run lint-staged against the same files with:

```
npx lint-staged --diff="main...my-branch"
```

Note that --diff="main..my-branch" will have files that changed on `main` and are not yet caught up on `my-branch` be detected as changed files.

To see just that changes on the current branch, as compared to `main` you may wish to use:

```
npx lint-staged --diff="$(git merge-base main HEAD)"
```

</details>

### Can I use `lint-staged` with `ng lint`

<details>
  <summary>Click to expand</summary>

You should not use `ng lint` through _lint-staged_, because it's designed to lint an entire project. Instead, you can add `ng lint` to your git pre-commit hook the same way as you would run lint-staged.

See issue [!951](https://github.com/okonet/lint-staged/issues/951) for more details and possible workarounds.

</details>

### How can I ignore files from `.eslintignore`?

<details>
  <summary>Click to expand</summary>

ESLint throws out `warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override` warnings that breaks the linting process ( if you used `--max-warnings=0` which is recommended ).

#### ESLint < 7

<details>
  <summary>Click to expand</summary>

Based on the discussion from [this issue](https://github.com/eslint/eslint/issues/9977), it was decided that using [the outlined script](https://github.com/eslint/eslint/issues/9977#issuecomment-406420893)is the best route to fix this.

So you can setup a `.lintstagedrc.js` config file to do this:

```js
import { CLIEngine } from 'eslint'

export default {
  '*.js': (files) => {
    const cli = new CLIEngine({})
    return 'eslint --max-warnings=0 ' + files.filter((file) => !cli.isPathIgnored(file)).join(' ')
  },
}
```

</details>

#### ESLint >= 7

<details>
  <summary>Click to expand</summary>

In versions of ESLint > 7, [isPathIgnored](https://eslint.org/docs/developer-guide/nodejs-api#-eslintispathignoredfilepath) is an async function and now returns a promise. The code below can be used to reinstate the above functionality.

Since [10.5.3](https://github.com/okonet/lint-staged/releases), any errors due to a bad ESLint config will come through to the console.

```js
import { ESLint } from 'eslint'

const removeIgnoredFiles = async (files) => {
  const eslint = new ESLint()
  const isIgnored = await Promise.all(
    files.map((file) => {
      return eslint.isPathIgnored(file)
    })
  )
  const filteredFiles = files.filter((_, i) => !isIgnored[i])
  return filteredFiles.join(' ')
}

export default {
  '**/*.{ts,tsx,js,jsx}': async (files) => {
    const filesToLint = await removeIgnoredFiles(files)
    return [`eslint --max-warnings=0 ${filesToLint}`]
  },
}
```

</details>

#### ESLint >= 8.51.0 && [Flat ESLint config](https://eslint.org/docs/latest/use/configure/configuration-files-new)

<details>
  <summary>Click to expand</summary>

ESLint v8.51.0 introduced [`--no-warn-ignored` CLI flag](https://eslint.org/docs/latest/use/command-line-interface#--no-warn-ignored). It suppresses the `warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override` warning, so manually ignoring files via `eslint.isPathIgnored` is no longer necessary.

```json
{
  "*.js": "eslint --max-warnings=0 --no-warn-ignored"
}
```

**NOTE:** `--no-warn-ignored` flag is only available when [Flat ESLint config](https://eslint.org/docs/latest/use/configure/configuration-files-new) is used.

</details>

</details>

### How can I resolve TypeScript (`tsc`) ignoring `tsconfig.json` when `lint-staged` runs via Husky hooks?

<details>
  <summary>Click to expand</summary>

When running `lint-staged` via Husky hooks, TypeScript may ignore `tsconfig.json`, leading to errors like:

> **TS17004:** Cannot use JSX unless the '--jsx' flag is provided.
> **TS1056:** Accessors are only available when targeting ECMAScript 5 and higher.

See issue [#825](https://github.com/okonet/lint-staged/issues/825) for more details.

#### Root Cause

1. `lint-staged` automatically passes matched staged files as arguments to commands.
2. Certain input files can cause TypeScript to ignore `tsconfig.json`. For more details, see this TypeScript issue: [Allow tsconfig.json when input files are specified](https://github.com/microsoft/TypeScript/issues/27379).

#### Workaround: Use a [function signature](https://github.com/lint-staged/lint-staged?tab=readme-ov-file#example-run-tsc-on-changes-to-typescript-files-but-do-not-pass-any-filename-arguments) for the `tsc` command

As suggested by @antoinerousseau in [#825 (comment)](https://github.com/lint-staged/lint-staged/issues/825#issuecomment-620018284), using a function prevents `lint-staged` from appending file arguments:

**Before:**

```js
// package.json

"lint-staged": {
    "*.{ts,tsx}":[
      "tsc --noEmit",
      "prettier --write"
    ]
  }
```

**After:**

```js
// lint-staged.config.js
module.exports = {
  '*.{ts,tsx}': [() => 'tsc --noEmit', 'prettier --write'],
}
```

</details>


================================================
FILE: bin/lint-staged.js
================================================
#!/usr/bin/env node

import { userInfo } from 'node:os'

import { Option, program } from 'commander'

import { createDebug, enableDebug } from '../lib/debug.js'
import lintStaged from '../lib/index.js'
import { CONFIG_STDIN_ERROR, restoreStashExample } from '../lib/messages.js'
import { readStdin } from '../lib/readStdin.js'
import { getVersion } from '../lib/version.js'

const debugLog = createDebug('lint-staged:bin')

// Do not terminate main Listr process on SIGINT
process.on('SIGINT', () => {})

program
  .version(await getVersion())

  /**
   * This shouldn't be necessary for lint-staged, but add migration step just in case
   * to preserve old behavior of "commander".
   *
   * @todo remove this in the major version
   * @see https://github.com/tj/commander.js/releases/tag/v13.0.0
   * */
  .allowExcessArguments()

  .addOption(
    new Option('--allow-empty', 'allow empty commits when tasks revert all staged changes').default(
      false
    )
  )
  .addOption(
    new Option(
      '-p, --concurrent <number|boolean>',
      'the number of tasks to run concurrently, or false for serial'
    ).default(true)
  )
  .addOption(
    new Option('-c, --config [path]', 'path to configuration file, or - to read from stdin')
  )
  .addOption(
    new Option('--cwd [path]', 'run all tasks in specific directory, instead of the current')
  )
  .addOption(new Option('-d, --debug', 'print additional debug information').default(false))
  .addOption(
    new Option(
      '--diff [string]',
      'override the default "--staged" flag of "git diff" to get list of files. Implies "--no-stash".'
    ).implies({ stash: false })
  )
  .addOption(
    new Option(
      '--diff-filter [string]',
      'override the default "--diff-filter=ACMR" flag of "git diff" to get list of files'
    )
  )
  .addOption(
    new Option('--continue-on-error', 'run all tasks to completion even if one fails').default(
      false
    )
  )
  .addOption(
    new Option('--fail-on-changes', 'fail with exit code 1 when tasks modify tracked files')
      .default(false)
      .implies({ revert: false })
  )
  .addOption(
    new Option(
      '--max-arg-length [number]',
      'maximum length of the command-line argument string'
    ).default(0)
  )

  /**
   * We don't want to show the `--revert` flag because it's on by default, and only show the
   * negatable flag `--no-rever` instead. There seems to be a bug in Commander.js where
   * configuring only the latter won't actually set the default value.
   */
  .addOption(
    new Option('--revert', 'revert to original state in case of errors').default(true).hideHelp()
  )
  .addOption(
    new Option('--no-revert', 'do not revert to original state in case of errors.').default(false)
  )

  .addOption(new Option('--stash', 'enable the backup stash').default(true).hideHelp())
  .addOption(
    new Option('--no-stash', 'disable the backup stash. Implies "--no-revert".')
      .default(false)
      .implies({ revert: false })
  )

  .addOption(
    new Option('--hide-partially-staged', 'hide unstaged changes from partially staged files')
      .default(true)
      .hideHelp()
  )
  .addOption(
    new Option(
      '--no-hide-partially-staged',
      'disable hiding unstaged changes from partially staged files'
    ).default(false)
  )

  .addOption(
    new Option('--hide-unstaged', 'hide all unstaged changes, instead of just partially staged')
      .default(false)
      .implies({ hidePartiallyStaged: false })
  )

  .addOption(new Option('-q, --quiet', 'disable lint-staged’s own console output').default(false))
  .addOption(new Option('-r, --relative', 'pass relative filepaths to tasks').default(false))
  .addOption(
    new Option(
      '-v, --verbose',
      'show task output even when tasks succeed; by default only failed output is shown'
    ).default(false)
  )

  .addHelpText('afterAll', '\n' + restoreStashExample())

const cliOptions = program.parse(process.argv).opts()

if (cliOptions.debug) {
  enableDebug()
}

const options = {
  allowEmpty: !!cliOptions.allowEmpty,
  concurrent: JSON.parse(cliOptions.concurrent),
  configPath: cliOptions.config,
  continueOnError: !!cliOptions.continueOnError,
  cwd: cliOptions.cwd,
  debug: !!cliOptions.debug,
  diff: cliOptions.diff,
  diffFilter: cliOptions.diffFilter,
  failOnChanges: !!cliOptions.failOnChanges,
  hidePartiallyStaged: !!cliOptions.hidePartiallyStaged, // commander inverts `no-<x>` flags to `!x`
  hideUnstaged: !!cliOptions.hideUnstaged,
  maxArgLength: cliOptions.maxArgLength || undefined,
  quiet: !!cliOptions.quiet,
  relative: !!cliOptions.relative,
  revert: !!cliOptions.revert, // commander inverts `no-<x>` flags to `!x`
  stash: !!cliOptions.stash, // commander inverts `no-<x>` flags to `!x`
  verbose: !!cliOptions.verbose,
}

try {
  const { shell } = userInfo()
  debugLog('Using shell: %s', shell)
} catch {
  debugLog('Could not determine current shell')
}

debugLog('Options parsed from command-line: %o', options)

if (options.configPath === '-') {
  delete options.configPath
  try {
    debugLog('Reading config from stdin')
    options.config = JSON.parse(await readStdin())
  } catch (error) {
    debugLog(CONFIG_STDIN_ERROR, error)
    console.error(CONFIG_STDIN_ERROR)
    process.exit(1)
  }
}

const passed = await lintStaged(options)
if (!passed) {
  process.exitCode = 1
}


================================================
FILE: commitlint.config.js
================================================
/** @type {import('@commitlint/types').UserConfig} */
export default {
  extends: ['@commitlint/config-conventional'],
  ignores: [(commit) => commit.includes('Signed-off-by: dependabot[bot]')],
}


================================================
FILE: eslint.config.js
================================================
import js from '@eslint/js'
import vitest from '@vitest/eslint-plugin'
import eslintConfigPrettier from 'eslint-config-prettier'
import nodeRecommended from 'eslint-plugin-n/configs/recommended-module.js'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import simpleImportSort from 'eslint-plugin-simple-import-sort'

export default [
  {
    ignores: ['coverage', 'node_modules', 'test/unit/__mocks__'],
  },
  js.configs.recommended,
  nodeRecommended,
  eslintConfigPrettier,
  eslintPluginPrettierRecommended,
  {
    plugins: {
      'simple-import-sort': simpleImportSort,
    },
    rules: {
      'n/no-extraneous-import': 'error',
      'n/no-process-exit': 'off',
      'simple-import-sort/imports': 'error',
      'simple-import-sort/exports': 'error',
    },
  },
  {
    files: ['test/**/*.js'],
    plugins: {
      vitest,
    },
    rules: {
      ...vitest.configs.recommended.rules,
      'no-global-assign': 'off',
    },
  },
]


================================================
FILE: lib/chunkFiles.js
================================================
import path from 'node:path'

import { createDebug } from './debug.js'
import { normalizePath } from './normalizePath.js'

const debugLog = createDebug('lint-staged:chunkFiles')

/**
 * Chunk array into sub-arrays
 * @param {Array} arr
 * @param {Number} chunkCount
 * @returns {Array<Array>}
 */
const chunkArray = (arr, chunkCount) => {
  if (chunkCount === 1) return [arr]
  const chunked = []
  let posi
Download .txt
gitextract_965w5l_w/

├── .changeset/
│   ├── README.md
│   ├── chilly-symbols-rhyme.md
│   └── config.json
├── .editorconfig
├── .gitattributes
├── .github/
│   ├── FUNDING.yml
│   ├── issue_template.md
│   ├── pull_request_template.md
│   └── workflows/
│       ├── default-branch-push.yml
│       ├── npm.yml
│       ├── pull-requests.yml
│       ├── security.yml
│       └── tag.yml
├── .gitignore
├── .husky/
│   ├── commit-msg
│   ├── pre-commit
│   └── pre-push
├── .node-version
├── .prettierignore
├── .prettierrc.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── MIGRATION.md
├── README.md
├── bin/
│   └── lint-staged.js
├── commitlint.config.js
├── eslint.config.js
├── lib/
│   ├── chunkFiles.js
│   ├── colors.js
│   ├── configFiles.js
│   ├── debug.js
│   ├── execGit.js
│   ├── figures.js
│   ├── file.js
│   ├── generateTasks.js
│   ├── getAbortController.js
│   ├── getDiffCommand.js
│   ├── getFunctionTask.js
│   ├── getRenderer.js
│   ├── getSpawnedTask.js
│   ├── getSpawnedTasks.js
│   ├── getStagedFiles.js
│   ├── gitWorkflow.js
│   ├── groupFilesByConfig.js
│   ├── index.d.ts
│   ├── index.js
│   ├── killSubprocesses.js
│   ├── loadConfig.js
│   ├── matchFiles.js
│   ├── messages.js
│   ├── normalizePath.js
│   ├── parseGitZOutput.js
│   ├── printTaskOutput.js
│   ├── readStdin.js
│   ├── resolveConfig.js
│   ├── resolveGitRepo.js
│   ├── runAll.js
│   ├── searchConfigs.js
│   ├── state.js
│   ├── symbols.js
│   ├── validateBraces.js
│   ├── validateConfig.js
│   ├── validateOptions.js
│   └── version.js
├── lint-staged.config.js
├── package.json
├── scripts/
│   └── test-node-range.js
├── test/
│   ├── __utils__/
│   │   ├── createTempDir.js
│   │   └── getRepoRootPath.js
│   ├── e2e/
│   │   ├── __utils__/
│   │   │   └── forkLintStagedBin.js
│   │   ├── internal-errors.test.js
│   │   ├── kill-tasks-on-failure.test.js
│   │   ├── no-stash.test.js
│   │   ├── special-characters.test.js
│   │   └── stdin-config.test.js
│   ├── integration/
│   │   ├── __fixtures__/
│   │   │   ├── configs.js
│   │   │   └── files.js
│   │   ├── __utils__/
│   │   │   ├── addConfigFileSerializer.js
│   │   │   ├── isWindows.js
│   │   │   ├── normalizeWindowsNewlines.js
│   │   │   ├── replaceSerializer.js
│   │   │   └── withGitIntegration.js
│   │   ├── allow-empty.test.js
│   │   ├── basic-functionality.test.js
│   │   ├── binary-files.test.js
│   │   ├── continue-on-error.test.js
│   │   ├── diff-options.test.js
│   │   ├── fail-on-changes.test.js
│   │   ├── fail-to-spawn.test.js
│   │   ├── file-resurrection.test.js
│   │   ├── files-outside-cwd.test.js
│   │   ├── git-amend.test.js
│   │   ├── git-lock-file.test.js
│   │   ├── git-submodules.test.js
│   │   ├── git-worktree.test.js
│   │   ├── gitWorkFlow.test.js
│   │   ├── hide-unstaged.test.js
│   │   ├── merge-conflict.test.js
│   │   ├── multiple-config-files.test.js
│   │   ├── no-hide-partially-staged.test.js
│   │   ├── no-initial-commit.test.js
│   │   ├── no-revert.test.js
│   │   ├── no-stash.test.js
│   │   ├── non-ascii.test.js
│   │   ├── not-inside-git-repo.test.js
│   │   ├── parent-globs.test.js
│   │   ├── partially-staged-changes.test.js
│   │   ├── resolveGitRepo.spec.js
│   │   ├── symlink-git-dir.test.js
│   │   ├── symlinked-config.test.js
│   │   ├── symlinked-staged-files.test.js
│   │   └── untracked-files.test.js
│   ├── types/
│   │   └── index.test.ts
│   └── unit/
│       ├── __mocks__/
│       │   ├── advanced-cjs-config.cjs
│       │   ├── advanced-esm-config.js
│       │   ├── cjs/
│       │   │   └── my-config.cjs
│       │   ├── esm-config-in-js.js
│       │   ├── esm-config.mjs
│       │   ├── gitWorkflow.js
│       │   ├── invalid-json-config.json
│       │   ├── invalid-yml-config.yml
│       │   ├── my-config.json
│       │   ├── my-config.yml
│       │   └── my-lint-staged-config/
│       │       ├── index.cjs
│       │       └── package.json
│       ├── __utils__/
│       │   ├── getMockListr2.js
│       │   ├── getMockTinyexec.js
│       │   ├── mockNanoSpawnReturnValue.js
│       │   └── mockTinyexecReturnValue.js
│       ├── chunkFiles.spec.js
│       ├── colors.spec.js
│       ├── debug.spec.js
│       ├── execGit.spec.js
│       ├── file.spec.js
│       ├── generateTasks.spec.js
│       ├── getAbortController.spec.js
│       ├── getBackupStash.spec.js
│       ├── getDiffCommand.spec.js
│       ├── getFunctionTask.spec.js
│       ├── getRenderer.spec.js
│       ├── getSpawnedTask.spec.js
│       ├── getSpawnedTask.unmocked.spec.js
│       ├── getSpawnedTasks.spec.js
│       ├── getStagedFiles.spec.js
│       ├── index.spec.js
│       ├── index2.spec.js
│       ├── index3.spec.js
│       ├── killSubprocesses.spec.js
│       ├── loadConfig.spec.js
│       ├── matchFiles.spec.js
│       ├── normalizePath.spec.js
│       ├── parseGitZOutput.spec.js
│       ├── printTaskOutput.spec.js
│       ├── readStdin.spec.js
│       ├── resolveGitRepo.spec.js
│       ├── runAll.spec.js
│       ├── searchConfigs.spec.js
│       ├── state.spec.js
│       ├── validateBraces.spec.js
│       ├── validateConfig.spec.js
│       └── validateOptions.spec.js
├── tsconfig.json
└── vitest.config.js
Download .txt
SYMBOL INDEX (96 symbols across 24 files)

FILE: lib/colors.js
  constant TRUTHRY_ENV_VAR_VALUES (line 8) | const TRUTHRY_ENV_VAR_VALUES = ['', '1', 'true']
  constant FALSY_ENV_VAR_VALUES (line 14) | const FALSY_ENV_VAR_VALUES = ['0', 'false']
  constant SUPPORTS_COLOR (line 75) | const SUPPORTS_COLOR = supportsAnsiColors()
  constant ANSI_RESET (line 77) | const ANSI_RESET = '\u001B[0m'

FILE: lib/configFiles.js
  constant CONFIG_NAME (line 1) | const CONFIG_NAME = 'lint-staged'
  constant PACKAGE_JSON_FILE (line 3) | const PACKAGE_JSON_FILE = 'package.json'
  constant PACKAGE_YAML_FILES (line 5) | const PACKAGE_YAML_FILES = ['package.yaml', 'package.yml']
  constant CONFIG_FILE_NAMES (line 11) | const CONFIG_FILE_NAMES = [

FILE: lib/execGit.js
  constant GIT_CRLF_WARNING (line 8) | const GIT_CRLF_WARNING = /^warning.*CRLF.*the next time Git touches it/i
  constant NO_SUBMODULE_RECURSE (line 14) | const NO_SUBMODULE_RECURSE = ['-c', 'submodule.recurse=false']
  constant GIT_GLOBAL_OPTIONS (line 17) | const GIT_GLOBAL_OPTIONS = [...NO_SUBMODULE_RECURSE]

FILE: lib/gitWorkflow.js
  constant MERGE_HEAD (line 23) | const MERGE_HEAD = 'MERGE_HEAD'
  constant MERGE_MODE (line 24) | const MERGE_MODE = 'MERGE_MODE'
  constant MERGE_MSG (line 25) | const MERGE_MSG = 'MERGE_MSG'
  constant RENAME (line 30) | const RENAME = /\x00/
  constant STASH (line 49) | const STASH = 'lint-staged automatic backup'
  constant PATCH_UNSTAGED (line 51) | const PATCH_UNSTAGED = 'lint-staged_unstaged.patch'
  constant GIT_DIFF_ARGS (line 53) | const GIT_DIFF_ARGS = [
  constant GIT_APPLY_ARGS (line 63) | const GIT_APPLY_ARGS = ['-v', '--whitespace=nowarn', '--recount', '--uni...
  class GitWorkflow (line 79) | class GitWorkflow {
    method constructor (line 84) | constructor({
    method getHiddenFilepath (line 117) | getHiddenFilepath(filename) {
    method getBackupStash (line 124) | async getBackupStash(ctx) {
    method getDeletedFiles (line 143) | async getDeletedFiles() {
    method backupMergeStatus (line 157) | async backupMergeStatus() {
    method restoreMergeStatus (line 170) | async restoreMergeStatus(ctx) {
    method getUnstagedFiles (line 195) | async getUnstagedFiles({ onlyPartial = false } = {}) {
    method prepare (line 230) | async prepare(ctx, task) {
    method hidePartiallyStagedChanges (line 285) | async hidePartiallyStagedChanges(ctx) {
    method runTasks (line 298) | async runTasks(ctx, task, { listrTasks, concurrent }) {
    method applyModifications (line 315) | async applyModifications(ctx) {
    method restoreUnstagedChanges (line 374) | async restoreUnstagedChanges(ctx) {
    method restoreOriginalState (line 401) | async restoreOriginalState(ctx) {
    method cleanup (line 425) | async cleanup(ctx) {

FILE: lib/index.d.ts
  type SyncGenerateTask (line 1) | type SyncGenerateTask = (stagedFileNames: readonly string[]) => string |...
  type AsyncGenerateTask (line 3) | type AsyncGenerateTask = (stagedFileNames: readonly string[]) => Promise...
  type GenerateTask (line 5) | type GenerateTask = SyncGenerateTask | AsyncGenerateTask
  type TaskFunction (line 7) | type TaskFunction = {
  type Configuration (line 12) | type Configuration =
  type Options (line 16) | type Options = {
  type LogFunction (line 112) | type LogFunction = typeof console.log
  type Logger (line 114) | type Logger = {

FILE: lib/loadConfig.js
  constant NO_EXT (line 50) | const NO_EXT = 'noExt'

FILE: lib/messages.js
  constant NOT_GIT_REPO (line 13) | const NOT_GIT_REPO = red(`${error} Current directory is not a git direct...
  constant FAILED_GET_STAGED_FILES (line 15) | const FAILED_GET_STAGED_FILES = red(`${error} Failed to get staged files!`)
  constant NO_CONFIGURATION (line 23) | const NO_CONFIGURATION = `${error} lint-staged could not find any valid ...
  constant NO_STAGED_FILES (line 25) | const NO_STAGED_FILES = `${info} lint-staged could not find any staged f...
  constant NO_TASKS (line 27) | const NO_TASKS = `${info} lint-staged could not find any staged files ma...
  constant SKIPPING_HIDE_PARTIALLY_CHANGED (line 39) | const SKIPPING_HIDE_PARTIALLY_CHANGED = yellow(
  constant DEPRECATED_GIT_ADD (line 43) | const DEPRECATED_GIT_ADD = yellow(
  constant TASK_ERROR (line 48) | const TASK_ERROR = 'Skipped because of errors from tasks.'
  constant PREVENTED_TASK_MODIFICATIONS (line 50) | const PREVENTED_TASK_MODIFICATIONS = `\n${error} lint-staged failed beca...
  constant SKIPPED_GIT_ERROR (line 52) | const SKIPPED_GIT_ERROR = 'Skipped because of previous git error.'
  constant GIT_ERROR (line 54) | const GIT_ERROR = `\n  ${red(`${error} lint-staged failed due to a git e...
  constant PREVENTED_EMPTY_COMMIT (line 64) | const PREVENTED_EMPTY_COMMIT = `
  constant CONFIG_STDIN_ERROR (line 77) | const CONFIG_STDIN_ERROR = red(`${error} Failed to read config from stdi...
  constant UNSTAGED_CHANGES_BACKUP_STASH_LOCATION (line 91) | const UNSTAGED_CHANGES_BACKUP_STASH_LOCATION = `Unstaged changes have be...

FILE: lib/normalizePath.js
  constant WIN32_FILE_NS (line 19) | const WIN32_FILE_NS = '\\\\?\\'
  constant WIN32_DEVICE_NS (line 25) | const WIN32_DEVICE_NS = '\\\\.\\'

FILE: lib/resolveConfig.js
  function resolveConfig (line 9) | function resolveConfig(configPath) {

FILE: lib/resolveGitRepo.js
  constant CDUP (line 13) | const CDUP = '--show-cdup'
  constant TOPLEVEL (line 27) | const TOPLEVEL = '--show-toplevel'
  constant ABSOLUTE_GIT_DIR (line 34) | const ABSOLUTE_GIT_DIR = '--absolute-git-dir'

FILE: lib/searchConfigs.js
  constant EXEC_GIT (line 16) | const EXEC_GIT = ['ls-files', '-z', '--full-name', '-t']
  constant CONFIG_PATHSPEC (line 18) | const CONFIG_PATHSPEC = CONFIG_FILE_NAMES.map((f) => `:(glob)**/${f}`)

FILE: lib/validateBraces.js
  constant DOUBLE_BRACES_REGEXP (line 60) | const DOUBLE_BRACES_REGEXP = /{{[^}{]*}}/

FILE: test/__utils__/getRepoRootPath.js
  constant THIS_FILE_DIR (line 4) | const THIS_FILE_DIR = path.dirname(fileURLToPath(import.meta.url))

FILE: test/integration/git-amend.test.js
  constant MD_CONFIG (line 6) | const MD_CONFIG = JSON.stringify({ '*.md': 'prettier --write' })

FILE: test/integration/no-revert.test.js
  constant UGLY_FILE (line 5) | const UGLY_FILE = `console.log('Hello, world!', unreferencedVariable)`
  constant PRETTY_FILE (line 7) | const PRETTY_FILE = `console.log("Hello, world!", unreferencedVariable);

FILE: test/integration/resolveGitRepo.spec.js
  constant REPO_ROOT (line 11) | const REPO_ROOT = normalizePath(path.join(__dirname, '../../'))

FILE: test/unit/__utils__/mockNanoSpawnReturnValue.js
  constant MOCK_DEFAULT_VALUE (line 1) | const MOCK_DEFAULT_VALUE = {

FILE: test/unit/__utils__/mockTinyexecReturnValue.js
  constant MOCK_DEFAULT_VALUE (line 1) | const MOCK_DEFAULT_VALUE = {

FILE: test/unit/execGit.spec.js
  method [Symbol.asyncIterator] (line 10) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 40) | async *[Symbol.asyncIterator]() {

FILE: test/unit/getSpawnedTask.spec.js
  method [Symbol.asyncIterator] (line 11) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 133) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 150) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 172) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 187) | async *[Symbol.asyncIterator]() {}
  method [Symbol.asyncIterator] (line 201) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 224) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 247) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 261) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 283) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 310) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 334) | async *[Symbol.asyncIterator]() {

FILE: test/unit/getSpawnedTasks.spec.js
  method [Symbol.asyncIterator] (line 9) | async *[Symbol.asyncIterator]() {

FILE: test/unit/index2.spec.js
  constant MOCK_STAGED_FILE (line 8) | const MOCK_STAGED_FILE = path.join(getRepoRootPath(), 'test/__mocks__/sa...

FILE: test/unit/matchFiles.spec.js
  constant STAGED_FILES (line 5) | const STAGED_FILES = [
  constant PATTERNS (line 71) | const PATTERNS = [

FILE: test/unit/runAll.spec.js
  method [Symbol.asyncIterator] (line 13) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 208) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 458) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 466) | async *[Symbol.asyncIterator]() {
  method [Symbol.asyncIterator] (line 473) | async *[Symbol.asyncIterator]() {
Condensed preview — 164 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (557K chars).
[
  {
    "path": ".changeset/README.md",
    "chars": 510,
    "preview": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that wo"
  },
  {
    "path": ".changeset/chilly-symbols-rhyme.md",
    "chars": 8,
    "preview": "---\n---\n"
  },
  {
    "path": ".changeset/config.json",
    "chars": 203,
    "preview": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@2.3.1/schema.json\",\n  \"changelog\": [\"@changesets/changelog-github\","
  },
  {
    "path": ".editorconfig",
    "chars": 241,
    "preview": "# https://editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_t"
  },
  {
    "path": ".gitattributes",
    "chars": 19,
    "preview": "* text=auto eol=lf\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 649,
    "preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
  },
  {
    "path": ".github/issue_template.md",
    "chars": 1056,
    "preview": "### Description\n\n<!--\nIf this is a feature request, explain why it should be added. Specific\nuse-cases are best.\n\nIf thi"
  },
  {
    "path": ".github/pull_request_template.md",
    "chars": 723,
    "preview": "**Do not open Pull Requests unless they have been agreed to with the maintainer!**  \n**Otherwise they might be ignored o"
  },
  {
    "path": ".github/workflows/default-branch-push.yml",
    "chars": 1233,
    "preview": "name: Default Branch Push\n\non:\n  push:\n    branches:\n      - main\n    # Do not run on tags\n    tags-ignore:\n      - '*'\n"
  },
  {
    "path": ".github/workflows/npm.yml",
    "chars": 821,
    "preview": "name: Npm\n\non:\n  workflow_call:\n\npermissions:\n  contents: read\n\njobs:\n  Install:\n    name: Install Dependencies\n    runs"
  },
  {
    "path": ".github/workflows/pull-requests.yml",
    "chars": 6454,
    "preview": "name: Pull Requests\n\non:\n  pull_request:\n    branches:\n      - main\n\npermissions:\n  contents: read\n\njobs:\n  npm:\n    use"
  },
  {
    "path": ".github/workflows/security.yml",
    "chars": 646,
    "preview": "name: Security Analysis\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n  schedule:\n "
  },
  {
    "path": ".github/workflows/tag.yml",
    "chars": 500,
    "preview": "name: Publish\n\non:\n  push:\n    tags:\n      # Semver-like tags \"v1.0.0\", or \"v.0.0.1-beta.1\"\n      - 'v[0-9]+.[0-9]+.[0-9"
  },
  {
    "path": ".gitignore",
    "chars": 625,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\n# Runtime data\npids\n*.pid\n*.seed\n# Directory for instrumented libs generated by jscover"
  },
  {
    "path": ".husky/commit-msg",
    "chars": 23,
    "preview": "commitlint --edit ${1}\n"
  },
  {
    "path": ".husky/pre-commit",
    "chars": 24,
    "preview": "node bin/lint-staged.js\n"
  },
  {
    "path": ".husky/pre-push",
    "chars": 30,
    "preview": "changeset status --since=main\n"
  },
  {
    "path": ".node-version",
    "chars": 3,
    "preview": "24\n"
  },
  {
    "path": ".prettierignore",
    "chars": 20,
    "preview": "test/unit/__mocks__\n"
  },
  {
    "path": ".prettierrc.json",
    "chars": 90,
    "preview": "{\n  \"printWidth\": 100,\n  \"singleQuote\": true,\n  \"semi\": false,\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 128585,
    "preview": "# lint-staged\n\n## 16.4.0\n\n### Minor Changes\n\n- [#1739](https://github.com/lint-staged/lint-staged/pull/1739) [`687fc90`]"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 530,
    "preview": "# Contributing\n\nBug reports are welcome. New feature requests are probably not going to be implemented because _lint-sta"
  },
  {
    "path": "LICENSE",
    "chars": 1087,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Andrey Okonetchnikov\n\nPermission is hereby granted, free of charge, to any per"
  },
  {
    "path": "MIGRATION.md",
    "chars": 3306,
    "preview": "## v16\n\n#### Updated Node.js version requirement\n\nFor version `lint-staged@16.0.0` the lowest supported Node.js version "
  },
  {
    "path": "README.md",
    "chars": 41999,
    "preview": "# 🚫💩 lint-staged\n\n[![npm version](https://badge.fury.io/js/lint-staged.svg)](https://badge.fury.io/js/lint-staged)\n\n---\n"
  },
  {
    "path": "bin/lint-staged.js",
    "chars": 5365,
    "preview": "#!/usr/bin/env node\n\nimport { userInfo } from 'node:os'\n\nimport { Option, program } from 'commander'\n\nimport { createDeb"
  },
  {
    "path": "commitlint.config.js",
    "chars": 197,
    "preview": "/** @type {import('@commitlint/types').UserConfig} */\nexport default {\n  extends: ['@commitlint/config-conventional'],\n "
  },
  {
    "path": "eslint.config.js",
    "chars": 981,
    "preview": "import js from '@eslint/js'\nimport vitest from '@vitest/eslint-plugin'\nimport eslintConfigPrettier from 'eslint-config-p"
  },
  {
    "path": "lib/chunkFiles.js",
    "chars": 2290,
    "preview": "import path from 'node:path'\n\nimport { createDebug } from './debug.js'\nimport { normalizePath } from './normalizePath.js"
  },
  {
    "path": "lib/colors.js",
    "chars": 2846,
    "preview": "import nodeTty from 'node:tty'\n\n/**\n * @example NO_COLOR\n * @example NO_COLOR=1\n * @example NO_COLOR=true\n */\nconst TRUT"
  },
  {
    "path": "lib/configFiles.js",
    "chars": 732,
    "preview": "export const CONFIG_NAME = 'lint-staged'\n\nexport const PACKAGE_JSON_FILE = 'package.json'\n\nexport const PACKAGE_YAML_FIL"
  },
  {
    "path": "lib/debug.js",
    "chars": 683,
    "preview": "import { formatWithOptions } from 'node:util'\n\nimport { blackBright, SUPPORTS_COLOR } from './colors.js'\n\nconst format ="
  },
  {
    "path": "lib/execGit.js",
    "chars": 1303,
    "preview": "import { exec } from 'tinyexec'\n\nimport { createDebug } from './debug.js'\n\nconst debugLog = createDebug('lint-staged:exe"
  },
  {
    "path": "lib/figures.js",
    "chars": 217,
    "preview": "import { figures } from 'listr2'\n\nimport { blue, red, yellow } from './colors.js'\n\nexport const info = blue(figures.arro"
  },
  {
    "path": "lib/file.js",
    "chars": 1385,
    "preview": "import fs from 'node:fs/promises'\n\nimport { createDebug } from './debug.js'\n\nconst debugLog = createDebug('lint-staged:f"
  },
  {
    "path": "lib/generateTasks.js",
    "chars": 1671,
    "preview": "import path from 'node:path'\n\nimport { createDebug } from './debug.js'\nimport { matchFiles } from './matchFiles.js'\nimpo"
  },
  {
    "path": "lib/getAbortController.js",
    "chars": 411,
    "preview": "export const Signal = {\n  SIGINT: 'SIGINT',\n  SIGKILL: 'SIGKILL',\n}\n\n/**\n * Get an AbortController used to cancel runnin"
  },
  {
    "path": "lib/getDiffCommand.js",
    "chars": 747,
    "preview": "/** @type {(diff?: string, diffFilter?: string) => string[]} */\nexport const getDiffCommand = (diff, diffFilter) => {\n  "
  },
  {
    "path": "lib/getFunctionTask.js",
    "chars": 1073,
    "preview": "import { createDebug } from './debug.js'\nimport { createTaskError } from './getSpawnedTask.js'\n\nconst debugLog = createD"
  },
  {
    "path": "lib/getRenderer.js",
    "chars": 1406,
    "preview": "import { EOL } from 'node:os'\nimport { Writable } from 'node:stream'\n\nimport { ListrLogger, ProcessOutput } from 'listr2"
  },
  {
    "path": "lib/getSpawnedTask.js",
    "chars": 4900,
    "preview": "import { parseArgsStringToArgv } from 'string-argv'\nimport { exec } from 'tinyexec'\n\nimport { blackBright, red } from '."
  },
  {
    "path": "lib/getSpawnedTasks.js",
    "chars": 2260,
    "preview": "import { createDebug } from './debug.js'\nimport { getSpawnedTask } from './getSpawnedTask.js'\nimport { configurationErro"
  },
  {
    "path": "lib/getStagedFiles.js",
    "chars": 2927,
    "preview": "import path from 'node:path'\n\nimport { execGit } from './execGit.js'\nimport { getDiffCommand } from './getDiffCommand.js"
  },
  {
    "path": "lib/gitWorkflow.js",
    "chars": 15613,
    "preview": "import crypto from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { createDebug } "
  },
  {
    "path": "lib/groupFilesByConfig.js",
    "chars": 2132,
    "preview": "import path from 'node:path'\n\nimport { createDebug } from './debug.js'\n\nconst debugLog = createDebug('lint-staged:groupF"
  },
  {
    "path": "lib/index.d.ts",
    "chars": 3351,
    "preview": "type SyncGenerateTask = (stagedFileNames: readonly string[]) => string | string[]\n\ntype AsyncGenerateTask = (stagedFileN"
  },
  {
    "path": "lib/index.js",
    "chars": 6418,
    "preview": "import { SUPPORTS_COLOR } from './colors.js'\nimport { createDebug, enableDebug } from './debug.js'\nimport { execGit } fr"
  },
  {
    "path": "lib/killSubprocesses.js",
    "chars": 994,
    "preview": "import { exec } from 'node:child_process'\nimport { promisify } from 'node:util'\n\nconst execAsync = promisify(exec)\n\n/**\n"
  },
  {
    "path": "lib/loadConfig.js",
    "chars": 3010,
    "preview": "/** @typedef {import('./index').Logger} Logger */\n\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport"
  },
  {
    "path": "lib/matchFiles.js",
    "chars": 656,
    "preview": "import picomatch from 'picomatch'\n\n/**\n * Match list of files against a pattern.\n *\n * @param {string} pattern\n * @param"
  },
  {
    "path": "lib/messages.js",
    "chars": 3211,
    "preview": "import { inspect } from 'node:util'\n\nimport { bold, red, yellow } from './colors.js'\nimport { error, info, warning } fro"
  },
  {
    "path": "lib/normalizePath.js",
    "chars": 1346,
    "preview": "/**\n * Reimplementation of \"normalize-path\"\n * @see https://github.com/jonschlinkert/normalize-path/blob/52c3a95ebebc2d9"
  },
  {
    "path": "lib/parseGitZOutput.js",
    "chars": 384,
    "preview": "/**\n * Return array of strings split from the output of `git <something> -z`.\n * With `-z`, git prints `fileA\\u0000fileB"
  },
  {
    "path": "lib/printTaskOutput.js",
    "chars": 376,
    "preview": "/**\n * Handle logging of listr `ctx.output` to the specified `logger`\n * @param {Object} ctx - The listr initial state\n "
  },
  {
    "path": "lib/readStdin.js",
    "chars": 479,
    "preview": "import { createInterface } from 'node:readline'\n\n/**\n * Returns a promise resolving to the first line written to stdin a"
  },
  {
    "path": "lib/resolveConfig.js",
    "chars": 387,
    "preview": "import { createRequire } from 'node:module'\n\n/**\n * require() does not exist for ESM, so we must create it to use requir"
  },
  {
    "path": "lib/resolveGitRepo.js",
    "chars": 2263,
    "preview": "import path from 'node:path'\n\nimport { createDebug } from './debug.js'\nimport { execGit } from './execGit.js'\nimport { n"
  },
  {
    "path": "lib/runAll.js",
    "chars": 13125,
    "preview": "/** @typedef {import('./index').Logger} Logger */\n\nimport path from 'node:path'\n\nimport { Listr } from 'listr2'\n\nimport "
  },
  {
    "path": "lib/searchConfigs.js",
    "chars": 5793,
    "preview": "/** @typedef {import('./index').Logger} Logger */\n\nimport fs, { constants } from 'node:fs/promises'\nimport path from 'no"
  },
  {
    "path": "lib/state.js",
    "chars": 2727,
    "preview": "import { GIT_ERROR, TASK_ERROR } from './messages.js'\nimport {\n  FailOnChangesError,\n  GitError,\n  RestoreOriginalStateE"
  },
  {
    "path": "lib/symbols.js",
    "chars": 1039,
    "preview": "export const ApplyEmptyCommitError = Symbol('ApplyEmptyCommitError')\n\nexport const ConfigNotFoundError = new Error('Conf"
  },
  {
    "path": "lib/validateBraces.js",
    "chars": 3245,
    "preview": "import { incorrectBraces } from './messages.js'\n\n/**\n * A correctly-formed brace expansion must contain unquoted opening"
  },
  {
    "path": "lib/validateConfig.js",
    "chars": 3336,
    "preview": "/** @typedef {import('./index').Logger} Logger */\n\nimport { inspect } from 'node:util'\n\nimport { createDebug } from './d"
  },
  {
    "path": "lib/validateOptions.js",
    "chars": 1081,
    "preview": "import { constants } from 'node:fs'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { createDebug"
  },
  {
    "path": "lib/version.js",
    "chars": 203,
    "preview": "import fs from 'node:fs/promises'\n\nexport const getVersion = async () => {\n  const packageJson = JSON.parse(await fs.rea"
  },
  {
    "path": "lint-staged.config.js",
    "chars": 153,
    "preview": "/** @type {import('./lib/index.js').Configuration} */\nexport default {\n  '*.js': 'eslint',\n  '*.{json,md}': 'prettier --"
  },
  {
    "path": "package.json",
    "chars": 2259,
    "preview": "{\n  \"name\": \"lint-staged\",\n  \"version\": \"16.4.0\",\n  \"description\": \"Lint files staged by git\",\n  \"license\": \"MIT\",\n  \"re"
  },
  {
    "path": "scripts/test-node-range.js",
    "chars": 1558,
    "preview": "import { readFile } from 'node:fs/promises'\nimport { fileURLToPath } from 'node:url'\n\nimport { subset } from 'semver'\nim"
  },
  {
    "path": "test/__utils__/createTempDir.js",
    "chars": 599,
    "preview": "import crypto from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'"
  },
  {
    "path": "test/__utils__/getRepoRootPath.js",
    "chars": 267,
    "preview": "import path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst THIS_FILE_DIR = path.dirname(fileURLToPath("
  },
  {
    "path": "test/e2e/__utils__/forkLintStagedBin.js",
    "chars": 845,
    "preview": "import { fork } from 'node:child_process'\nimport path from 'node:path'\n\nimport { getRepoRootPath } from '../../__utils__"
  },
  {
    "path": "test/e2e/internal-errors.test.js",
    "chars": 1051,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as fileFixtures from '../integration/__fixtures__/files.js'\nimport { w"
  },
  {
    "path": "test/e2e/kill-tasks-on-failure.test.js",
    "chars": 995,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as fileFixtures from '../integration/__fixtures__/files.js'\nimport { w"
  },
  {
    "path": "test/e2e/no-stash.test.js",
    "chars": 2730,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from '../integration/__fixtures__/configs.js'\nimport"
  },
  {
    "path": "test/e2e/special-characters.test.js",
    "chars": 1203,
    "preview": "import path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { getRepoRootPath } from '../__utils__/get"
  },
  {
    "path": "test/e2e/stdin-config.test.js",
    "chars": 2269,
    "preview": "import { fork } from 'node:child_process'\n\nimport { describe, test } from 'vitest'\n\nimport * as configFixtures from '../"
  },
  {
    "path": "test/integration/__fixtures__/configs.js",
    "chars": 138,
    "preview": "export const prettierListDifferent = { '*.js': 'prettier --list-different' }\n\nexport const prettierWrite = { '*.js': 'pr"
  },
  {
    "path": "test/integration/__fixtures__/files.js",
    "chars": 368,
    "preview": "export const prettyJS = `module.exports = {\n  foo: \"bar\",\n};\n`\n\nexport const prettyJSWithChanges = `module.exports = {\n "
  },
  {
    "path": "test/integration/__utils__/addConfigFileSerializer.js",
    "chars": 875,
    "preview": "import { stripVTControlCharacters } from 'node:util'\n\nimport { expect } from 'vitest'\n\nimport { replaceSerializer } from"
  },
  {
    "path": "test/integration/__utils__/isWindows.js",
    "chars": 236,
    "preview": "/** Whether the current environment is a GitHub Actions runner under Windows */\nexport const isWindowsActions = () => {\n"
  },
  {
    "path": "test/integration/__utils__/normalizeWindowsNewlines.js",
    "chars": 138,
    "preview": "/** Replace Windows `\\r\\n` newlines with `\\n` */\nexport const normalizeWindowsNewlines = (input) => input.replace(/(\\r\\n"
  },
  {
    "path": "test/integration/__utils__/replaceSerializer.js",
    "chars": 154,
    "preview": "export const replaceSerializer = (from, to) => ({\n  test: (val) => typeof val === 'string' && from.test(val),\n  print: ("
  },
  {
    "path": "test/integration/__utils__/withGitIntegration.js",
    "chars": 5623,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport makeConsoleMock from 'consolemock'\n\nimport { exec"
  },
  {
    "path": "test/integration/allow-empty.test.js",
    "chars": 3176,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport * as fileFix"
  },
  {
    "path": "test/integration/basic-functionality.test.js",
    "chars": 8352,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport * as con"
  },
  {
    "path": "test/integration/binary-files.test.js",
    "chars": 1069,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport { withGitInt"
  },
  {
    "path": "test/integration/continue-on-error.test.js",
    "chars": 4968,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as fileFixtures from './__fixtures__/files.js'\nimport { addConfigFileS"
  },
  {
    "path": "test/integration/diff-options.test.js",
    "chars": 5118,
    "preview": "import makeConsoleMock from 'consolemock'\nimport { describe, test } from 'vitest'\n\nimport lintStaged from '../../lib/ind"
  },
  {
    "path": "test/integration/fail-on-changes.test.js",
    "chars": 4788,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport * as fileFix"
  },
  {
    "path": "test/integration/fail-to-spawn.test.js",
    "chars": 841,
    "preview": "import { describe, test } from 'vitest'\n\nimport { addConfigFileSerializer } from './__utils__/addConfigFileSerializer.js"
  },
  {
    "path": "test/integration/file-resurrection.test.js",
    "chars": 3256,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { pretti"
  },
  {
    "path": "test/integration/files-outside-cwd.test.js",
    "chars": 1646,
    "preview": "import path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { prettierWrite } from './__fixtures__/con"
  },
  {
    "path": "test/integration/git-amend.test.js",
    "chars": 2441,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as fileFixtures from './__fixtures__/files.js'\nimport { withGitIntegra"
  },
  {
    "path": "test/integration/git-lock-file.test.js",
    "chars": 2835,
    "preview": "import path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { prettyJS, uglyJS } from './__fixtures__/"
  },
  {
    "path": "test/integration/git-submodules.test.js",
    "chars": 3222,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { pretty"
  },
  {
    "path": "test/integration/git-worktree.test.js",
    "chars": 1356,
    "preview": "import path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { prettierListDifferent } from './__fixtur"
  },
  {
    "path": "test/integration/gitWorkFlow.test.js",
    "chars": 7367,
    "preview": "import path from 'node:path'\n\nimport { describe, it, vi } from 'vitest'\n\nimport { writeFile } from '../../lib/file.js'\ni"
  },
  {
    "path": "test/integration/hide-unstaged.test.js",
    "chars": 1697,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport * as fileFix"
  },
  {
    "path": "test/integration/merge-conflict.test.js",
    "chars": 11413,
    "preview": "import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { prettierListDif"
  },
  {
    "path": "test/integration/multiple-config-files.test.js",
    "chars": 6105,
    "preview": "import path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { normalizePath } from '../../lib/normaliz"
  },
  {
    "path": "test/integration/no-hide-partially-staged.test.js",
    "chars": 1371,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport * as fileFix"
  },
  {
    "path": "test/integration/no-initial-commit.test.js",
    "chars": 1482,
    "preview": "import { describe, test } from 'vitest'\n\nimport { prettierListDifferent } from './__fixtures__/configs.js'\nimport { pret"
  },
  {
    "path": "test/integration/no-revert.test.js",
    "chars": 1487,
    "preview": "import { describe, test } from 'vitest'\n\nimport { withGitIntegration } from './__utils__/withGitIntegration.js'\n\nconst U"
  },
  {
    "path": "test/integration/no-stash.test.js",
    "chars": 6074,
    "preview": "import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport * as configFixtur"
  },
  {
    "path": "test/integration/non-ascii.test.js",
    "chars": 1971,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport * as fileFix"
  },
  {
    "path": "test/integration/not-inside-git-repo.test.js",
    "chars": 1103,
    "preview": "import fs from 'node:fs/promises'\n\nimport makeConsoleMock from 'consolemock'\nimport { describe, test } from 'vitest'\n\nim"
  },
  {
    "path": "test/integration/parent-globs.test.js",
    "chars": 1882,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { withGi"
  },
  {
    "path": "test/integration/partially-staged-changes.test.js",
    "chars": 5800,
    "preview": "import { describe, test } from 'vitest'\n\nimport * as configFixtures from './__fixtures__/configs.js'\nimport * as fileFix"
  },
  {
    "path": "test/integration/resolveGitRepo.spec.js",
    "chars": 1524,
    "preview": "import { spawnSync } from 'node:child_process'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nim"
  },
  {
    "path": "test/integration/symlink-git-dir.test.js",
    "chars": 1279,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { pretti"
  },
  {
    "path": "test/integration/symlinked-config.test.js",
    "chars": 900,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport { pretti"
  },
  {
    "path": "test/integration/symlinked-staged-files.test.js",
    "chars": 1309,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { describe, test } from 'vitest'\n\nimport * as con"
  },
  {
    "path": "test/integration/untracked-files.test.js",
    "chars": 2625,
    "preview": "import { describe, test } from 'vitest'\n\nimport { prettierListDifferent } from './__fixtures__/configs.js'\nimport * as f"
  },
  {
    "path": "test/types/index.test.ts",
    "chars": 2055,
    "preview": "import { test, expectTypeOf, expect } from 'vitest'\n\nimport lintStaged, { type Configuration, type Options, Logger } fro"
  },
  {
    "path": "test/unit/__mocks__/advanced-cjs-config.cjs",
    "chars": 152,
    "preview": "module.exports = {\n  '*.css': (filenames) => `echo ${filenames.join(' ')}`,\n  '*.js': (filenames) => filenames.map((file"
  },
  {
    "path": "test/unit/__mocks__/advanced-esm-config.js",
    "chars": 150,
    "preview": "export default {\n  '*.css': (filenames) => `echo ${filenames.join(' ')}`,\n  '*.js': (filenames) => filenames.map((filena"
  },
  {
    "path": "test/unit/__mocks__/cjs/my-config.cjs",
    "chars": 38,
    "preview": "module.exports = {\n  '*': 'mytask',\n}\n"
  },
  {
    "path": "test/unit/__mocks__/esm-config-in-js.js",
    "chars": 36,
    "preview": "export default {\n  '*': 'mytask',\n}\n"
  },
  {
    "path": "test/unit/__mocks__/esm-config.mjs",
    "chars": 36,
    "preview": "export default {\n  '*': 'mytask',\n}\n"
  },
  {
    "path": "test/unit/__mocks__/gitWorkflow.js",
    "chars": 493,
    "preview": "const stub = {\n  prepare: jest.fn().mockImplementation(() => Promise.resolve()),\n  hideUnstagedChanges: jest.fn().mockIm"
  },
  {
    "path": "test/unit/__mocks__/invalid-json-config.json",
    "chars": 1,
    "preview": "{"
  },
  {
    "path": "test/unit/__mocks__/invalid-yml-config.yml",
    "chars": 1,
    "preview": "{"
  },
  {
    "path": "test/unit/__mocks__/my-config.json",
    "chars": 20,
    "preview": "{\n  \"*\": \"mytask\"\n}\n"
  },
  {
    "path": "test/unit/__mocks__/my-config.yml",
    "chars": 14,
    "preview": "'*': 'mytask'\n"
  },
  {
    "path": "test/unit/__mocks__/my-lint-staged-config/index.cjs",
    "chars": 38,
    "preview": "module.exports = {\n  '*': 'mytask',\n}\n"
  },
  {
    "path": "test/unit/__mocks__/my-lint-staged-config/package.json",
    "chars": 107,
    "preview": "{\n  \"name\": \"my-lint-staged-config\",\n  \"version\": \"0.0.0\",\n  \"type\": \"commonjs\",\n  \"main\": \"./index.cjs\"\n}\n"
  },
  {
    "path": "test/unit/__utils__/getMockListr2.js",
    "chars": 329,
    "preview": "import { figures } from 'listr2'\nimport { vi } from 'vitest'\n\nexport const getMockListr2 = async () => {\n  const mockRun"
  },
  {
    "path": "test/unit/__utils__/getMockTinyexec.js",
    "chars": 450,
    "preview": "import { vi } from 'vitest'\n\nimport { mockTinyexecReturnValue } from './mockTinyexecReturnValue.js'\n\n/**\n * @returns {Pr"
  },
  {
    "path": "test/unit/__utils__/mockNanoSpawnReturnValue.js",
    "chars": 794,
    "preview": "const MOCK_DEFAULT_VALUE = {\n  output: 'a-ok',\n  nodeChildProcess: { pid: 0 },\n  cmd: 'mock cmd',\n}\n\nexport const mockNa"
  },
  {
    "path": "test/unit/__utils__/mockTinyexecReturnValue.js",
    "chars": 707,
    "preview": "const MOCK_DEFAULT_VALUE = {\n  stdout: 'a-ok',\n  stderr: '',\n  pid: 0,\n  cmd: 'mock cmd',\n}\n\nexport const mockTinyexecRe"
  },
  {
    "path": "test/unit/chunkFiles.spec.js",
    "chars": 2275,
    "preview": "import path from 'node:path'\n\nimport { describe, it } from 'vitest'\n\nimport { chunkFiles } from '../../lib/chunkFiles.js"
  },
  {
    "path": "test/unit/colors.spec.js",
    "chars": 1752,
    "preview": "import { describe, it } from 'vitest'\n\nimport { supportsAnsiColors, wrapAnsiColor } from '../../lib/colors.js'\n\ndescribe"
  },
  {
    "path": "test/unit/debug.spec.js",
    "chars": 741,
    "preview": "import makeConsoleMock from 'consolemock'\nimport { describe, expect, it, suite, vi } from 'vitest'\n\nsuite('debug', async"
  },
  {
    "path": "test/unit/execGit.spec.js",
    "chars": 1554,
    "preview": "import path from 'node:path'\n\nimport { exec } from 'tinyexec'\nimport { beforeEach, describe, it, test, vi } from 'vitest"
  },
  {
    "path": "test/unit/file.spec.js",
    "chars": 797,
    "preview": "import { describe, it } from 'vitest'\n\nimport { readFile, unlink } from '../../lib/file.js'\n\ndescribe('unlink', () => {\n"
  },
  {
    "path": "test/unit/generateTasks.spec.js",
    "chars": 7096,
    "preview": "import path from 'node:path'\n\nimport { describe, it } from 'vitest'\n\nimport { generateTasks } from '../../lib/generateTa"
  },
  {
    "path": "test/unit/getAbortController.spec.js",
    "chars": 706,
    "preview": "import { describe, it, vi } from 'vitest'\n\nimport { getAbortController } from '../../lib/getAbortController.js'\n\ndescrib"
  },
  {
    "path": "test/unit/getBackupStash.spec.js",
    "chars": 1876,
    "preview": "import { describe, it, vi } from 'vitest'\n\nimport { getInitialState } from '../../lib/state.js'\nimport { GetBackupStashE"
  },
  {
    "path": "test/unit/getDiffCommand.spec.js",
    "chars": 1337,
    "preview": "import { describe, it } from 'vitest'\n\nimport { getDiffCommand } from '../../lib/getDiffCommand.js'\n\ndescribe('getDiffCo"
  },
  {
    "path": "test/unit/getFunctionTask.spec.js",
    "chars": 1333,
    "preview": "import { describe, it, vi } from 'vitest'\n\nimport { getFunctionTask } from '../../lib/getFunctionTask.js'\nimport { getIn"
  },
  {
    "path": "test/unit/getRenderer.spec.js",
    "chars": 1397,
    "preview": "import { describe, it } from 'vitest'\n\nimport { getRenderer } from '../../lib/getRenderer.js'\ndescribe('getRenderer', ()"
  },
  {
    "path": "test/unit/getSpawnedTask.spec.js",
    "chars": 9345,
    "preview": "import { exec } from 'tinyexec'\nimport { beforeEach, describe, it, vi } from 'vitest'\n\nimport { getAbortController } fro"
  },
  {
    "path": "test/unit/getSpawnedTask.unmocked.spec.js",
    "chars": 1715,
    "preview": "import { describe, it } from 'vitest'\n\nimport { getAbortController } from '../../lib/getAbortController.js'\nimport { get"
  },
  {
    "path": "test/unit/getSpawnedTasks.spec.js",
    "chars": 5757,
    "preview": "import { exec } from 'tinyexec'\nimport { beforeEach, describe, it, vi } from 'vitest'\n\nimport { getAbortController } fro"
  },
  {
    "path": "test/unit/getStagedFiles.spec.js",
    "chars": 4318,
    "preview": "import path from 'node:path'\n\nimport { afterEach, describe, it, vi } from 'vitest'\n\nimport { normalizePath } from '../.."
  },
  {
    "path": "test/unit/index.spec.js",
    "chars": 1860,
    "preview": "import makeConsoleMock from 'consolemock'\nimport { beforeEach, describe, it, vi } from 'vitest'\n\nvi.mock('../../lib/debu"
  },
  {
    "path": "test/unit/index2.spec.js",
    "chars": 1141,
    "preview": "import path from 'node:path'\n\nimport makeConsoleMock from 'consolemock'\nimport { describe, it, vi } from 'vitest'\n\nimpor"
  },
  {
    "path": "test/unit/index3.spec.js",
    "chars": 3957,
    "preview": "import makeConsoleMock from 'consolemock'\nimport { describe, it, vi } from 'vitest'\n\nvi.mock('../../lib/execGit.js', () "
  },
  {
    "path": "test/unit/killSubprocesses.spec.js",
    "chars": 1292,
    "preview": "import { exec } from 'node:child_process'\n\nimport { afterAll, beforeAll, beforeEach } from 'vitest'\nimport { describe, i"
  },
  {
    "path": "test/unit/loadConfig.spec.js",
    "chars": 8786,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport makeCons"
  },
  {
    "path": "test/unit/matchFiles.spec.js",
    "chars": 10554,
    "preview": "import { describe, it } from 'vitest'\n\nimport { matchFiles } from '../../lib/matchFiles.js'\n\nconst STAGED_FILES = [\n  'i"
  },
  {
    "path": "test/unit/normalizePath.spec.js",
    "chars": 2391,
    "preview": "/**\n * Reimplementation of \"normalize-path\"\n * @see https://github.com/jonschlinkert/normalize-path/blob/52c3a95ebebc2d9"
  },
  {
    "path": "test/unit/parseGitZOutput.spec.js",
    "chars": 607,
    "preview": "import { describe, it } from 'vitest'\n\nimport { parseGitZOutput } from '../../lib/parseGitZOutput.js'\n\ndescribe('parseGi"
  },
  {
    "path": "test/unit/printTaskOutput.spec.js",
    "chars": 456,
    "preview": "import { describe, it, vi } from 'vitest'\n\nimport { printTaskOutput } from '../../lib/printTaskOutput.js'\n\nconst logger "
  },
  {
    "path": "test/unit/readStdin.spec.js",
    "chars": 394,
    "preview": "import { stdin } from 'mock-stdin'\nimport { describe, it } from 'vitest'\n\nimport { readStdin } from '../../lib/readStdin"
  },
  {
    "path": "test/unit/resolveGitRepo.spec.js",
    "chars": 2075,
    "preview": "import path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport { describe, it } from 'vitest'\n\nimport { n"
  },
  {
    "path": "test/unit/runAll.spec.js",
    "chars": 16369,
    "preview": "import path from 'node:path'\n\nimport makeConsoleMock from 'consolemock'\nimport { exec } from 'tinyexec'\nimport { afterAl"
  },
  {
    "path": "test/unit/searchConfigs.spec.js",
    "chars": 5837,
    "preview": "import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport { before"
  },
  {
    "path": "test/unit/state.spec.js",
    "chars": 3482,
    "preview": "import { describe, it } from 'vitest'\n\nimport {\n  applyModificationsSkipped,\n  cleanupSkipped,\n  getInitialState,\n  rest"
  },
  {
    "path": "test/unit/validateBraces.spec.js",
    "chars": 4334,
    "preview": "import makeConsoleMock from 'consolemock'\nimport { describe, it } from 'vitest'\n\nimport {\n  DOUBLE_BRACES_REGEXP,\n  getI"
  },
  {
    "path": "test/unit/validateConfig.spec.js",
    "chars": 3749,
    "preview": "import makeConsoleMock from 'consolemock'\nimport { beforeEach, describe, it } from 'vitest'\n\nimport { validateConfig } f"
  },
  {
    "path": "test/unit/validateOptions.spec.js",
    "chars": 2658,
    "preview": "import { constants } from 'node:fs'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport makeConsoleMo"
  },
  {
    "path": "tsconfig.json",
    "chars": 307,
    "preview": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"lib\": [\"es2023\""
  },
  {
    "path": "vitest.config.js",
    "chars": 1372,
    "preview": "import { defineConfig } from 'vitest/config'\n\nexport default defineConfig({\n  test: {\n    coverage: {\n      enabled: tru"
  }
]

About this extraction

This page contains the full source code of the lint-staged/lint-staged GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 164 files (518.5 KB), approximately 150.2k tokens, and a symbol index with 96 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!