@depup/angular-eslint__eslint-plugin 22.5.0-depup.0 → 22.6.0-depup.0

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/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/angular-eslint__eslint-plugin
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@angular-eslint/eslint-plugin](https://www.npmjs.com/package/@angular-eslint/eslint-plugin) @ 22.5.0 |
17
- | Processed | 2026-09-08 |
16
+ | Original | [@angular-eslint/eslint-plugin](https://www.npmjs.com/package/@angular-eslint/eslint-plugin) @ 22.6.0 |
17
+ | Processed | 2026-10-11 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 1 |
20
20
 
package/changes.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "to": "^2.5.0"
6
6
  }
7
7
  },
8
- "timestamp": "2026-09-08T00:32:21.861Z",
8
+ "timestamp": "2026-10-11T16:09:47.801Z",
9
9
  "totalUpdated": 1
10
10
  }
package/dist/index.d.ts CHANGED
@@ -122,7 +122,7 @@ declare const _default: {
122
122
  }], import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
123
123
  name: string;
124
124
  };
125
- "prefer-standalone": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/prefer-standalone").MessageIds, [], import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
125
+ "prefer-standalone": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/prefer-standalone").MessageIds, import("./rules/prefer-standalone").Options, import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
126
126
  name: string;
127
127
  };
128
128
  "reactive-context-must-read-signal": import("@typescript-eslint/utils/ts-eslint").RuleModule<"mustReadSignal", import("./rules/reactive-context-must-read-signal").Options, import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
