@angular-eslint/eslint-plugin 22.2.1-alpha.4 → 22.2.1-alpha.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"no-implicit-take-until-destroyed.d.ts","sourceRoot":"","sources":["../../src/rules/no-implicit-take-until-destroyed.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AACzB,MAAM,MAAM,UAAU,GAAG,8BAA8B,CAAC;AACxD,eAAO,MAAM,SAAS,qCAAqC,CAAC;;;;AAO5D,wBAgCG;AAwMH,eAAO,MAAM,mBAAmB;;CAE/B,CAAC"}
1
+ {"version":3,"file":"no-implicit-take-until-destroyed.d.ts","sourceRoot":"","sources":["../../src/rules/no-implicit-take-until-destroyed.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AACzB,MAAM,MAAM,UAAU,GAAG,8BAA8B,CAAC;AACxD,eAAO,MAAM,SAAS,qCAAqC,CAAC;;;;AAO5D,wBAgCG;AAiNH,eAAO,MAAM,mBAAmB;;CAE/B,CAAC"}
@@ -89,16 +89,26 @@ function isMethodCalledFromInjectionContext(method, classDeclaration) {
89
89
  return false;
90
90
  }
91
91
  const isPrivateField = method.key.type === utils_2.AST_NODE_TYPES.PrivateIdentifier;
92
+ let isCalledFromInjectionContext = false;
92
93
  for (const member of classDeclaration.body.body) {
93
- if (!isConstructorMethod(member) &&
94
- !utils_1.ASTUtils.isPropertyDefinition(member)) {
94
+ // Ignore recursive calls from the method to itself
95
+ if (member === method) {
95
96
  continue;
96
97
  }
97
- if (containsCallToMethod(member, methodName, isPrivateField)) {
98
- return true;
98
+ if (!containsCallToMethod(member, methodName, isPrivateField)) {
99
+ continue;
100
+ }
101
+ if (isConstructorMethod(member) || utils_1.ASTUtils.isPropertyDefinition(member)) {
102
+ isCalledFromInjectionContext = true;
103
+ }
104
+ else {
105
+ // The method is also called from somewhere that is not an injection
106
+ // context (e.g. a lifecycle hook or a regular method), so we cannot
107
+ // assume that `takeUntilDestroyed()` will always run within one.
108
+ return false;
99
109
  }
100
110
  }
101
- return false;
111
+ return isCalledFromInjectionContext;
102
112
  }
103
113
  function isASTNode(value) {
104
114
  return (value !== null &&
@@ -1 +1 @@
1
- {"version":3,"file":"prefer-signal-model.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-signal-model.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAC7C,eAAO,MAAM,SAAS,wBAAwB,CAAC;;;;AAE/C,wBA0EG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
1
+ {"version":3,"file":"prefer-signal-model.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-signal-model.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAC7C,eAAO,MAAM,SAAS,wBAAwB,CAAC;;;;AAE/C,wBA4FG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
@@ -23,6 +23,18 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
23
23
  const outputs = new Map();
24
24
  return {
25
25
  "PropertyDefinition > CallExpression[callee.name='input']"(node) {
26
+ // Skip inputs with a transform option because model() does not support transform.
27
+ // https://github.com/angular/angular/issues/55166#issuecomment-2032150999
28
+ const options = node.arguments[1];
29
+ const hasTransformOption = options?.type === 'ObjectExpression' &&
30
+ options.properties.some((prop) => prop.type === 'Property' &&
31
+ ((prop.key.type === 'Identifier' &&
32
+ prop.key.name === 'transform') ||
33
+ (prop.key.type === 'Literal' &&
34
+ prop.key.value === 'transform')));
35
+ if (hasTransformOption) {
36
+ return;
37
+ }
26
38
  const propertyDef = node.parent;
27
39
  const propertyName = utils_1.ASTUtils.getPropertyDefinitionName(propertyDef);
28
40
  inputs.set(propertyName, propertyDef);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/eslint-plugin",
3
- "version": "22.2.1-alpha.4",
3
+ "version": "22.2.1-alpha.6",
4
4
  "description": "ESLint plugin for Angular applications, following https://angular.dev/style-guide",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,12 +19,12 @@
19
19
  "LICENSE"
20
20
  ],
21
21
  "dependencies": {
22
- "@angular-eslint/bundled-angular-compiler": "22.2.1-alpha.4",
23
- "@angular-eslint/utils": "22.2.1-alpha.4",
22
+ "@angular-eslint/bundled-angular-compiler": "22.2.1-alpha.6",
23
+ "@angular-eslint/utils": "22.2.1-alpha.6",
24
24
  "ts-api-utils": "^2.1.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@angular-eslint/test-utils": "22.2.1-alpha.4"
27
+ "@angular-eslint/test-utils": "22.2.1-alpha.6"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@typescript-eslint/utils": "^8.0.0",