### Description
Not sure if this is a bug, but lint-staged v13.0.0 sure is ch…atty. :) Running `npx lint-staged` (not through a husky pre-commit script) seems to yield the expected output, though. See both examples below.
### Steps to reproduce
1. Install lint-staged 13.0.0
2. Add files and commit
3. Observe output
<details>
<summary>Expand to view output when invoked through husky</summary>
```
◼ Preparing lint-staged...
◼ Preparing lint-staged...
◼ Running tasks for staged files...
◼ Preparing lint-staged...
◼ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Preparing lint-staged...
◼ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
⠋ Preparing lint-staged...
◼ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
⠙ Preparing lint-staged...
◼ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
◼ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
⠙ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
◼ lint-staged.config.js — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
⠙ lint-staged.config.js — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
◼ *.{js,jsx,ts,tsx} — 0 file
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
◼ *.{js,jsx,ts,tsx} — 0 file
◼ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
⠙ *.{js,jsx,ts,tsx} — 0 file
◼ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
⠙ *.{js,jsx,ts,tsx} — 0 file
⠙ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
⠙ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
⠙ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
⠹ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
⠸ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
⠼ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
⠴ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
⠦ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
❯ *.{html,css,json,md,mdx,yml,yaml} — 2 files
✔ prettier --write
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
❯ lint-staged.config.js — 2 files
↓ *.{js,jsx,ts,tsx} — no files [SKIPPED]
✔ *.{html,css,json,md,mdx,yml,yaml} — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
❯ Running tasks for staged files...
✔ lint-staged.config.js — 2 files
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
◼ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
⠦ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
◼ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
⠦ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
⠧ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...
[lint-staged-13 c25c260f] chore(deps): update lint-staged to v13
```
</details>
<details>
<summary>Expand to view output when invoked directly (no husky)</summary>
```
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...
```
</details>
### 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(`./node_modules/.bin/lint-staged --debug`). Read more
about debug mode here -
https://github.com/okonet/lint-staged#command-line-flags.
NOTE: This requires `lint-staged` version >= `6.0.0`.
-->
<details>
<summary>expand to view</summary>
```
lint-staged:bin Options parsed from command-line: {
allowEmpty: false,
concurrent: true,
configPath: undefined,
cwd: undefined,
debug: true,
diff: undefined,
diffFilter: undefined,
maxArgLength: undefined,
quiet: false,
relative: false,
shell: false,
stash: true,
verbose: false
} +0ms
lint-staged:validateOptions Validating options... +0ms
lint-staged:validateOptions Validated options! +0ms
lint-staged Unset GIT_LITERAL_PATHSPECS (was `undefined`) +0ms
lint-staged:runAll Running all linter scripts... +0ms
lint-staged:runAll Using working directory `C:\dev\node\booleanize` +0ms
lint-staged:resolveGitRepo Resolving git repo from `C:\dev\node\booleanize` +0ms
lint-staged:resolveGitRepo Unset GIT_DIR (was `undefined`) +0ms
lint-staged:resolveGitRepo Unset GIT_WORK_TREE (was `undefined`) +0ms
lint-staged:execGit Running git command [ 'rev-parse', '--show-prefix' ] +0ms
lint-staged:resolveGitRepo Resolved git directory to be `C:/dev/node/booleanize` +57ms
lint-staged:resolveGitRepo Resolved git config directory to be `C:/dev/node/booleanize/.git` +0ms
lint-staged:execGit Running git command [ 'log', '-1' ] +56ms
lint-staged:execGit Running git command [ 'diff', '--name-only', '-z', '--diff-filter=ACMR', '--staged' ] +51ms
lint-staged:runAll Loaded list of staged files in git:
lint-staged:runAll [
lint-staged:runAll 'C:/dev/node/booleanize/package-lock.json',
lint-staged:runAll 'C:/dev/node/booleanize/package.json'
lint-staged:runAll ] +160ms
lint-staged:searchConfigs Searching for configuration files... +0ms
lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name' ] +53ms
lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name', '--others', '--exclude-standard' ] +23ms
lint-staged:searchConfigs Found possible config files: [
'C:/dev/node/booleanize/lint-staged.config.js',
'C:/dev/node/booleanize/package.json'
] +74ms
lint-staged:loadConfig Loading configuration from `C:/dev/node/booleanize/lint-staged.config.js`... +0ms
lint-staged:loadConfig Loading configuration from `C:/dev/node/booleanize/package.json`... +0ms
lint-staged:loadConfig Successfully loaded config from `C:\dev\node\booleanize\lint-staged.config.js`:
lint-staged:loadConfig {
lint-staged:loadConfig '*.{js,jsx,ts,tsx}': [ 'prettier --write', 'eslint --fix' ],
lint-staged:loadConfig '*.{html,css,json,md,mdx,yml,yaml}': [ 'prettier --write' ]
lint-staged:loadConfig } +2ms
lint-staged:searchConfigs Config file "C:/dev/node/booleanize/lint-staged.config.js" resolved to "C:\dev\node\booleanize\lint-staged.config.js" +3ms
lint-staged:validateConfig Validating config from `C:\dev\node\booleanize\lint-staged.config.js`... +0ms
lint-staged:validateConfig Validated config from `C:\dev\node\booleanize\lint-staged.config.js`: +1ms
lint-staged:validateConfig {
lint-staged:validateConfig '*.{js,jsx,ts,tsx}': [ 'prettier --write', 'eslint --fix' ],
lint-staged:validateConfig '*.{html,css,json,md,mdx,yml,yaml}': [ 'prettier --write' ]
lint-staged:validateConfig } +1ms
lint-staged:loadConfig Successfully loaded config from `C:\dev\node\booleanize\package.json`:
lint-staged:loadConfig null +2ms
lint-staged:searchConfigs Found 1 config files +3ms
lint-staged:groupFilesByConfig Grouping 2 files by 1 configurations +0ms
lint-staged:chunkFiles Resolved an argument string length of 76 characters from 2 files +0ms
lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 4095.5 +0ms
lint-staged:generateTasks Generating linter tasks +0ms
lint-staged:generateTasks Generated task:
lint-staged:generateTasks {
lint-staged:generateTasks pattern: '*.{js,jsx,ts,tsx}',
lint-staged:generateTasks commands: [ 'prettier --write', 'eslint --fix' ],
lint-staged:generateTasks fileList: []
lint-staged:generateTasks } +2ms
lint-staged:generateTasks Generated task:
lint-staged:generateTasks {
lint-staged:generateTasks pattern: '*.{html,css,json,md,mdx,yml,yaml}',
lint-staged:generateTasks commands: [ 'prettier --write' ],
lint-staged:generateTasks fileList: [
lint-staged:generateTasks 'C:/dev/node/booleanize/package-lock.json',
lint-staged:generateTasks 'C:/dev/node/booleanize/package.json'
lint-staged:generateTasks ]
lint-staged:generateTasks } +1ms
lint-staged:makeCmdTasks Creating listr tasks for commands [ 'prettier --write', 'eslint --fix' ] +0ms
lint-staged:resolveTaskFn cmd: prettier +0ms
lint-staged:resolveTaskFn args: [ '--write' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: 'C:\\dev\\node\\booleanize',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:resolveTaskFn cmd: eslint +1ms
lint-staged:resolveTaskFn args: [ '--fix' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: 'C:\\dev\\node\\booleanize',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:makeCmdTasks Creating listr tasks for commands [ 'prettier --write' ] +3ms
lint-staged:resolveTaskFn cmd: prettier +0ms
lint-staged:resolveTaskFn args: [ '--write' ] +1ms
lint-staged:resolveTaskFn execaOptions: {
cwd: 'C:\\dev\\node\\booleanize',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:chunkFiles Resolved an argument string length of 76 characters from 2 files +8ms
lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 4095.5 +0ms
[STARTED] Preparing lint-staged...
lint-staged:GitWorkflow Backing up original state... +0ms
lint-staged:GitWorkflow Getting partially staged files... +0ms
lint-staged:execGit Running git command [ 'status', '-z' ] +68ms
lint-staged:GitWorkflow Found partially staged files: [] +54ms
lint-staged:GitWorkflow Backing up merge state... +1ms
lint-staged:file Reading file `C:\dev\node\booleanize\.git\MERGE_HEAD` +0ms
lint-staged:file Reading file `C:\dev\node\booleanize\.git\MERGE_MODE` +0ms
lint-staged:file Reading file `C:\dev\node\booleanize\.git\MERGE_MSG` +0ms
lint-staged:file File `C:\dev\node\booleanize\.git\MERGE_HEAD` doesn't exist, ignoring... +0ms
lint-staged:file File `C:\dev\node\booleanize\.git\MERGE_MODE` doesn't exist, ignoring... +0ms
lint-staged:file File `C:\dev\node\booleanize\.git\MERGE_MSG` doesn't exist, ignoring... +1ms
lint-staged:GitWorkflow Done backing up merge state! +1ms
lint-staged:GitWorkflow Getting deleted files... +0ms
lint-staged:execGit Running git command [ 'ls-files', '--deleted' ] +55ms
lint-staged:GitWorkflow Found deleted files: [] +48ms
lint-staged:execGit Running git command [ 'stash', 'create' ] +48ms
lint-staged:execGit Running git command [
'stash',
'store',
'--quiet',
'--message',
'lint-staged automatic backup',
'8e320ffdf8dc88afc2ae838a06c4557a81029180'
] +82ms
lint-staged:GitWorkflow Done backing up original state! +134ms
[SUCCESS] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] lint-staged.config.js — 2 files
[STARTED] *.{js,jsx,ts,tsx} — 0 file
[STARTED] *.{html,css,json,md,mdx,yml,yaml} — 2 files
[SKIPPED] *.{js,jsx,ts,tsx} — no files
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] *.{html,css,json,md,mdx,yml,yaml} — 2 files
[SUCCESS] lint-staged.config.js — 2 files
[SUCCESS] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
lint-staged:GitWorkflow Adding task modifications to index... +532ms
lint-staged:execGit Running git command [
'add',
'--',
'C:/dev/node/booleanize/package-lock.json',
'C:/dev/node/booleanize/package.json'
] +584ms
lint-staged:GitWorkflow Done adding task modifications to index! +55ms
lint-staged:execGit Running git command [ 'diff', '--name-only', '--cached' ] +55ms
[SUCCESS] Applying modifications from tasks...
[STARTED] Cleaning up temporary files...
lint-staged:GitWorkflow Dropping backup stash... +54ms
lint-staged:execGit Running git command [ 'stash', 'list' ] +55ms
lint-staged:execGit Running git command [ 'stash', 'drop', '--quiet', 'refs/stash@{0}' ] +66ms
lint-staged:GitWorkflow Done dropping backup stash! +140ms
[SUCCESS] Cleaning up temporary files...
lint-staged Tasks were executed successfully! +1s
```
</details>
### Environment
- **OS:** Windows 10
- **Node.js:** 16.14.2
- **`lint-staged`:** v13.0.0