@@ -1 +1 @@
1
- {"version":3,"file":"component-selector.d.ts","sourceRoot":"","sources":["../../src/rules/component-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,uBAAuB,CAAC;AAK/B,MAAM,MAAM,OAAO,GAAG,SAAS;IAC7B,aAAa,CAAC,kBAAkB,GAAG,aAAa,CAAC,oBAAoB;CACtE,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,uBAAuB,GACvB,aAAa,GACb,mCAAmC,GACnC,4BAA4B,CAAC;AACjC,eAAO,MAAM,SAAS,uBAAuB,CAAC;;;;AAS9C,wBAgOG;AAiBH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
1
+ {"version":3,"file":"component-selector.d.ts","sourceRoot":"","sources":["../../src/rules/component-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,uBAAuB,CAAC;AAK/B,MAAM,MAAM,OAAO,GAAG,SAAS;IAC7B,aAAa,CAAC,kBAAkB,GAAG,aAAa,CAAC,oBAAoB;CACtE,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,uBAAuB,GACvB,aAAa,GACb,mCAAmC,GACnC,4BAA4B,CAAC;AACjC,eAAO,MAAM,SAAS,uBAAuB,CAAC;;;;AAS9C,wBAsOG;AAiBH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
@@ -39,7 +39,10 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
39
39
  ],
40
40
  },
41
41
  prefix: {
42
- oneOf: [{ type: 'string' }, { type: 'array' }],
42
+ oneOf: [
43
+ { type: 'string' },
44
+ { type: 'array', items: { type: 'string' } },
45
+ ],
43
46
  },
44
47
  style: {
45
48
  type: 'string',
@@ -66,7 +69,10 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
66
69
  ],
67
70
  },
68
71
  prefix: {
69
- oneOf: [{ type: 'string' }, { type: 'array' }],
72
+ oneOf: [
73
+ { type: 'string' },
74
+ { type: 'array', items: { type: 'string' } },
75
+ ],
70
76
  },
71
77
  style: {
72
78
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"directive-selector.d.ts","sourceRoot":"","sources":["../../src/rules/directive-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,uBAAuB,CAAC;AAI/B,MAAM,MAAM,OAAO,GAAG,SAAS;IAC7B,aAAa,CAAC,kBAAkB,GAAG,aAAa,CAAC,oBAAoB;CACtE,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,aAAa,GACb,4BAA4B,CAAC;AACjC,eAAO,MAAM,SAAS,uBAAuB,CAAC;;;;AAE9C,wBA6KG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
1
+ {"version":3,"file":"directive-selector.d.ts","sourceRoot":"","sources":["../../src/rules/directive-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,uBAAuB,CAAC;AAI/B,MAAM,MAAM,OAAO,GAAG,SAAS;IAC7B,aAAa,CAAC,kBAAkB,GAAG,aAAa,CAAC,oBAAoB;CACtE,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,aAAa,GACb,4BAA4B,CAAC;AACjC,eAAO,MAAM,SAAS,uBAAuB,CAAC;;;;AAE9C,wBAmLG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
@@ -34,7 +34,10 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
34
34
  ],
35
35
  },
36
36
  prefix: {
37
- oneOf: [{ type: 'string' }, { type: 'array' }],
37
+ oneOf: [
38
+ { type: 'string' },
39
+ { type: 'array', items: { type: 'string' } },
40
+ ],
38
41
  },
39
42
  style: {
40
43
  type: 'string',
@@ -61,7 +64,10 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
61
64
  ],
62
65
  },
63
66
  prefix: {
64
- oneOf: [{ type: 'string' }, { type: 'array' }],
67
+ oneOf: [
68
+ { type: 'string' },
69
+ { type: 'array', items: { type: 'string' } },
70
+ ],
65
71
  },
66
72
  style: {
67
73
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"prefer-signal-model.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-signal-model.ts"],"names":[],"mappings":"AASA,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvE,KAAK,OAAO,GAAG;IACb;QACE,eAAe,EAAE,OAAO,CAAC;KAC1B;CACF,CAAC;AAMF,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAC7C,eAAO,MAAM,SAAS,wBAAwB,CAAC;;;;AA8B/C,wBAuKG;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":"AASA,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvE,KAAK,OAAO,GAAG;IACb;QACE,eAAe,EAAE,OAAO,CAAC;KAC1B;CACF,CAAC;AAMF,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAC7C,eAAO,MAAM,SAAS,wBAAwB,CAAC;;;;AA+C/C,wBAiMG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
@@ -12,6 +12,18 @@ const DEFAULT_OPTIONS = {
12
12
  useTypeChecking: false,
13
13
  };
14
14
  exports.RULE_NAME = 'prefer-signal-model';
15
+ function getEmitCallee(reference) {
16
+ const { parent } = reference;
17
+ return parent?.type === utils_2.AST_NODE_TYPES.MemberExpression &&
18
+ parent.object === reference &&
19
+ !parent.computed &&
20
+ parent.property.type === utils_2.AST_NODE_TYPES.Identifier &&
21
+ parent.property.name === 'emit' &&
22
+ parent.parent?.type === utils_2.AST_NODE_TYPES.CallExpression &&
23
+ parent.parent.callee === parent
24
+ ? parent
25
+ : undefined;
26
+ }
15
27
  function hasTransformOption(options) {
16
28
  return (options?.type === utils_2.AST_NODE_TYPES.ObjectExpression &&
17
29
  options.properties.some((property) => property.type === utils_2.AST_NODE_TYPES.Property &&
@@ -49,6 +61,7 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
49
61
  const { sourceCode } = context;
50
62
  const inputs = new Map();
51
63
  const outputs = new Map();
64
+ const thisReferences = new Map();
52
65
  let services;
53
66
  function getTypeServices() {
54
67
  return (services ??= utils_2.ESLintUtils.getParserServices(context));
@@ -114,32 +127,49 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
114
127
  "PropertyDefinition > CallExpression[callee.name='input']": createSignalCollector(inputs, { hasInitialValueArgument: true }),
115
128
  "PropertyDefinition > CallExpression[callee.object.name='input'][callee.property.name='required']": createSignalCollector(inputs, { hasInitialValueArgument: false }),
116
129
  "PropertyDefinition > CallExpression[callee.name='output']": createSignalCollector(outputs, { hasInitialValueArgument: false }),
130
+ 'MemberExpression[object.type="ThisExpression"][computed=false][property.type="Identifier"]'(node) {
131
+ const { name } = node.property;
132
+ const references = thisReferences.get(name);
133
+ if (references) {
134
+ references.push(node);
135
+ }
136
+ else {
137
+ thisReferences.set(name, [node]);
138
+ }
139
+ },
117
140
  'ClassDeclaration:exit'() {
118
141
  const twoWayBindings = [...inputs]
119
142
  .map(([name, input]) => ({
143
+ name,
120
144
  input,
121
145
  output: outputs.get(`${name}Change`),
122
146
  }))
123
147
  .filter((binding) => binding.output !== undefined &&
124
148
  haveMergeableTypes(binding.input, binding.output));
125
- for (const { input, output } of twoWayBindings) {
149
+ for (const { name, input, output } of twoWayBindings) {
150
+ const emitCallees = (thisReferences.get(`${name}Change`) ?? []).map(getEmitCallee);
151
+ const isRewritable = emitCallees.every(utils_1.isNotNullOrUndefined);
126
152
  context.report({
127
153
  node: input.property,
128
154
  messageId: 'preferSignalModel',
129
- fix: (fixer) => [
130
- utils_1.RuleFixes.getImportAddFix({
131
- fixer,
132
- importName: 'model',
133
- moduleName: '@angular/core',
134
- node: input.property,
135
- }),
136
- fixer.replaceText(input.callee, 'model'),
137
- fixer.remove(output.property),
138
- ].filter(utils_1.isNotNullOrUndefined),
155
+ fix: isRewritable
156
+ ? (fixer) => [
157
+ utils_1.RuleFixes.getImportAddFix({
158
+ fixer,
159
+ importName: 'model',
160
+ moduleName: '@angular/core',
161
+ node: input.property,
162
+ }),
163
+ fixer.replaceText(input.callee, 'model'),
164
+ fixer.remove(output.property),
165
+ ...emitCallees.map((callee) => fixer.replaceText(callee, `this.${name}.set`)),
166
+ ].filter(utils_1.isNotNullOrUndefined)
167
+ : undefined,
139
168
  });
140
169
  }
141
170
  inputs.clear();
142
171
  outputs.clear();
172
+ thisReferences.clear();
143
173
  },
144
174
  };
145
175
  },
@@ -1,7 +1,9 @@
1
- export type Options = [];
2
- export type MessageIds = 'preferStandalone' | 'removeStandaloneFalse';
1
+ export type Options = [{
2
+ readonly allowExplicitStandalone?: boolean;
3
+ }];
4
+ export type MessageIds = 'preferStandalone' | 'removeStandaloneFalse' | 'redundantStandalone';
3
5
  export declare const RULE_NAME = "prefer-standalone";
4
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, [], import("../utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
6
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
5
7
  name: string;
6
8
  };
7
9
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"prefer-standalone.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-standalone.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;AACtE,eAAO,MAAM,SAAS,sBAAsB,CAAC;;;;AAK7C,wBAkEG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
1
+ {"version":3,"file":"prefer-standalone.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-standalone.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,CAAC;IAAE,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEvE,MAAM,MAAM,UAAU,GACpB,kBAAkB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC;AACvE,eAAO,MAAM,SAAS,sBAAsB,CAAC;;;;AAM7C,wBAiGG;AAEH,eAAO,MAAM,mBAAmB;;CAG/B,CAAC"}
@@ -4,6 +4,7 @@ exports.RULE_DOCS_EXTENSION = exports.RULE_NAME = void 0;
4
4
  const utils_1 = require("@angular-eslint/utils");
5
5
  const create_eslint_rule_1 = require("../utils/create-eslint-rule");
6
6
  exports.RULE_NAME = 'prefer-standalone';
7
+ const DEFAULT_OPTIONS = { allowExplicitStandalone: true };
7
8
  const RECOMMENDED_GUIDE_URL = 'https://angular.dev/reference/migrations/standalone';
8
9
  exports.default = (0, create_eslint_rule_1.createESLintRule)({
9
10
  name: exports.RULE_NAME,
@@ -13,25 +14,48 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
13
14
  description: `Ensures Components, Directives and Pipes do not opt out of standalone.`,
14
15
  recommended: 'recommended',
15
16
  },
17
+ fixable: 'code',
16
18
  hasSuggestions: true,
17
- schema: [],
19
+ schema: [
20
+ {
21
+ type: 'object',
22
+ properties: {
23
+ allowExplicitStandalone: {
24
+ type: 'boolean',
25
+ default: DEFAULT_OPTIONS.allowExplicitStandalone,
26
+ description: 'Whether to allow a Component, Directive or Pipe to set `standalone: true` explicitly even though it is now the default.',
27
+ },
28
+ },
29
+ additionalProperties: false,
30
+ },
31
+ ],
18
32
  messages: {
19
33
  preferStandalone: `Components, Directives and Pipes should not opt out of standalone. Following this guide is highly recommended: ${RECOMMENDED_GUIDE_URL}`,
20
34
  removeStandaloneFalse: `Quickly remove 'standalone: false'. NOTE - Following this guide is highly recommended: ${RECOMMENDED_GUIDE_URL}`,
35
+ redundantStandalone: '`standalone: true` is redundant because `standalone: true` is the default',
21
36
  },
22
- defaultOptions: [],
37
+ defaultOptions: [DEFAULT_OPTIONS],
23
38
  },
24
- create(context) {
39
+ create(context, [{ allowExplicitStandalone }]) {
25
40
  const standaloneRuleFactory = (type) => (node) => {
26
41
  const standalone = utils_1.ASTUtils.getDecoratorPropertyValue(node, 'standalone');
27
- // Leave the standalone property alone if it was set to true or not present
28
- if (!standalone ||
29
- (utils_1.ASTUtils.isLiteral(standalone) && standalone.value === true)) {
42
+ if (!standalone) {
30
43
  return;
31
44
  }
32
45
  if (!utils_1.ASTUtils.getDecoratorArgument(node)) {
33
46
  return;
34
47
  }
48
+ if (utils_1.ASTUtils.isLiteral(standalone) && standalone.value === true) {
49
+ if (allowExplicitStandalone) {
50
+ return;
51
+ }
52
+ context.report({
53
+ node: standalone.parent,
54
+ messageId: 'redundantStandalone',
55
+ fix: (fixer) => utils_1.RuleFixes.getNodeToCommaRemoveFix(context.sourceCode, standalone.parent, fixer),
56
+ });
57
+ return;
58
+ }
35
59
  context.report({
36
60
  node: standalone.parent,
37
61
  messageId: 'preferStandalone',
@@ -62,5 +86,5 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
62
86
  },
63
87
  });
64
88
  exports.RULE_DOCS_EXTENSION = {
65
- rationale: 'Standalone components, directives, and pipes are the recommended way to build Angular applications. Setting standalone: false opts out of the standalone API, tying your code to the older NgModule-based architecture. Standalone components simplify Angular applications by eliminating the need for NgModules in most cases, reducing boilerplate and making dependencies more explicit. Each standalone component declares its own dependencies directly, making it self-contained and easier to understand, test, and reuse. Standalone components also enable better tree-shaking and lazy loading. Angular provides comprehensive migration guides to help transition existing applications, such as https://angular.dev/reference/migrations/standalone. New projects should use standalone components from the start, and existing projects should avoid adding new non-standalone components as they will make future migrations harder.',
89
+ rationale: 'Standalone components, directives, and pipes are the recommended way to build Angular applications. Setting standalone: false opts out of the standalone API, tying your code to the older NgModule-based architecture. Standalone components simplify Angular applications by eliminating the need for NgModules in most cases, reducing boilerplate and making dependencies more explicit. Each standalone component declares its own dependencies directly, making it self-contained and easier to understand, test, and reuse. Standalone components also enable better tree-shaking and lazy loading. Angular provides comprehensive migration guides to help transition existing applications, such as https://angular.dev/reference/migrations/standalone. New projects should use standalone components from the start, and existing projects should avoid adding new non-standalone components as they will make future migrations harder. As of Angular v19, `standalone: true` is the default for components, directives, and pipes, so declaring `standalone: true` explicitly is redundant; set `allowExplicitStandalone` to `false` to have the rule flag and autofix redundant `standalone: true` declarations too.',
66
90
  };
@@ -313,13 +313,11 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
313
313
  }
314
314
  }
315
315
  // Register this call if it is one of the reactive contexts.
316
- if (node.callee.type !== utils_1.AST_NODE_TYPES.Identifier) {
316
+ if (node.callee.type !== utils_1.AST_NODE_TYPES.Identifier ||
317
+ !Object.hasOwn(primitives, node.callee.name)) {
317
318
  return;
318
319
  }
319
320
  const config = primitives[node.callee.name];
320
- if (!config) {
321
- return;
322
- }
323
321
  const newAnalysis = {
324
322
  call: node,
325
323
  primitiveName: node.callee.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/angular-eslint__eslint-plugin",
3
- "version": "22.5.0-depup.0",
3
+ "version": "22.6.0-depup.0",
4
4
  "description": "ESLint plugin for Angular applications, following https://angular.dev/style-guide (with updated dependencies)",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -20,12 +20,12 @@
20
20
  "changes.json"
21
21
  ],
22
22
  "dependencies": {
23
- "@angular-eslint/bundled-angular-compiler": "22.5.0",
24
- "@angular-eslint/utils": "22.5.0",
23
+ "@angular-eslint/bundled-angular-compiler": "22.6.0",
24
+ "@angular-eslint/utils": "22.6.0",
25
25
  "ts-api-utils": "^2.5.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@angular-eslint/test-utils": "22.5.0"
28
+ "@angular-eslint/test-utils": "22.6.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@typescript-eslint/utils": "^8.0.0",
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "depsUpdated": 1,
52
52
  "originalPackage": "@angular-eslint/eslint-plugin",
53
- "originalVersion": "22.5.0",
54
- "processedAt": "2026-09-08T00:32:29.877Z",
53
+ "originalVersion": "22.6.0",
54
+ "processedAt": "2026-10-11T16:09:52.435Z",
55
55
  "smokeTest": "passed"
56
56
  }
57
57
  }