@typescript-eslint/typescript-estree 8.44.0 → 8.44.1-alpha.1

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/dist/convert.d.ts CHANGED
@@ -50,6 +50,13 @@ export declare class Converter {
50
50
  * @returns the converted ESTree node
51
51
  */
52
52
  private convertChild;
53
+ /**
54
+ * Converts TypeScript node array into an ESTree node list.
55
+ * @param children the child `ts.NodeArray` or `ts.Node[]`
56
+ * @param parent parentNode
57
+ * @returns the converted ESTree node list
58
+ */
59
+ private convertChildren;
53
60
  /**
54
61
  * Converts a TypeScript node into an ESTree node.
55
62
  * @param child the child ts.Node
@@ -1 +1 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EACV,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,EAAE,MAAM,aAAa,CAAC;AAmCtE,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,wBAAwB,GAAG,EAAE,CAAC,sBAAsB,GAC1D,OAAO,CAMT;AAED,MAAM,WAAW,OAAO;IACtB,qBAAqB,EAAE,2BAA2B,CAAC;IACnD,qBAAqB,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAC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CAAC,sBAAsB;IA4C9B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAOvB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAsB7B;;;;;OAKG;IACH,OAAO,CAAC,gDAAgD;IAkBxD;;;;OAIG;IACH,OAAO,CAAC,kDAAkD;IAqB1D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IA8BjB,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,+BAA+B;IAgDvC;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,sBAAsB;IAoC9B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAwlFnB,OAAO,CAAC,UAAU;IAclB,cAAc,IAAI,QAAQ,CAAC,OAAO;IAIlC;;;;OAIG;IACH,OAAO,CAAC,UAAU;IA0FlB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAgFlB,UAAU,IAAI,OAAO;IAOrB;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAYhC"}
package/dist/convert.js CHANGED
@@ -394,6 +394,15 @@ class Converter {
394
394
  convertChild(child, parent) {
395
395
  return this.converter(child, parent, false);
396
396
  }
397
+ /**
398
+ * Converts TypeScript node array into an ESTree node list.
399
+ * @param children the child `ts.NodeArray` or `ts.Node[]`
400
+ * @param parent parentNode
401
+ * @returns the converted ESTree node list
402
+ */
403
+ convertChildren(children, parent) {
404
+ return children.map(child => this.converter(child, parent, false));
405
+ }
397
406
  /**
398
407
  * Converts a TypeScript node into an ESTree node.
399
408
  * @param child the child ts.Node
@@ -441,7 +450,7 @@ class Converter {
441
450
  return this.createNode(node, {
442
451
  type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation,
443
452
  range,
444
- params: typeArguments.map(typeArgument => this.convertChild(typeArgument)),
453
+ params: this.convertChildren(typeArguments),
445
454
  });
446
455
  }
447
456
  /**
@@ -462,7 +471,7 @@ class Converter {
462
471
  type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration,
463
472
  loc: (0, node_utils_1.getLocFor)(range, this.ast),
464
473
  range,
465
- params: typeParameters.map(typeParameter => this.convertChild(typeParameter)),
474
+ params: this.convertChildren(typeParameters),
466
475
  };
467
476
  }
468
477
  /**
@@ -476,8 +485,7 @@ class Converter {
476
485
  }
477
486
  return parameters.map(param => {
478
487
  const convertedParam = this.convertChild(param);
479
- convertedParam.decorators =
480
- (0, getModifiers_1.getDecorators)(param)?.map(el => this.convertChild(el)) ?? [];
488
+ convertedParam.decorators = this.convertChildren((0, getModifiers_1.getDecorators)(param) ?? []);
481
489
  return convertedParam;
482
490
  });
483
491
  }
@@ -506,9 +514,9 @@ class Converter {
506
514
  return result;
507
515
  }
508
516
  convertImportAttributes(node) {
509
- return node == null
510
- ? []
511
- : node.elements.map(element => this.convertChild(element));
517
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
518
+ const attributes = node.attributes ?? node.assertClause;
519
+ return this.convertChildren(attributes?.elements ?? []);
512
520
  }
513
521
  convertJSXIdentifier(node) {
514
522
  const result = this.createNode(node, {
@@ -718,7 +726,7 @@ class Converter {
718
726
  }
719
727
  return this.createNode(node, {
720
728
  type: ts_estree_1.AST_NODE_TYPES.SwitchStatement,
721
- cases: node.caseBlock.clauses.map(el => this.convertChild(el)),
729
+ cases: this.convertChildren(node.caseBlock.clauses),
722
730
  discriminant: this.convertChild(node.expression),
723
731
  });
724
732
  case SyntaxKind.CaseClause:
@@ -726,7 +734,7 @@ class Converter {
726
734
  return this.createNode(node, {
727
735
  type: ts_estree_1.AST_NODE_TYPES.SwitchCase,
728
736
  // expression is present in case only
729
- consequent: node.statements.map(el => this.convertChild(el)),
737
+ consequent: this.convertChildren(node.statements),
730
738
  test: node.kind === SyntaxKind.CaseClause
731
739
  ? this.convertChild(node.expression)
732
740
  : null,
@@ -862,7 +870,7 @@ class Converter {
862
870
  case SyntaxKind.VariableStatement: {
863
871
  const result = this.createNode(node, {
864
872
  type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
865
- declarations: node.declarationList.declarations.map(el => this.convertChild(el)),
873
+ declarations: this.convertChildren(node.declarationList.declarations),
866
874
  declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
867
875
  kind: (0, node_utils_1.getDeclarationKind)(node.declarationList),
868
876
  });
@@ -917,7 +925,7 @@ class Converter {
917
925
  case SyntaxKind.VariableDeclarationList: {
918
926
  const result = this.createNode(node, {
919
927
  type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
920
- declarations: node.declarations.map(el => this.convertChild(el)),
928
+ declarations: this.convertChildren(node.declarations),
921
929
  declare: false,
922
930
  kind: (0, node_utils_1.getDeclarationKind)(node),
923
931
  });
@@ -957,7 +965,7 @@ class Converter {
957
965
  }
958
966
  return this.createNode(node, {
959
967
  type: ts_estree_1.AST_NODE_TYPES.ArrayExpression,
960
- elements: node.elements.map(el => this.convertChild(el)),
968
+ elements: this.convertChildren(node.elements),
961
969
  });
962
970
  }
963
971
  case SyntaxKind.ObjectLiteralExpression: {
@@ -1055,6 +1063,10 @@ class Converter {
1055
1063
  if (isAbstract && node.initializer) {
1056
1064
  this.#throwError(node.initializer, `Abstract property cannot have an initializer.`);
1057
1065
  }
1066
+ if (node.name.kind === SyntaxKind.StringLiteral &&
1067
+ node.name.text === 'constructor') {
1068
+ this.#throwError(node.name, "Classes may not have a field named 'constructor'.");
1069
+ }
1058
1070
  const isAccessor = (0, node_utils_1.hasModifier)(SyntaxKind.AccessorKeyword, node);
1059
1071
  const type = (() => {
1060
1072
  if (isAccessor) {
@@ -1074,7 +1086,7 @@ class Converter {
1074
1086
  accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
1075
1087
  computed: (0, node_utils_1.isComputedProperty)(node.name),
1076
1088
  declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
1077
- decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [],
1089
+ decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []),
1078
1090
  definite: !!node.exclamationToken,
1079
1091
  key,
1080
1092
  optional: (key.type === ts_estree_1.AST_NODE_TYPES.Literal ||
@@ -1119,7 +1131,7 @@ class Converter {
1119
1131
  }
1120
1132
  let result;
1121
1133
  if (parent.kind === SyntaxKind.ObjectLiteralExpression) {
1122
- method.params = node.parameters.map(el => this.convertChild(el));
1134
+ method.params = this.convertChildren(node.parameters);
1123
1135
  result = this.createNode(node, {
1124
1136
  type: ts_estree_1.AST_NODE_TYPES.Property,
1125
1137
  computed: (0, node_utils_1.isComputedProperty)(node.name),
@@ -1147,7 +1159,7 @@ class Converter {
1147
1159
  type: methodDefinitionType,
1148
1160
  accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
1149
1161
  computed: (0, node_utils_1.isComputedProperty)(node.name),
1150
- decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [],
1162
+ decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []),
1151
1163
  key: this.convertChild(node.name),
1152
1164
  kind: 'method',
1153
1165
  optional: !!node.questionToken,
@@ -1527,14 +1539,12 @@ class Converter {
1527
1539
  body: this.createNode(node, {
1528
1540
  type: ts_estree_1.AST_NODE_TYPES.ClassBody,
1529
1541
  range: [node.members.pos - 1, node.end],
1530
- body: node.members
1531
- .filter(node_utils_1.isESTreeClassMember)
1532
- .map(el => this.convertChild(el)),
1542
+ body: this.convertChildren(node.members.filter(node_utils_1.isESTreeClassMember)),
1533
1543
  }),
1534
1544
  declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
1535
- decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [],
1545
+ decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []),
1536
1546
  id: this.convertChild(node.name),
1537
- implements: implementsClause?.types.map(el => this.convertChild(el)) ?? [],
1547
+ implements: this.convertChildren(implementsClause?.types ?? []),
1538
1548
  superClass: extendsClause?.types[0]
1539
1549
  ? this.convertChild(extendsClause.types[0].expression)
1540
1550
  : null,
@@ -1558,9 +1568,7 @@ class Converter {
1558
1568
  this.assertModuleSpecifier(node, false);
1559
1569
  const result = this.createNode(node, this.#withDeprecatedAliasGetter({
1560
1570
  type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration,
1561
- attributes: this.convertImportAttributes(
1562
- // eslint-disable-next-line @typescript-eslint/no-deprecated
1563
- node.attributes ?? node.assertClause),
1571
+ attributes: this.convertImportAttributes(node),
1564
1572
  importKind: 'value',
1565
1573
  source: this.convertChild(node.moduleSpecifier),
1566
1574
  specifiers: [],
@@ -1581,7 +1589,7 @@ class Converter {
1581
1589
  result.specifiers.push(this.convertChild(node.importClause.namedBindings));
1582
1590
  break;
1583
1591
  case SyntaxKind.NamedImports:
1584
- result.specifiers.push(...node.importClause.namedBindings.elements.map(el => this.convertChild(el)));
1592
+ result.specifiers.push(...this.convertChildren(node.importClause.namedBindings.elements));
1585
1593
  break;
1586
1594
  }
1587
1595
  }
@@ -1613,21 +1621,17 @@ class Converter {
1613
1621
  this.assertModuleSpecifier(node, true);
1614
1622
  return this.createNode(node, this.#withDeprecatedAliasGetter({
1615
1623
  type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration,
1616
- attributes: this.convertImportAttributes(
1617
- // eslint-disable-next-line @typescript-eslint/no-deprecated
1618
- node.attributes ?? node.assertClause),
1624
+ attributes: this.convertImportAttributes(node),
1619
1625
  declaration: null,
1620
1626
  exportKind: node.isTypeOnly ? 'type' : 'value',
1621
1627
  source: this.convertChild(node.moduleSpecifier),
1622
- specifiers: node.exportClause.elements.map(el => this.convertChild(el, node)),
1628
+ specifiers: this.convertChildren(node.exportClause.elements, node),
1623
1629
  }, 'assertions', 'attributes', true));
1624
1630
  }
1625
1631
  this.assertModuleSpecifier(node, false);
1626
1632
  return this.createNode(node, this.#withDeprecatedAliasGetter({
1627
1633
  type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration,
1628
- attributes: this.convertImportAttributes(
1629
- // eslint-disable-next-line @typescript-eslint/no-deprecated
1630
- node.attributes ?? node.assertClause),
1634
+ attributes: this.convertImportAttributes(node),
1631
1635
  exported: node.exportClause?.kind === SyntaxKind.NamespaceExport
1632
1636
  ? this.convertChild(node.exportClause.name)
1633
1637
  : null,
@@ -1790,7 +1794,7 @@ class Converter {
1790
1794
  }, 'attributes', 'options', true));
1791
1795
  }
1792
1796
  const callee = this.convertChild(node.expression);
1793
- const args = node.arguments.map(el => this.convertChild(el));
1797
+ const args = this.convertChildren(node.arguments);
1794
1798
  const typeArguments = node.typeArguments &&
1795
1799
  this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
1796
1800
  const result = this.createNode(node, {
@@ -1808,9 +1812,7 @@ class Converter {
1808
1812
  // NOTE - NewExpression cannot have an optional chain in it
1809
1813
  return this.createNode(node, {
1810
1814
  type: ts_estree_1.AST_NODE_TYPES.NewExpression,
1811
- arguments: node.arguments
1812
- ? node.arguments.map(el => this.convertChild(el))
1813
- : [],
1815
+ arguments: this.convertChildren(node.arguments ?? []),
1814
1816
  callee: this.convertChild(node.expression),
1815
1817
  typeArguments,
1816
1818
  });
@@ -1929,14 +1931,14 @@ class Converter {
1929
1931
  case SyntaxKind.JsxElement:
1930
1932
  return this.createNode(node, {
1931
1933
  type: ts_estree_1.AST_NODE_TYPES.JSXElement,
1932
- children: node.children.map(el => this.convertChild(el)),
1934
+ children: this.convertChildren(node.children),
1933
1935
  closingElement: this.convertChild(node.closingElement),
1934
1936
  openingElement: this.convertChild(node.openingElement),
1935
1937
  });
1936
1938
  case SyntaxKind.JsxFragment:
1937
1939
  return this.createNode(node, {
1938
1940
  type: ts_estree_1.AST_NODE_TYPES.JSXFragment,
1939
- children: node.children.map(el => this.convertChild(el)),
1941
+ children: this.convertChildren(node.children),
1940
1942
  closingFragment: this.convertChild(node.closingFragment),
1941
1943
  openingFragment: this.convertChild(node.openingFragment),
1942
1944
  });
@@ -1952,7 +1954,7 @@ class Converter {
1952
1954
  openingElement: this.createNode(node, {
1953
1955
  type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
1954
1956
  range: (0, node_utils_1.getRange)(node, this.ast),
1955
- attributes: node.attributes.properties.map(el => this.convertChild(el)),
1957
+ attributes: this.convertChildren(node.attributes.properties),
1956
1958
  name: this.convertJSXTagName(node.tagName, node),
1957
1959
  selfClosing: true,
1958
1960
  typeArguments: node.typeArguments
@@ -1964,7 +1966,7 @@ class Converter {
1964
1966
  case SyntaxKind.JsxOpeningElement: {
1965
1967
  return this.createNode(node, {
1966
1968
  type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
1967
- attributes: node.attributes.properties.map(el => this.convertChild(el)),
1969
+ attributes: this.convertChildren(node.attributes.properties),
1968
1970
  name: this.convertJSXTagName(node.tagName, node),
1969
1971
  selfClosing: false,
1970
1972
  typeArguments: node.typeArguments &&
@@ -2081,7 +2083,7 @@ class Converter {
2081
2083
  case SyntaxKind.TypeLiteral: {
2082
2084
  return this.createNode(node, {
2083
2085
  type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral,
2084
- members: node.members.map(el => this.convertChild(el)),
2086
+ members: this.convertChildren(node.members),
2085
2087
  });
2086
2088
  }
2087
2089
  case SyntaxKind.ArrayType: {
@@ -2170,7 +2172,7 @@ class Converter {
2170
2172
  return this.createNode(node, {
2171
2173
  type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
2172
2174
  accessibility: (0, node_utils_1.getTSNodeAccessibility)(node),
2173
- parameters: node.parameters.map(el => this.convertChild(el)),
2175
+ parameters: this.convertChildren(node.parameters),
2174
2176
  readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node),
2175
2177
  static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
2176
2178
  typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node),
@@ -2250,7 +2252,7 @@ class Converter {
2250
2252
  body: this.createNode(node, {
2251
2253
  type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody,
2252
2254
  range: [node.members.pos - 1, node.end],
2253
- body: node.members.map(member => this.convertChild(member)),
2255
+ body: this.convertChildren(node.members),
2254
2256
  }),
2255
2257
  declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
2256
2258
  extends: interfaceExtends,
@@ -2356,7 +2358,7 @@ class Converter {
2356
2358
  return result;
2357
2359
  }
2358
2360
  case SyntaxKind.EnumDeclaration: {
2359
- const members = node.members.map(el => this.convertChild(el));
2361
+ const members = this.convertChildren(node.members);
2360
2362
  const result = this.createNode(node, this.#withDeprecatedGetter({
2361
2363
  type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration,
2362
2364
  body: this.createNode(node, {
@@ -2367,7 +2369,7 @@ class Converter {
2367
2369
  const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node),
2368
2370
  declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
2369
2371
  id: this.convertChild(node.name),
2370
- }, 'members', `'body.members'`, node.members.map(el => this.convertChild(el))));
2372
+ }, 'members', `'body.members'`, this.convertChildren(node.members)));
2371
2373
  return this.fixExports(node, result);
2372
2374
  }
2373
2375
  case SyntaxKind.EnumMember: {
@@ -2481,13 +2483,13 @@ class Converter {
2481
2483
  case SyntaxKind.UnionType: {
2482
2484
  return this.createNode(node, {
2483
2485
  type: ts_estree_1.AST_NODE_TYPES.TSUnionType,
2484
- types: node.types.map(el => this.convertChild(el)),
2486
+ types: this.convertChildren(node.types),
2485
2487
  });
2486
2488
  }
2487
2489
  case SyntaxKind.IntersectionType: {
2488
2490
  return this.createNode(node, {
2489
2491
  type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType,
2490
- types: node.types.map(el => this.convertChild(el)),
2492
+ types: this.convertChildren(node.types),
2491
2493
  });
2492
2494
  }
2493
2495
  case SyntaxKind.AsExpression: {
@@ -2553,7 +2555,7 @@ class Converter {
2553
2555
  }
2554
2556
  // Tuple
2555
2557
  case SyntaxKind.TupleType: {
2556
- const elementTypes = node.elements.map(el => this.convertChild(el));
2558
+ const elementTypes = this.convertChildren(node.elements);
2557
2559
  return this.createNode(node, {
2558
2560
  type: ts_estree_1.AST_NODE_TYPES.TSTupleType,
2559
2561
  elementTypes,
@@ -2680,7 +2682,7 @@ class Converter {
2680
2682
  }
2681
2683
  const decorators = (0, getModifiers_1.getDecorators)(node);
2682
2684
  if (decorators?.length) {
2683
- result.decorators = decorators.map(el => this.convertChild(el));
2685
+ result.decorators = this.convertChildren(decorators);
2684
2686
  }
2685
2687
  // keys we never want to clone from the base typescript node as they
2686
2688
  // introduce garbage into our AST
@@ -2710,7 +2712,7 @@ class Converter {
2710
2712
  .filter(([key]) => !KEYS_TO_NOT_COPY.has(key))
2711
2713
  .forEach(([key, value]) => {
2712
2714
  if (Array.isArray(value)) {
2713
- result[key] = value.map(el => this.convertChild(el));
2715
+ result[key] = this.convertChildren(value);
2714
2716
  }
2715
2717
  else if (value && typeof value === 'object' && value.kind) {
2716
2718
  // need to check node[key].kind to ensure we don't try to convert a symbol
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/typescript-estree",
3
- "version": "8.44.0",
3
+ "version": "8.44.1-alpha.1",
4
4
  "description": "A parser that converts TypeScript source code into an ESTree compatible form",
5
5
  "files": [
6
6
  "dist",
@@ -52,10 +52,10 @@
52
52
  "typecheck": "yarn run -BT nx typecheck"
53
53
  },
54
54
  "dependencies": {
55
- "@typescript-eslint/project-service": "8.44.0",
56
- "@typescript-eslint/tsconfig-utils": "8.44.0",
57
- "@typescript-eslint/types": "8.44.0",
58
- "@typescript-eslint/visitor-keys": "8.44.0",
55
+ "@typescript-eslint/project-service": "8.44.1-alpha.1",
56
+ "@typescript-eslint/tsconfig-utils": "8.44.1-alpha.1",
57
+ "@typescript-eslint/types": "8.44.1-alpha.1",
58
+ "@typescript-eslint/visitor-keys": "8.44.1-alpha.1",
59
59
  "debug": "^4.3.4",
60
60
  "fast-glob": "^3.3.2",
61
61
  "is-glob": "^4.0.3",