@lousy-agents/lint 5.14.2 → 5.14.4

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/dist/index.js +46 -33
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1334,10 +1334,9 @@ function getFsSafePythonConfig() {
1334
1334
  };
1335
1335
  }
1336
1336
  function canFallbackFromPythonError(error) {
1337
+ const code = error instanceof Error && "code" in error ? error.code : undefined;
1337
1338
  return (getFsSafePythonConfig().mode !== "require" &&
1338
- error instanceof Error &&
1339
- "code" in error &&
1340
- error.code === "helper-unavailable");
1339
+ (code === "helper-unavailable" || code === "unsupported-platform"));
1341
1340
  }
1342
1341
 
1343
1342
  // EXTERNAL MODULE: external "node:child_process"
@@ -37931,8 +37930,10 @@ class Composer {
37931
37930
  }
37932
37931
  }
37933
37932
  if (afterDoc) {
37934
- Array.prototype.push.apply(doc.errors, this.errors);
37935
- Array.prototype.push.apply(doc.warnings, this.warnings);
37933
+ for (let i = 0; i < this.errors.length; ++i)
37934
+ doc.errors.push(this.errors[i]);
37935
+ for (let i = 0; i < this.warnings.length; ++i)
37936
+ doc.warnings.push(this.warnings[i]);
37936
37937
  }
37937
37938
  else {
37938
37939
  doc.errors = this.errors;
@@ -41747,7 +41748,7 @@ class Lexer {
41747
41748
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
41748
41749
  this.indentNext = this.indentValue + 1;
41749
41750
  this.indentValue += n;
41750
- return yield* this.parseBlockStart();
41751
+ return 'block-start';
41751
41752
  }
41752
41753
  return 'doc';
41753
41754
  }
@@ -42068,32 +42069,36 @@ class Lexer {
42068
42069
  return 0;
42069
42070
  }
42070
42071
  *pushIndicators() {
42071
- switch (this.charAt(0)) {
42072
- case '!':
42073
- return ((yield* this.pushTag()) +
42074
- (yield* this.pushSpaces(true)) +
42075
- (yield* this.pushIndicators()));
42076
- case '&':
42077
- return ((yield* this.pushUntil(isNotAnchorChar)) +
42078
- (yield* this.pushSpaces(true)) +
42079
- (yield* this.pushIndicators()));
42080
- case '-': // this is an error
42081
- case '?': // this is an error outside flow collections
42082
- case ':': {
42083
- const inFlow = this.flowLevel > 0;
42084
- const ch1 = this.charAt(1);
42085
- if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
42086
- if (!inFlow)
42087
- this.indentNext = this.indentValue + 1;
42088
- else if (this.flowKey)
42089
- this.flowKey = false;
42090
- return ((yield* this.pushCount(1)) +
42091
- (yield* this.pushSpaces(true)) +
42092
- (yield* this.pushIndicators()));
42072
+ let n = 0;
42073
+ loop: while (true) {
42074
+ switch (this.charAt(0)) {
42075
+ case '!':
42076
+ n += yield* this.pushTag();
42077
+ n += yield* this.pushSpaces(true);
42078
+ continue loop;
42079
+ case '&':
42080
+ n += yield* this.pushUntil(isNotAnchorChar);
42081
+ n += yield* this.pushSpaces(true);
42082
+ continue loop;
42083
+ case '-': // this is an error
42084
+ case '?': // this is an error outside flow collections
42085
+ case ':': {
42086
+ const inFlow = this.flowLevel > 0;
42087
+ const ch1 = this.charAt(1);
42088
+ if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
42089
+ if (!inFlow)
42090
+ this.indentNext = this.indentValue + 1;
42091
+ else if (this.flowKey)
42092
+ this.flowKey = false;
42093
+ n += yield* this.pushCount(1);
42094
+ n += yield* this.pushSpaces(true);
42095
+ continue loop;
42096
+ }
42093
42097
  }
42094
42098
  }
42099
+ break loop;
42095
42100
  }
42096
- return 0;
42101
+ return n;
42097
42102
  }
42098
42103
  *pushTag() {
42099
42104
  if (this.charAt(1) === '<') {
@@ -42273,6 +42278,14 @@ function getFirstKeyStartProps(prev) {
42273
42278
  }
42274
42279
  return prev.splice(i, prev.length);
42275
42280
  }
42281
+ function arrayPushArray(target, source) {
42282
+ // May exhaust call stack with large `source` array
42283
+ if (source.length < 1e5)
42284
+ Array.prototype.push.apply(target, source);
42285
+ else
42286
+ for (let i = 0; i < source.length; ++i)
42287
+ target.push(source[i]);
42288
+ }
42276
42289
  function fixFlowSeqItems(fc) {
42277
42290
  if (fc.start.type === 'flow-seq-start') {
42278
42291
  for (const it of fc.items) {
@@ -42285,12 +42298,12 @@ function fixFlowSeqItems(fc) {
42285
42298
  delete it.key;
42286
42299
  if (isFlowToken(it.value)) {
42287
42300
  if (it.value.end)
42288
- Array.prototype.push.apply(it.value.end, it.sep);
42301
+ arrayPushArray(it.value.end, it.sep);
42289
42302
  else
42290
42303
  it.value.end = it.sep;
42291
42304
  }
42292
42305
  else
42293
- Array.prototype.push.apply(it.start, it.sep);
42306
+ arrayPushArray(it.start, it.sep);
42294
42307
  delete it.sep;
42295
42308
  }
42296
42309
  }
@@ -42710,7 +42723,7 @@ class Parser {
42710
42723
  const prev = map.items[map.items.length - 2];
42711
42724
  const end = prev?.value?.end;
42712
42725
  if (Array.isArray(end)) {
42713
- Array.prototype.push.apply(end, it.start);
42726
+ arrayPushArray(end, it.start);
42714
42727
  end.push(this.sourceToken);
42715
42728
  map.items.pop();
42716
42729
  return;
@@ -42925,7 +42938,7 @@ class Parser {
42925
42938
  const prev = seq.items[seq.items.length - 2];
42926
42939
  const end = prev?.value?.end;
42927
42940
  if (Array.isArray(end)) {
42928
- Array.prototype.push.apply(end, it.start);
42941
+ arrayPushArray(end, it.start);
42929
42942
  end.push(this.sourceToken);
42930
42943
  seq.items.pop();
42931
42944
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/lint",
3
- "version": "5.14.2",
3
+ "version": "5.14.4",
4
4
  "description": "Programmatic lint API for validating AI coding assistant configurations — skills, agents, hooks, and instructions",
5
5
  "type": "module",
6
6
  "repository": {