lint-staged 16.3.1 → 16.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,8 +67,6 @@ This project contains a script that will run arbitrary shell tasks with a list o
67
67
  - [SurviveJS interview - Juho Vepsäläinen and Andrey Okonetchnikov, 2018](https://survivejs.com/blog/lint-staged-interview/)
68
68
  - [Prettier your CSharp with `dotnet-format` and `lint-staged`](https://johnnyreilly.com/2020/12/22/prettier-your-csharp-with-dotnet-format-and-lint-staged)
69
69
 
70
- > If you've written one, please submit a PR with the link to it!
71
-
72
70
  ## Installation and setup
73
71
 
74
72
  To install _lint-staged_ in the recommended way, you need to:
package/lib/execGit.js CHANGED
@@ -4,6 +4,9 @@ import { createDebug } from './debug.js'
4
4
 
5
5
  const debugLog = createDebug('lint-staged:execGit')
6
6
 
7
+ /** @example "warning: in the working copy of 'README.md', LF will be replaced by CRLF the next time Git touches it" */
8
+ const GIT_CRLF_WARNING = /^warning.*CRLF.*the next time Git touches it/i
9
+
7
10
  /**
8
11
  * Explicitly never recurse commands into submodules, overriding local/global configuration.
9
12
  * @see https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulerecurse
@@ -25,6 +28,11 @@ export const execGit = async (cmd, options) => {
25
28
 
26
29
  let output = ''
27
30
  for await (const line of result) {
31
+ if (GIT_CRLF_WARNING.test(line)) {
32
+ debugLog('Stripped Git CRLF warning: %s', line)
33
+ continue
34
+ }
35
+
28
36
  output += line + '\n'
29
37
  }
30
38
  output = output.trimEnd()
@@ -90,7 +90,6 @@ export const getSpawnedTask = ({
90
90
  // Only use topLevelDir as CWD if we are using the git binary
91
91
  // e.g `npm` should run tasks in the actual CWD
92
92
  cwd: /^git(\.exe)?/i.test(cmd) ? topLevelDir : cwd,
93
- detached: true,
94
93
  env: color ? { FORCE_COLOR: 'true' } : { NO_COLOR: 'true' },
95
94
  stdio: ['ignore'],
96
95
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "16.3.1",
3
+ "version": "16.3.3",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": {