@angular-eslint/bundled-angular-compiler 20.1.2-alpha.17 → 20.1.2-alpha.18

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 +72 -27
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -279,7 +279,7 @@ __export(index_exports, {
279
279
  });
280
280
  module.exports = __toCommonJS(index_exports);
281
281
 
282
- // ../../node_modules/.pnpm/@angular+compiler@20.1.0/node_modules/@angular/compiler/fesm2022/compiler.mjs
282
+ // ../../node_modules/.pnpm/@angular+compiler@20.1.1/node_modules/@angular/compiler/fesm2022/compiler.mjs
283
283
  var _SELECTOR_REGEXP = new RegExp(
284
284
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
285
285
  // 8: ","
@@ -3236,6 +3236,7 @@ var Identifiers = class {
3236
3236
  static InputSignalBrandWriteType = { name: "\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE", moduleName: CORE };
3237
3237
  static UnwrapDirectiveSignalInputs = { name: "\u0275UnwrapDirectiveSignalInputs", moduleName: CORE };
3238
3238
  static unwrapWritableSignal = { name: "\u0275unwrapWritableSignal", moduleName: CORE };
3239
+ static assertType = { name: "\u0275assertType", moduleName: CORE };
3239
3240
  };
3240
3241
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
3241
3242
  function dashCaseToCamelCase(input) {
@@ -5072,8 +5073,9 @@ var Element$1 = class Element {
5072
5073
  sourceSpan;
5073
5074
  startSourceSpan;
5074
5075
  endSourceSpan;
5076
+ isVoid;
5075
5077
  i18n;
5076
- constructor(name, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
5078
+ constructor(name, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, isVoid, i18n2) {
5077
5079
  this.name = name;
5078
5080
  this.attributes = attributes;
5079
5081
  this.inputs = inputs;
@@ -5085,6 +5087,7 @@ var Element$1 = class Element {
5085
5087
  this.sourceSpan = sourceSpan;
5086
5088
  this.startSourceSpan = startSourceSpan;
5087
5089
  this.endSourceSpan = endSourceSpan;
5090
+ this.isVoid = isVoid;
5088
5091
  this.i18n = i18n2;
5089
5092
  }
5090
5093
  visit(visitor) {
@@ -12450,7 +12453,8 @@ var Element2 = class extends NodeWithI18n {
12450
12453
  isSelfClosing;
12451
12454
  startSourceSpan;
12452
12455
  endSourceSpan;
12453
- constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n2) {
12456
+ isVoid;
12457
+ constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, isVoid, i18n2) {
12454
12458
  super(sourceSpan, i18n2);
12455
12459
  this.name = name;
12456
12460
  this.attrs = attrs;
@@ -12459,6 +12463,7 @@ var Element2 = class extends NodeWithI18n {
12459
12463
  this.isSelfClosing = isSelfClosing;
12460
12464
  this.startSourceSpan = startSourceSpan;
12461
12465
  this.endSourceSpan = endSourceSpan;
12466
+ this.isVoid = isVoid;
12462
12467
  }
12463
12468
  visit(visitor, context) {
12464
12469
  return visitor.visitElement(this, context);
@@ -14822,6 +14827,20 @@ var CharacterReferenceType;
14822
14827
  CharacterReferenceType2["HEX"] = "hexadecimal";
14823
14828
  CharacterReferenceType2["DEC"] = "decimal";
14824
14829
  })(CharacterReferenceType || (CharacterReferenceType = {}));
14830
+ var SUPPORTED_BLOCKS = [
14831
+ "@if",
14832
+ "@else",
14833
+ // Covers `@else if` as well
14834
+ "@for",
14835
+ "@switch",
14836
+ "@case",
14837
+ "@default",
14838
+ "@empty",
14839
+ "@defer",
14840
+ "@placeholder",
14841
+ "@loading",
14842
+ "@error"
14843
+ ];
14825
14844
  var _Tokenizer = class {
14826
14845
  static {
14827
14846
  __name(this, "_Tokenizer");
@@ -14898,9 +14917,9 @@ var _Tokenizer = class {
14898
14917
  }
14899
14918
  } else if (this._tokenizeLet && // Use `peek` instead of `attempCharCode` since we
14900
14919
  // don't want to advance in case it's not `@let`.
14901
- this._cursor.peek() === $AT && !this._inInterpolation && this._attemptStr("@let")) {
14920
+ this._cursor.peek() === $AT && !this._inInterpolation && this._isLetStart()) {
14902
14921
  this._consumeLetDeclaration(start);
14903
- } else if (this._tokenizeBlocks && this._attemptCharCode($AT)) {
14922
+ } else if (this._tokenizeBlocks && this._isBlockStart()) {
14904
14923
  this._consumeBlockStart(start);
14905
14924
  } else if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansionCase() && !this._isInExpansionForm() && this._attemptCharCode($RBRACE)) {
14906
14925
  this._consumeBlockEnd(start);
@@ -14933,6 +14952,7 @@ var _Tokenizer = class {
14933
14952
  return this._cursor.getChars(nameCursor).trim();
14934
14953
  }
14935
14954
  _consumeBlockStart(start) {
14955
+ this._requireCharCode($AT);
14936
14956
  this._beginToken(24, start);
14937
14957
  const startToken = this._endToken([this._getBlockName()]);
14938
14958
  if (this._cursor.peek() === $LPAREN) {
@@ -14994,6 +15014,7 @@ var _Tokenizer = class {
14994
15014
  }
14995
15015
  }
14996
15016
  _consumeLetDeclaration(start) {
15017
+ this._requireStr("@let");
14997
15018
  this._beginToken(29, start);
14998
15019
  if (isWhitespace(this._cursor.peek())) {
14999
15020
  this._attemptCharCodeUntilFn(isNotWhitespace);
@@ -15193,6 +15214,26 @@ var _Tokenizer = class {
15193
15214
  this._cursor.advance();
15194
15215
  return char;
15195
15216
  }
15217
+ _peekStr(chars) {
15218
+ const len = chars.length;
15219
+ if (this._cursor.charsLeft() < len) {
15220
+ return false;
15221
+ }
15222
+ const cursor = this._cursor.clone();
15223
+ for (let i = 0; i < len; i++) {
15224
+ if (cursor.peek() !== chars.charCodeAt(i)) {
15225
+ return false;
15226
+ }
15227
+ cursor.advance();
15228
+ }
15229
+ return true;
15230
+ }
15231
+ _isBlockStart() {
15232
+ return this._cursor.peek() === $AT && SUPPORTED_BLOCKS.some((blockName) => this._peekStr(blockName));
15233
+ }
15234
+ _isLetStart() {
15235
+ return this._cursor.peek() === $AT && this._peekStr("@let");
15236
+ }
15196
15237
  _consumeEntity(textTokenType) {
15197
15238
  this._beginToken(
15198
15239
  9
@@ -15726,7 +15767,7 @@ var _Tokenizer = class {
15726
15767
  return true;
15727
15768
  }
15728
15769
  }
15729
- if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._cursor.peek() === $AT || this._cursor.peek() === $RBRACE)) {
15770
+ if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._isBlockStart() || this._isLetStart() || this._cursor.peek() === $RBRACE)) {
15730
15771
  return true;
15731
15772
  }
15732
15773
  return false;
@@ -16319,11 +16360,11 @@ var _TreeBuilder = class __TreeBuilder {
16319
16360
  const directives = [];
16320
16361
  this._consumeAttributesAndDirectives(attrs, directives);
16321
16362
  const fullName = this._getElementFullName(startTagToken, this._getClosestElementLikeParent());
16363
+ const tagDef = this._getTagDefinition(fullName);
16322
16364
  let selfClosing = false;
16323
16365
  if (this._peek.type === 2) {
16324
16366
  this._advance();
16325
16367
  selfClosing = true;
16326
- const tagDef = this._getTagDefinition(fullName);
16327
16368
  if (!(tagDef?.canSelfClose || getNsPrefix(fullName) !== null || tagDef?.isVoid)) {
16328
16369
  this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`));
16329
16370
  }
@@ -16334,7 +16375,7 @@ var _TreeBuilder = class __TreeBuilder {
16334
16375
  const end = this._peek.sourceSpan.fullStart;
16335
16376
  const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
16336
16377
  const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
16337
- const el = new Element2(fullName, attrs, directives, [], selfClosing, span, startSpan, void 0);
16378
+ const el = new Element2(fullName, attrs, directives, [], selfClosing, span, startSpan, void 0, tagDef?.isVoid ?? false);
16338
16379
  const parent = this._getContainer();
16339
16380
  const isClosedByChild = parent !== null && !!this._getTagDefinition(parent)?.isClosedByChild(el.name);
16340
16381
  this._pushContainer(el, isClosedByChild);
@@ -16684,11 +16725,11 @@ var WhitespaceVisitor = class {
16684
16725
  }
16685
16726
  visitElement(element2, context) {
16686
16727
  if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
16687
- const newElement2 = new Element2(element2.name, visitAllWithSiblings(this, element2.attrs), visitAllWithSiblings(this, element2.directives), element2.children, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
16728
+ const newElement2 = new Element2(element2.name, visitAllWithSiblings(this, element2.attrs), visitAllWithSiblings(this, element2.directives), element2.children, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.isVoid, element2.i18n);
16688
16729
  this.originalNodeMap?.set(newElement2, element2);
16689
16730
  return newElement2;
16690
16731
  }
16691
- const newElement = new Element2(element2.name, element2.attrs, element2.directives, visitAllWithSiblings(this, element2.children), element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
16732
+ const newElement = new Element2(element2.name, element2.attrs, element2.directives, visitAllWithSiblings(this, element2.children), element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.isVoid, element2.i18n);
16692
16733
  this.originalNodeMap?.set(newElement, element2);
16693
16734
  return newElement;
16694
16735
  }
@@ -18201,12 +18242,13 @@ var _ParseAST = class {
18201
18242
  } else {
18202
18243
  if (this.isAssignmentOperator(this.next)) {
18203
18244
  const operation = this.next.strValue;
18204
- this.advance();
18205
18245
  if (!(this.parseFlags & 1)) {
18246
+ this.advance();
18206
18247
  this.error("Bindings cannot contain assignments");
18207
18248
  return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
18208
18249
  }
18209
18250
  const receiver = new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
18251
+ this.advance();
18210
18252
  const value = this.parseConditional();
18211
18253
  return new Binary(this.span(start), this.sourceSpan(start), operation, receiver, value);
18212
18254
  } else {
@@ -18307,11 +18349,12 @@ var _ParseAST = class {
18307
18349
  this.expectCharacter($RBRACKET);
18308
18350
  if (this.isAssignmentOperator(this.next)) {
18309
18351
  const operation = this.next.strValue;
18310
- this.advance();
18311
18352
  if (isSafe) {
18353
+ this.advance();
18312
18354
  this.error("The '?.' operator cannot be used in the assignment");
18313
18355
  } else {
18314
18356
  const binaryReceiver = new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);
18357
+ this.advance();
18315
18358
  const value = this.parseConditional();
18316
18359
  return new Binary(this.span(start), this.sourceSpan(start), operation, binaryReceiver, value);
18317
18360
  }
@@ -26047,7 +26090,7 @@ var HtmlAstToIvyAst = class {
26047
26090
  ], children, references, variables, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
26048
26091
  } else {
26049
26092
  const attrs = this.categorizePropertyAttributes(element2.name, parsedProperties, i18nAttrsMeta);
26050
- parsedElement = new Element$1(element2.name, attributes, attrs.bound, boundEvents, directives, children, references, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
26093
+ parsedElement = new Element$1(element2.name, attributes, attrs.bound, boundEvents, directives, children, references, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.isVoid, element2.i18n);
26051
26094
  }
26052
26095
  if (elementHasInlineTemplate) {
26053
26096
  parsedElement = this.wrapInTemplate(parsedElement, templateParsedProperties, templateVariables, i18nAttrsMeta, isTemplateElement, isI18nRootElement);
@@ -26536,7 +26579,8 @@ var NonBindableVisitor = class {
26536
26579
  ast.isSelfClosing,
26537
26580
  ast.sourceSpan,
26538
26581
  ast.startSourceSpan,
26539
- ast.endSourceSpan
26582
+ ast.endSourceSpan,
26583
+ ast.isVoid
26540
26584
  );
26541
26585
  }
26542
26586
  visitComment(comment) {
@@ -26589,7 +26633,8 @@ var NonBindableVisitor = class {
26589
26633
  ast.isSelfClosing,
26590
26634
  ast.sourceSpan,
26591
26635
  ast.startSourceSpan,
26592
- ast.endSourceSpan
26636
+ ast.endSourceSpan,
26637
+ false
26593
26638
  );
26594
26639
  }
26595
26640
  visitDirective(directive, context) {
@@ -28855,7 +28900,7 @@ var _Visitor3 = class {
28855
28900
  merge(nodes, translations, interpolationConfig) {
28856
28901
  this._init(_VisitorMode.Merge, interpolationConfig);
28857
28902
  this._translations = translations;
28858
- const wrapper = new Element2("wrapper", [], [], nodes, false, void 0, void 0, void 0);
28903
+ const wrapper = new Element2("wrapper", [], [], nodes, false, void 0, void 0, void 0, false);
28859
28904
  const translatedNode = wrapper.visit(this, null);
28860
28905
  if (this._inI18nBlock) {
28861
28906
  this._reportError(nodes[nodes.length - 1], "Unclosed block");
@@ -29022,7 +29067,7 @@ var _Visitor3 = class {
29022
29067
  this._inImplicitNode = wasInImplicitNode;
29023
29068
  if (this._mode === _VisitorMode.Merge) {
29024
29069
  if (node instanceof Element2) {
29025
- return new Element2(node.name, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
29070
+ return new Element2(node.name, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.isVoid);
29026
29071
  } else {
29027
29072
  return new Component2(node.componentName, node.tagName, node.fullName, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
29028
29073
  }
@@ -30497,7 +30542,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
30497
30542
  function compileDeclareClassMetadata(metadata) {
30498
30543
  const definitionMap = new DefinitionMap();
30499
30544
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
30500
- definitionMap.set("version", literal("20.1.0"));
30545
+ definitionMap.set("version", literal("20.1.1"));
30501
30546
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30502
30547
  definitionMap.set("type", metadata.type);
30503
30548
  definitionMap.set("decorators", metadata.decorators);
@@ -30516,7 +30561,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
30516
30561
  callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
30517
30562
  callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
30518
30563
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
30519
- definitionMap.set("version", literal("20.1.0"));
30564
+ definitionMap.set("version", literal("20.1.1"));
30520
30565
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30521
30566
  definitionMap.set("type", metadata.type);
30522
30567
  definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
@@ -30585,7 +30630,7 @@ function createDirectiveDefinitionMap(meta) {
30585
30630
  const definitionMap = new DefinitionMap();
30586
30631
  const minVersion = getMinimumVersionForPartialOutput(meta);
30587
30632
  definitionMap.set("minVersion", literal(minVersion));
30588
- definitionMap.set("version", literal("20.1.0"));
30633
+ definitionMap.set("version", literal("20.1.1"));
30589
30634
  definitionMap.set("type", meta.type.value);
30590
30635
  if (meta.isStandalone !== void 0) {
30591
30636
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -30912,7 +30957,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
30912
30957
  function compileDeclareFactoryFunction(meta) {
30913
30958
  const definitionMap = new DefinitionMap();
30914
30959
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
30915
- definitionMap.set("version", literal("20.1.0"));
30960
+ definitionMap.set("version", literal("20.1.1"));
30916
30961
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30917
30962
  definitionMap.set("type", meta.type.value);
30918
30963
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -30935,7 +30980,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
30935
30980
  function createInjectableDefinitionMap(meta) {
30936
30981
  const definitionMap = new DefinitionMap();
30937
30982
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
30938
- definitionMap.set("version", literal("20.1.0"));
30983
+ definitionMap.set("version", literal("20.1.1"));
30939
30984
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30940
30985
  definitionMap.set("type", meta.type.value);
30941
30986
  if (meta.providedIn !== void 0) {
@@ -30973,7 +31018,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
30973
31018
  function createInjectorDefinitionMap(meta) {
30974
31019
  const definitionMap = new DefinitionMap();
30975
31020
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
30976
- definitionMap.set("version", literal("20.1.0"));
31021
+ definitionMap.set("version", literal("20.1.1"));
30977
31022
  definitionMap.set("ngImport", importExpr(Identifiers.core));
30978
31023
  definitionMap.set("type", meta.type.value);
30979
31024
  definitionMap.set("providers", meta.providers);
@@ -30997,7 +31042,7 @@ function createNgModuleDefinitionMap(meta) {
30997
31042
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
30998
31043
  }
30999
31044
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
31000
- definitionMap.set("version", literal("20.1.0"));
31045
+ definitionMap.set("version", literal("20.1.1"));
31001
31046
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31002
31047
  definitionMap.set("type", meta.type.value);
31003
31048
  if (meta.bootstrap.length > 0) {
@@ -31032,7 +31077,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
31032
31077
  function createPipeDefinitionMap(meta) {
31033
31078
  const definitionMap = new DefinitionMap();
31034
31079
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
31035
- definitionMap.set("version", literal("20.1.0"));
31080
+ definitionMap.set("version", literal("20.1.1"));
31036
31081
  definitionMap.set("ngImport", importExpr(Identifiers.core));
31037
31082
  definitionMap.set("type", meta.type.value);
31038
31083
  if (meta.isStandalone !== void 0) {
@@ -31129,7 +31174,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
31129
31174
  return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
31130
31175
  }
31131
31176
  __name(compileHmrUpdateCallback, "compileHmrUpdateCallback");
31132
- var VERSION = new Version("20.1.0");
31177
+ var VERSION = new Version("20.1.1");
31133
31178
  publishFacade(_global);
31134
31179
  // Annotate the CommonJS export names for ESM import in node:
31135
31180
  0 && (module.exports = {
@@ -31393,7 +31438,7 @@ publishFacade(_global);
31393
31438
 
31394
31439
  @angular/compiler/fesm2022/compiler.mjs:
31395
31440
  (**
31396
- * @license Angular v20.1.0
31441
+ * @license Angular v20.1.1
31397
31442
  * (c) 2010-2025 Google LLC. https://angular.io/
31398
31443
  * License: MIT
31399
31444
  *)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "20.1.2-alpha.17",
3
+ "version": "20.1.2-alpha.18",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",