lint-staged 12.3.7 → 12.3.8

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.
@@ -56,10 +56,14 @@ const handleOutput = (command, result, ctx, isError = false) => {
56
56
  * checks the context.
57
57
  */
58
58
  const interruptExecutionOnError = (ctx, execaChildProcess) => {
59
+ let loopIntervalId
60
+
59
61
  async function loop() {
60
62
  if (ctx.errors.size > 0) {
63
+ clearInterval(loopIntervalId)
64
+
61
65
  const ids = await pidTree(execaChildProcess.pid)
62
- ids.forEach(process.kill)
66
+ ids.forEach((id) => process.kill(id))
63
67
 
64
68
  // The execa process is killed separately in order
65
69
  // to get the `KILLED` status.
@@ -67,7 +71,7 @@ const interruptExecutionOnError = (ctx, execaChildProcess) => {
67
71
  }
68
72
  }
69
73
 
70
- const loopIntervalId = setInterval(loop, ERROR_CHECK_INTERVAL)
74
+ loopIntervalId = setInterval(loop, ERROR_CHECK_INTERVAL)
71
75
 
72
76
  return () => {
73
77
  clearInterval(loopIntervalId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "12.3.7",
3
+ "version": "12.3.8",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/okonet/lint-staged",