lint-staged 15.2.8 → 15.2.9

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.
Files changed (2) hide show
  1. package/lib/runAll.js +13 -0
  2. package/package.json +1 -1
package/lib/runAll.js CHANGED
@@ -161,6 +161,14 @@ export const runAll = async (
161
161
  ...getRenderer({ debug, quiet }, logger),
162
162
  }
163
163
 
164
+ /**
165
+ * This is used to set max event listener count to the total number
166
+ * of generated tasks. The event listener is used to keep track of
167
+ * the interrupt signal and kill all tasks when it happens. See the
168
+ * `interruptExecutionOnError` in `resolveTaskFn`.
169
+ */
170
+ let listrTaskCount = 0
171
+
164
172
  const listrTasks = []
165
173
 
166
174
  // Set of all staged files that matched a task glob. Values in a set are unique.
@@ -231,6 +239,8 @@ export const runAll = async (
231
239
  )
232
240
  )
233
241
 
242
+ listrTaskCount += chunkListrTasks.length
243
+
234
244
  listrTasks.push({
235
245
  title:
236
246
  `${configName}${chalk.dim(` — ${files.length} ${files.length > 1 ? 'files' : 'file'}`)}` +
@@ -321,6 +331,9 @@ export const runAll = async (
321
331
  listrOptions
322
332
  )
323
333
 
334
+ debugLog('Set max event listeners to the number of tasks: %i', listrTaskCount)
335
+ ctx.events.setMaxListeners(listrTaskCount)
336
+
324
337
  await runner.run()
325
338
 
326
339
  if (ctx.errors.size > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "15.2.8",
3
+ "version": "15.2.9",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/lint-staged/lint-staged",