@lousy-agents/lint 5.14.3 → 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 +44 -30
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37930,8 +37930,10 @@ class Composer {
37930
37930
  }
37931
37931
  }
37932
37932
  if (afterDoc) {
37933
- Array.prototype.push.apply(doc.errors, this.errors);
37934
- 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]);
37935
37937
  }
37936
37938
  else {
37937
37939
  doc.errors = this.errors;
@@ -41746,7 +41748,7 @@ class Lexer {
41746
41748
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
41747
41749
  this.indentNext = this.indentValue + 1;
41748
41750
  this.indentValue += n;
41749
- return yield* this.parseBlockStart();
41751
+ return 'block-start';
41750
41752
  }
41751
41753
  return 'doc';
41752
41754
  }
@@ -42067,32 +42069,36 @@ class Lexer {
42067
42069
  return 0;
42068
42070
  }
42069
42071
  *pushIndicators() {
42070
- switch (this.charAt(0)) {
42071
- case '!':
42072
- return ((yield* this.pushTag()) +
42073
- (yield* this.pushSpaces(true)) +
42074
- (yield* this.pushIndicators()));
42075
- case '&':
42076
- return ((yield* this.pushUntil(isNotAnchorChar)) +
42077
- (yield* this.pushSpaces(true)) +
42078
- (yield* this.pushIndicators()));
42079
- case '-': // this is an error
42080
- case '?': // this is an error outside flow collections
42081
- case ':': {
42082
- const inFlow = this.flowLevel > 0;
42083
- const ch1 = this.charAt(1);
42084
- if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
42085
- if (!inFlow)
42086
- this.indentNext = this.indentValue + 1;
42087
- else if (this.flowKey)
42088
- this.flowKey = false;
42089
- return ((yield* this.pushCount(1)) +
42090
- (yield* this.pushSpaces(true)) +
42091
- (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
+ }
42092
42097
  }
42093
42098
  }
42099
+ break loop;
42094
42100
  }
42095
- return 0;
42101
+ return n;
42096
42102
  }
42097
42103
  *pushTag() {
42098
42104
  if (this.charAt(1) === '<') {
@@ -42272,6 +42278,14 @@ function getFirstKeyStartProps(prev) {
42272
42278
  }
42273
42279
  return prev.splice(i, prev.length);
42274
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
+ }
42275
42289
  function fixFlowSeqItems(fc) {
42276
42290
  if (fc.start.type === 'flow-seq-start') {
42277
42291
  for (const it of fc.items) {
@@ -42284,12 +42298,12 @@ function fixFlowSeqItems(fc) {
42284
42298
  delete it.key;
42285
42299
  if (isFlowToken(it.value)) {
42286
42300
  if (it.value.end)
42287
- Array.prototype.push.apply(it.value.end, it.sep);
42301
+ arrayPushArray(it.value.end, it.sep);
42288
42302
  else
42289
42303
  it.value.end = it.sep;
42290
42304
  }
42291
42305
  else
42292
- Array.prototype.push.apply(it.start, it.sep);
42306
+ arrayPushArray(it.start, it.sep);
42293
42307
  delete it.sep;
42294
42308
  }
42295
42309
  }
@@ -42709,7 +42723,7 @@ class Parser {
42709
42723
  const prev = map.items[map.items.length - 2];
42710
42724
  const end = prev?.value?.end;
42711
42725
  if (Array.isArray(end)) {
42712
- Array.prototype.push.apply(end, it.start);
42726
+ arrayPushArray(end, it.start);
42713
42727
  end.push(this.sourceToken);
42714
42728
  map.items.pop();
42715
42729
  return;
@@ -42924,7 +42938,7 @@ class Parser {
42924
42938
  const prev = seq.items[seq.items.length - 2];
42925
42939
  const end = prev?.value?.end;
42926
42940
  if (Array.isArray(end)) {
42927
- Array.prototype.push.apply(end, it.start);
42941
+ arrayPushArray(end, it.start);
42928
42942
  end.push(this.sourceToken);
42929
42943
  seq.items.pop();
42930
42944
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/lint",
3
- "version": "5.14.3",
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": {