@ngcompass/rules
Advanced tools
@@ -1,2 +0,2 @@ | ||
| 'use strict';var planner=require('@ngcompass/planner'),engine=require('@ngcompass/engine'),common=require('@ngcompass/common'),M=require('typescript'),ast=require('@ngcompass/ast');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var M__default=/*#__PURE__*/_interopDefault(M);var Ht=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var zt={severity:"warn",options:{}},ve=class{_handlers=new Map;_meta=new Map;register(e,r={}){if(this._handlers.has(e.name)&&!r.allowOverride)throw Error(`[ngcompass] Rule "${e.name}" is already registered. Use allowOverride: true to replace an existing rule intentionally.`);this._handlers.set(e.name,e.handler),e.meta&&this._meta.set(e.name,e.meta);}get(e){return this._handlers.get(e)}has(e){return this._handlers.has(e)}getRuleNames(){return Array.from(this._handlers.keys())}getAll(){return this._handlers}getMeta(e){return this._meta.get(e)}getMetadata(e){if(!this._handlers.has(e))return;let r=this._meta.get(e)??{};return {name:e,description:r.description??`Rule: ${e}`,category:r.category??"general",dependencyType:r.dependencyType??"standalone",requires:{tsAst:true,...r.requires},filePatterns:r.filePatterns}}getRegistryEntry(e){let r=this.getMetadata(e);if(r)return {name:e,metadata:r,defaultConfig:zt}}toReadonlyMap(){let e=new Map;for(let r of this._handlers.keys()){let n=this.getRegistryEntry(r);n&&e.set(r,n);}return e}get size(){return this._handlers.size}},Ce=null,J=()=>(Ce||(Ce=new ve),Ce);var R=(t,e)=>{let r={name:t.name,handler:t,meta:{dependencyType:"component",...t.meta,category:e??t.meta?.category??"best-practice",requires:t.meta?.requires??{}}};J().register(r),common.debug("engine",`Registered rule: ${t.name}`);},Ke=t=>J().has(t),Xe=(t,e)=>{let r=J(),n=[];for(let f of t){let d=r.get(f);d&&n.push(d);}if(n.length===0)return [];common.debug("engine",`Executing ${n.length} rules in single pass on ${e.filePath}`);let{results:a,performance:s}=engine.runSinglePassAnalysis(n,e);common.debug("engine",`Single-pass complete: ${s.traversalMs.toFixed(2)}ms, ${s.nodesVisited} nodes`);let c=s.cacheStats.hits+s.cacheStats.misses;if(c>0){let f=s.cacheStats.hits/c*100;common.debug("engine",`Component metadata cache hit rate: ${f.toFixed(1)}%`);}return s.budgetViolations.length>0&&common.debug("engine",`Performance budget violations: ${s.budgetViolations.join("; ")}`),a};var x={"prefer-on-push-component-change-detection":"Add `changeDetection: ChangeDetectionStrategy.OnPush` to the component metadata.","template-no-call-expression":"Move the value to a pipe, computed signal, or cached component property.","rxjs-no-subscribe-in-component":"Use `toSignal()` or the `async` pipe for view state; add `takeUntilDestroyed()` for long-lived imperative subscriptions.","template-trackby-required":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-trackby-required-for-ngfor":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-no-object-literal-binding":"Move the object to a component property, signal, computed value, or pure pipe.","template-no-array-literal-binding":"Move the array to a component property, signal, computed value, or pure pipe.","toSignal-require-initialValue":"Pass `{ initialValue }` or `{ requireSync: true }` so the signal has a stable type.","rxjs-avoid-subject-as-event-bus":"Use `signal()` for component UI state; move complex async pipelines into a service.","signal-no-side-effects-in-computed":"Move side effects to an `effect()` or method, and keep `computed()` pure.","signal-no-writes-in-computed":"Move `.set()` or `.update()` calls to an `effect()` or event handler.","prefer-inject-over-constructor-di":"Replace constructor parameters with field initializers that call `inject()`.","component-no-manual-detect-changes":"Use signals, `async` pipe, or input-driven state instead of calling `detectChanges()` or `markForCheck()`.","rxjs-require-takeUntilDestroyed":"Add `takeUntilDestroyed()` or another teardown operator before `subscribe()`.","template-no-async-pipe-duplication":"Store the async value once with `@if (... | async; as value)` or a view-model signal.","rxjs-prefer-toSignal-for-template-state":"Convert template-used observables to `toSignal()` and read them as signals in the template.","signal-effect-must-be-destroy-scoped":"Create the effect in an injection context or pass an explicit `{ injector }`.","signal-no-effect-in-constructor":"Move the `effect()` call to a field initializer.","signal-prefer-computed-over-sync-effect":"Replace the write-producing `effect()` with a `computed()` signal.","signal-avoid-untracked-overuse":"Remove `untracked()` unless the dependency must be intentionally ignored.","template-prefer-control-flow":"Replace the legacy directive with the matching `@if`, `@for`, or `@switch` block.","signal-prefer-input-signal":"Replace `@Input()` with `input()` or `input.required()`.","signal-prefer-output-function":"Replace `@Output() EventEmitter` with `output<T>()`.","no-bypass-sanitization":"Use Angular sanitization or a trusted server-side sanitizer instead of `bypassSecurityTrust*`.","rxjs-no-nested-subscribe":"Flatten the stream with `switchMap`, `mergeMap`, `concatMap`, or `exhaustMap`.","no-document-access":"Inject `DOCUMENT` or move browser-only DOM work into `afterNextRender()`.","template-no-unsafe-bindings":"Sanitize the value before binding, or replace the raw HTML binding with structured template content.","signal-prefer-model":"Replace the `@Input()` / `@Output()Change` pair with `model()`.","prefer-after-render-over-after-view-init":"Move browser-only DOM access into `afterNextRender()`.","spec-no-focused-test":"Replace focused or disabled test helpers with normal `describe` and `it` calls."},P={"prefer-on-push-component-change-detection":`// Before: | ||
| 'use strict';var planner=require('@ngcompass/planner'),engine=require('@ngcompass/engine'),common=require('@ngcompass/common'),M=require('typescript'),ast=require('@ngcompass/ast');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var M__default=/*#__PURE__*/_interopDefault(M);var zt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Wt={severity:"warn",options:{}},ve=class{_handlers=new Map;_meta=new Map;register(e,r={}){if(this._handlers.has(e.name)&&!r.allowOverride)throw Error(`[ngcompass] Rule "${e.name}" is already registered. Use allowOverride: true to replace an existing rule intentionally.`);this._handlers.set(e.name,e.handler),e.meta&&this._meta.set(e.name,e.meta);}get(e){return this._handlers.get(e)}has(e){return this._handlers.has(e)}getRuleNames(){return Array.from(this._handlers.keys())}getAll(){return this._handlers}getMeta(e){return this._meta.get(e)}getMetadata(e){if(!this._handlers.has(e))return;let r=this._meta.get(e)??{};return {name:e,description:r.description??`Rule: ${e}`,category:r.category??"general",dependencyType:r.dependencyType??"standalone",requires:{tsAst:true,...r.requires},filePatterns:r.filePatterns}}getRegistryEntry(e){let r=this.getMetadata(e);if(r)return {name:e,metadata:r,defaultConfig:Wt}}toReadonlyMap(){let e=new Map;for(let r of this._handlers.keys()){let n=this.getRegistryEntry(r);n&&e.set(r,n);}return e}get size(){return this._handlers.size}},Ce=null,J=()=>(Ce||(Ce=new ve),Ce);var R=(t,e)=>{let r={name:t.name,handler:t,meta:{dependencyType:"component",...t.meta,category:e??t.meta?.category??"best-practice",requires:t.meta?.requires??{}}};J().register(r),common.debug("engine",`Registered rule: ${t.name}`);},Ke=t=>J().has(t),Xe=(t,e)=>{let r=J(),n=[];for(let f of t){let d=r.get(f);d&&n.push(d);}if(n.length===0)return [];common.debug("engine",`Executing ${n.length} rules in single pass on ${e.filePath}`);let{results:a,performance:s}=engine.runSinglePassAnalysis(n,e);common.debug("engine",`Single-pass complete: ${s.traversalMs.toFixed(2)}ms, ${s.nodesVisited} nodes`);let c=s.cacheStats.hits+s.cacheStats.misses;if(c>0){let f=s.cacheStats.hits/c*100;common.debug("engine",`Component metadata cache hit rate: ${f.toFixed(1)}%`);}return s.budgetViolations.length>0&&common.debug("engine",`Performance budget violations: ${s.budgetViolations.join("; ")}`),a};var x={"prefer-on-push-component-change-detection":"Add `changeDetection: ChangeDetectionStrategy.OnPush` to the component metadata.","template-no-call-expression":"Move the value to a pipe, computed signal, or cached component property.","rxjs-no-subscribe-in-component":"Use `toSignal()` or the `async` pipe for view state; add `takeUntilDestroyed()` for long-lived imperative subscriptions.","template-trackby-required":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-trackby-required-for-ngfor":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-no-object-literal-binding":"Move the object to a component property, signal, computed value, or pure pipe.","template-no-array-literal-binding":"Move the array to a component property, signal, computed value, or pure pipe.","toSignal-require-initialValue":"Pass `{ initialValue }` or `{ requireSync: true }` so the signal has a stable type.","rxjs-avoid-subject-as-event-bus":"Use `signal()` for component UI state; move complex async pipelines into a service.","signal-no-side-effects-in-computed":"Move side effects to an `effect()` or method, and keep `computed()` pure.","signal-no-writes-in-computed":"Move `.set()` or `.update()` calls to an `effect()` or event handler.","prefer-inject-over-constructor-di":"Replace constructor parameters with field initializers that call `inject()`.","component-no-manual-detect-changes":"Use signals, `async` pipe, or input-driven state instead of calling `detectChanges()` or `markForCheck()`.","rxjs-require-takeUntilDestroyed":"Add `takeUntilDestroyed()` or another teardown operator before `subscribe()`.","template-no-async-pipe-duplication":"Store the async value once with `@if (... | async; as value)` or a view-model signal.","rxjs-prefer-toSignal-for-template-state":"Convert template-used observables to `toSignal()` and read them as signals in the template.","signal-effect-must-be-destroy-scoped":"Create the effect in an injection context or pass an explicit `{ injector }`.","signal-no-effect-in-constructor":"Move the `effect()` call to a field initializer.","signal-prefer-computed-over-sync-effect":"Replace the write-producing `effect()` with a `computed()` signal.","signal-avoid-untracked-overuse":"Remove `untracked()` unless the dependency must be intentionally ignored.","template-prefer-control-flow":"Replace the legacy directive with the matching `@if`, `@for`, or `@switch` block.","signal-prefer-input-signal":"Replace `@Input()` with `input()` or `input.required()`.","signal-prefer-output-function":"Replace `@Output() EventEmitter` with `output<T>()`.","no-bypass-sanitization":"Use Angular sanitization or a trusted server-side sanitizer instead of `bypassSecurityTrust*`.","rxjs-no-nested-subscribe":"Flatten the stream with `switchMap`, `mergeMap`, `concatMap`, or `exhaustMap`.","no-document-access":"Inject `DOCUMENT` or move browser-only DOM work into `afterNextRender()`.","template-no-unsafe-bindings":"Sanitize the value before binding, or replace the raw HTML binding with structured template content.","signal-prefer-model":"Replace the `@Input()` / `@Output()Change` pair with `model()`.","prefer-after-render-over-after-view-init":"Move browser-only DOM access into `afterNextRender()`.","spec-no-focused-test":"Replace focused or disabled test helpers with normal `describe` and `it` calls."},P={"prefer-on-push-component-change-detection":`// Before: | ||
| @Component({ selector: 'app-foo', template: '...' }) | ||
@@ -216,3 +216,3 @@ export class FooComponent { } | ||
| it('should render', () => { ... }); | ||
| });`};var Ge;function g(t){let e=t;for(;e;){let r=e.type;if(r==="ChainExpression"||r==="TSNonNullExpression"||r==="TSAsExpression"||r==="ParenthesizedExpression"||r==="TSInstantiationExpression"||r==="TSSatisfiesExpression"){e=e.expression;continue}break}return e??null}function C(t){let e=t?.type;return e==="MemberExpression"||e==="StaticMemberExpression"||e==="OptionalMemberExpression"}function N(t){if(!t)return "";let e=t.property;return e?t.computed?e.type==="Literal"&&typeof e.value=="string"?e.value:"":e.name??"":""}function b(t){return t?t.start??t.span?.start??0:0}function T(t,e){let r=g(t);return !!r&&(r.type==="Identifier"?(r.name??"")===e:!!C(r)&&N(r)===e)}function Ne(t){let e=g(t);if(!e||e.type!=="CallExpression")return "";let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}function te(t){let e=g(t?.callee);return !!C(e)&&N(e)==="subscribe"}function Y(t,e){if(!t||t.type!=="ObjectExpression")return null;let r=t.properties;if(!Array.isArray(r))return null;for(let n of r){if(!n||n.type!=="Property")continue;let a=n.key;if((a?.type==="Identifier"?a.name:a?.type==="Literal"&&typeof a.value=="string"?a.value:"")===e)return n}return null}function Re(t){let e=g(t);return !!(e&&e.type==="Literal"&&e.value===true)}function we(t){let e=g(t);return !e||e.type==="Literal"&&e.value===null||e.type==="Identifier"&&e.name==="undefined"}var Vt=new Set(["parent","span","loc","range","start","end","type"]);function*O(t){if(t&&typeof t=="object"){if(Array.isArray(t)){for(let e of t)e&&typeof e=="object"&&(yield e);return}for(let e in t){if(Vt.has(e))continue;let r=t[e];if(r)if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&(yield n);else typeof r=="object"&&r.type&&(yield r);}}}function Me(t){if(!t)return false;if(t.kind==="constructor")return true;let e=t.key;return e?.type==="Identifier"&&e.name==="constructor"||e?.type==="Literal"&&e.value==="constructor"}function H(t){if(!t)return false;let e=t.type;return e==="MethodDefinition"||e==="TSAbstractMethodDefinition"||e==="ClassMethod"||e==="MethodDeclaration"}function Qe(t){for(let e of t)if(e&&H(e)&&Me(e))return e;return null}function z(t){return t?(t.value??t)?.body??null:null}function Ze(t){let e=t?.key;return e?e.type==="Identifier"?e.name??"<method>":e.type==="Literal"&&typeof e.value=="string"?e.value:"<method>":"<method>"}function F(t){if(!t)return [];let e=t.body;if(Array.isArray(e))return e;if(e&&typeof e=="object"&&"body"in e){let r=e.body;if(Array.isArray(r))return r}return []}function Kt(t){let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=e.arguments;if(!Array.isArray(r)||r.length<2)return false;let n=g(r[1]);if(!n||n.type!=="ObjectExpression")return false;let a=Y(n,"injector");if(a&&!we(a.value))return true;let s=Y(n,"manualCleanup");return !!(s&&Re(s.value))}function Je(t){if(!t)return [];let e=[],r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&T(n.callee,"effect")&&!Kt(n)&&e.push(n),O(n)))r.push(a);}return e}var Xt=new Set(["takeUntilDestroyed","takeUntil","take","first","takeWhile"]);function Gt(t){let e=g(t);if(!e)return "";if(e.type==="Identifier")return e.name??"";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}return C(e)?N(e):""}function Yt(t){let e=t.arguments;if(!Array.isArray(e))return false;for(let r of e)if(Xt.has(Gt(r)))return true;return false}function re(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)==="pipe"&&Yt(r))return true;e=n?.object;}return false}function I(t,e){return e}var Qt=new Set(["get","post","put","patch","delete","head","options","jsonp","request"]),Zt=new Set(["http","httpClient","_http","_httpClient"]),Jt=["get","fetch","load","save","create","update","delete","remove","submit","send","post","put","patch","upload","download"];function ne(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)!=="pipe")return r;e=n?.object;}return null}function ie(t){if(!t)return false;let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=g(e.callee);if(!C(r))return false;let n=N(r);if(!n)return false;let a=g(r?.object),s=Array.isArray(e.arguments)?e.arguments:[];if(Qt.has(n)&&C(a)){let c=N(a);if(Zt.has(c))return true}if(s.length>0){let c=n.toLowerCase();for(let f of Jt)if(c.startsWith(f)&&n.length>f.length)return true}return false}var Ye=false;function Pe(){if(!Ye){try{Ge=Ht("typescript");}catch{}Ye=true;}return Ge}function et(t,e){if(!t||!e.typeChecker)return;let r=Pe();if(r)try{!e.sourceFile&&e.fileContent&&(e.sourceFile=r.createSourceFile(e.filePath,e.fileContent,r.ScriptTarget.Latest,!0));let n=e.sourceFile;if(!n)return;let a=(function(s,c,f){if(c<s.getStart()||c>=s.getEnd())return;let d=s;for(;;){let p=f.forEachChild(d,i=>{if(c>=i.getStart()&&c<i.getEnd())return i});if(!p)break;d=p;}return d})(n,b(t),r);return a?e.typeChecker.getSymbolAtLocation(a):void 0}catch{return}}function D(t){if(t.sourceFile)return t.sourceFile;if(!t.fileContent)return;let e=Pe();if(e)return t.sourceFile=e.createSourceFile(t.filePath,t.fileContent,e.ScriptTarget.Latest,true),t.sourceFile}var ee=new Map;function oe(t){let e=ee.get(t.filePath);if(e!==void 0)return e;let r=(function(n){let{typeChecker:a,angularTypes:s}=n;if(!a||!s)return false;let c=Pe(),f=D(n);if(!c||!f)return false;for(let d of f.statements){if(!c.isClassDeclaration(d)||!c.canHaveDecorators(d))continue;let p=c.getDecorators(d);if(p)for(let i of p){let l=c.isCallExpression(i.expression)?i.expression.expression:i.expression;if(!c.isIdentifier(l)||l.text!=="Component"&&l.text!=="Directive")continue;let o=a.getSymbolAtLocation(l),u=o&&o.flags&c.SymbolFlags.Alias?a.getAliasedSymbol(o):o;if(s.isFromAngularCore(u))return true}}return false})(t);return ee.size>=1024&&ee.clear(),ee.set(t.filePath,r),r}function Q(t){if(!t)return false;let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib.dom"))return true;return false}var se="component-no-manual-detect-changes",nr=new Set(["detectChanges","markForCheck"]),tt=engine.createAnyAngularClassRule(se,(t,e)=>{let r,n=t.node,a=(r=ast.analyzeComponent(n),r?.type!=="Component"?{isComponent:false,isOnPush:false}:{isComponent:true,isOnPush:r.changeDetection?.kind==="literal"&&r.changeDetection.value===ast.ChangeDetectionStrategy.OnPush});if(!a.isComponent)return null;let{typeChecker:s,angularTypes:c}=e;if(!s||!c)return null;let f=(function(i,l){let o=D(l);if(!o)return;let u=b(i);for(let m of o.statements)if(M__default.default.isClassDeclaration(m)&&m.pos<=u&&u<=m.end)return m})(n,e);if(!f)return null;let d=[],p=i=>{if(M__default.default.isCallExpression(i)){let l=(function(o,u,m,y,h){if(!M__default.default.isPropertyAccessExpression(o.expression))return null;let E=o.expression.name.text;if(!nr.has(E)||y.isOnPush&&E==="markForCheck")return null;let S=u.getTypeAtLocation(o.expression.expression);if(!m.isChangeDetectorRef(S))return null;let{line:A,column:v}=h.locator.location(o.getStart());return {filePath:h.filePath,ruleName:se,message:y.isOnPush?"Manual change detection in an OnPush component couples rendering to imperative calls.":`Manual change detection (${E}) can hide state-flow bugs and make rendering harder to predict.`,line:A,column:v,severity:y.isOnPush?"warn":"error",fix:x[se],codeExample:P[se]}})(i,s,c,a,e);l&&d.push(l);}M__default.default.forEachChild(i,p);};return p(f),d.length>0?d:null});var Te="signal-no-side-effects-in-computed",or=new Set(["set","update","mutate"]),ar=new Set(["next","complete","error"]),rt=engine.createCallExpressionRule(Te,(t,e)=>{var r,n;let a,s;if(!T(t.callee,"computed"))return null;let{typeChecker:c,angularTypes:f}=e;if(!c||!f)return null;let d=(function(l,o){var u;let m,y=(u=l).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M__default.default.createSourceFile(u.filePath,u.fileContent,M__default.default.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!y)return;let h=E=>{if(!m){if(M__default.default.isCallExpression(E)&&E.getStart()===o){m=E;return}M__default.default.forEachChild(E,h);}};return h(y),m})(e,b(t));if(!d)return null;let p=d.arguments[0];if(!p||!(M__default.default.isArrowFunction(p)||M__default.default.isFunctionExpression(p)))return null;let i=(r=p.body,n={typeChecker:c,angularTypes:f},(s=l=>{var o,u,m,y;if(a)return;let h=(o=l,u=n,M__default.default.isBinaryExpression(o)&&(m=o.operatorToken.kind)>=M__default.default.SyntaxKind.FirstAssignment&&m<=M__default.default.SyntaxKind.LastAssignment?Oe(o.left)?{node:o,kind:"write"}:void 0:M__default.default.isPostfixUnaryExpression(o)||M__default.default.isPrefixUnaryExpression(o)?(o.operator===M__default.default.SyntaxKind.PlusPlusToken||o.operator===M__default.default.SyntaxKind.MinusMinusToken)&&Oe(o.operand)?{node:o,kind:"write"}:void 0:M__default.default.isDeleteExpression(o)&&Oe(o.expression)?{node:o,kind:"write"}:M__default.default.isCallExpression(o)?(function(E,S){if(!M__default.default.isPropertyAccessExpression(E.expression))return;let A=E.expression.name.text,v=E.expression.expression,w=S.typeChecker.getTypeAtLocation(v);return or.has(A)&&S.angularTypes.isWritableSignal(w)?{node:E,kind:"write"}:ar.has(A)&&S.angularTypes.isSubjectLike(w)||S.angularTypes.isHttpClient(w)?{node:E,kind:"effect"}:void 0})(o,u):void 0);if(h){a=h;return}y=l,M__default.default.isArrowFunction(y)||M__default.default.isFunctionExpression(y)||M__default.default.isFunctionDeclaration(y)||M__default.default.isMethodDeclaration(y)||M__default.default.isGetAccessorDeclaration(y)||M__default.default.isSetAccessorDeclaration(y)||M__default.default.forEachChild(l,s);})(r),a);return i?(function(l,o,u){let m=l.node.getStart(),{line:y,column:h}=u.locator.location(m||b(o));return {filePath:u.filePath,ruleName:Te,message:l.kind==="write"?"computed() writes to state, which can create reactive cycles.":"computed() contains a side effect, so it is no longer a pure derivation.",line:y,column:h,severity:"error",fix:x[Te]}})(i,t,e):null},{requires:{typeChecker:true}});function Oe(t){return M__default.default.isPropertyAccessExpression(t)||M__default.default.isElementAccessExpression(t)}var ke="signal-effect-must-be-destroy-scoped",nt=engine.createAnyAngularClassRule(ke,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let n=[];for(let a of r)a&&H(a)&&!Me(a)&&n.push(...(function(s,c){let f=z(s);if(!f)return [];let d=Ze(s),p=[];for(let i of Je(f))(function(l){if(l.type!=="CallExpression")return false;let o=g(l.callee);return !!o&&(o.type==="Identifier"?o.name==="effect":!!C(o)&&N(o)==="effect")})(i)&&!(function(l){let o=g((Array.isArray(l.arguments)?l.arguments:[])[1]);if(!o||o.type!=="ObjectExpression")return false;for(let u of Array.isArray(o.properties)?o.properties:[]){let m=g(u);if(m?.type==="Property"){let y=g(m.key),h=y?.type==="Identifier"?y.name:N(y)||"";if(h==="injector")return true;if(h==="manualCleanup"){let E=g(m.value);if(E?.type==="Literal"&&E.value===true)return true}}}return false})(i)&&p.push((function(l,o,u){let m=b(l),{line:y,column:h}=u.locator.location(m);return {filePath:u.filePath,ruleName:ke,message:`effect() inside "${o}" has no explicit lifecycle owner, so cleanup can be unclear.`,line:y,column:h,severity:"error",fix:x[ke]}})(i,d,c));return p})(a,e));return n.length>0?n:null});var le="rxjs-no-nested-subscribe",ur=new Set(["next","error","complete"]),cr=new Set(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"]);function De(t){if(t.type!=="CallExpression")return false;let e=g(t.callee);return !!C(e)&&N(e)==="subscribe"}function it(t){return !!t&&(t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression")}var ot=engine.createCallExpressionRule(le,(t,e)=>{if(!De(t))return null;for(let r of (function(n){if(!De(n))return [];let a=Array.isArray(n.arguments)?n.arguments:[];if(a.length===0)return [];let s=g(a[0]);if(s?.type==="ObjectExpression"){if(s.type!=="ObjectExpression")return [];let f=[];for(let d of Array.isArray(s.properties)?s.properties:[]){let p=g(d);if(p?.type==="Property"&&ur.has((function(i){let l=g(i.key);return l?l.type==="Identifier"?l.name:N(l)||"":""})(p))){let i=g(p.value);it(i)&&f.push(i);}}return f}let c=[];for(let f=0;f<Math.min(a.length,3);f++){let d=g(a[f]);it(d)&&c.push(d);}return c})(t)){let n=g(r.body);if(n&&(function(a){let s=[a];for(;s.length>0;){var c;let f=g(s.pop());if(f){if(f!==a&&De(f))return true;if(!(f!==a&&(c=f).type&&cr.has(c.type)))for(let d of O(f))s.push(d);}}return false})(n))return (function(a,s){let c=b(a),{line:f,column:d}=s.locator.location(c);return {filePath:s.filePath,ruleName:le,message:"Nested subscribe() calls make stream lifetimes harder to reason about and can leak work.",line:f,column:d,severity:"error",fix:x[le],codeExample:P[le]}})(t,e)}return null});var ue="prefer-on-push-component-change-detection";function ce(t,e){let r=t?.[e];return typeof r=="number"?r:void 0}function Ie(t){return t.replace(/\\/g,"/")}var at=engine.createComponentRule(ue,(t,e)=>{let r=t.metadata??{};return r.type!=="Component"||!(function(n){if(!n||typeof n!="object")return false;let{kind:a,value:s}=n;return a!=="non-literal"&&(a==="literal"?s!==ast.ChangeDetectionStrategy.OnPush:a==="missing")})(r.changeDetection)?null:(function(n,a){let s,c,f,d,p=(s=n.metadata??{},c=n.node,ce(s,"decoratorStart")??ce(s,"start")??ce(c,"start")??ce(n,"start")??0),{line:i,column:l}=a.locator.location(p),o=(f=n.metadata,typeof(d=f?.className)=="string"?d:"AnonymousComponent"),u=(function(m,y){if(!y.project)return null;let h=m.metadata,E=h?.className;if(typeof E!="string"||!E)return null;let S=Ie(y.filePath),{ngModuleMap:A,classToFile:v}=y.project;for(let[w,L]of A){if(L.isStandalone||!L.declarations.has(E))continue;let k=v.get(E);if(!k||Ie(k)===S)return {moduleName:(Ie(w).split("/").pop()??w).replace(/\.ts$/,""),siblingDeclarationCount:Math.max(0,L.declarations.size-1)}}return null})(n,a);return {filePath:a.filePath,ruleName:ue,message:(function(m,y){let h=`Component '${m}' uses default change detection, which can re-render more often than needed.`;if(!y)return h;let{moduleName:E,siblingDeclarationCount:S}=y;return S===0?`${h} It is declared in '${E}'.`:`${h} It is declared in '${E}' alongside ${S} other declaration${S===1?"":"s"}.`})(o,u),line:i,column:l,severity:"error",fix:x[ue],codeExample:P[ue]}})(t,e)},{requires:{projectContext:true}});var Le="template-no-call-expression",gr=new Set(["translate","$localize","$any"]),yr=new Set(["slice","toString","toFixed","toUpperCase","toLowerCase","trim","join","includes","indexOf","startsWith","endsWith","charAt","substring","replace","split","concat","toISOString","toLocaleDateString","toLocaleTimeString","toLocaleString"]);function st(t){let e=g(t);return !!e&&(e.type==="CallExpression"||e.type==="OptionalCallExpression")}var lt=engine.createTemplateExpressionRule(Le,(t,e)=>(function(r,n){let a=r?[r]:[];for(;a.length>0;){let s=g(a.pop());if(s){if(st(s)&&!(function(c){let f=g(c);if(!f||!st(f))return false;let d=g(f.callee);if(!d)return false;if(d.type==="Identifier")return gr.has(d.name);if(!C(d))return false;let p=N(d);return !!p&&yr.has(p)})(s)){if((function(f){let d=g(f);return Array.isArray(d?.arguments)?d.arguments:[]})(s).length>0)return true;let c=(function(f){let d=g(f);if(!d)return "";let p=g(d.callee);return p?p.type==="Identifier"?p.name??"":C(p)?N(p):"":""})(s);if(c&&!(function(f,d){if(d.crossRef?.signalMembers?.has(f))return true;let{typeChecker:p,angularTypes:i,crossRef:l}=d;if(!p||!i||!l?.componentPath)return false;let o=(function(u,m,y){let h=y.getProgram?.(),E=h?.getSourceFile(m);if(!E)return;let S=E.statements.find(M__default.default.isClassDeclaration);if(!S)return;let A=y.getTypeAtLocation(S),v=y.getPropertyOfType(A,u);if(!v)return;let w=v.valueDeclaration??v.declarations?.[0];if(w)return y.getTypeOfSymbolAtLocation(v,w)})(f,l.componentPath,p);return !!o&&i.isSignal(o)})(c,n))return true}for(let c of O(s))a.push(c);}}return false})(t.expression,e)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Le,message:"Template method calls run on every change detection cycle and can make rendering slower.",line:s,column:c,severity:"error",fix:x[Le]}})(t,e)]:null,{requires:{htmlAst:true,typeChecker:true,projectContext:true}});function ut(t,e,r,n){let a=I(t,e.sourceSpan.start),{line:s,column:c}=t.locator.location(a);return {filePath:t.filePath,ruleName:r,message:n,line:s,column:c,severity:"error",fix:x[r]}}var ct=engine.createTemplateRule("template-trackby-required",(t,e)=>{let r=[];for(let n of t.attributes)n.name==="*ngFor"&&!(function(a){return !!a.match(/\btrackBy\s*:\s*([^;]+?)\s*(?:;|$)/)?.[1]?.trim()})(n.value??"")&&r.push(ut(e,n,"template-trackby-required-for-ngfor","*ngFor without trackBy can recreate DOM nodes unnecessarily when list items change."));for(let n of t.blocks)n.name!=="for"||n.parameters.some(a=>{let s=a.expression?.trim()??"";return !!s&&!!/^track\b/.test(s)&&s.replace(/^track\b/,"").trim().length>0})||r.push(ut(e,n,"template-track-required-for-atfor","@for without a track expression can recreate DOM nodes unnecessarily when list items change."));return r.length>0?r:null},{requires:{htmlAst:true}});var je="template-no-object-literal-binding",pt=engine.createTemplateExpressionRule(je,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ObjectExpression")return true;for(let s of O(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:je,message:"Object literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[je]}})(t,e)]:null,{requires:{htmlAst:true}});var Fe="template-no-array-literal-binding",ft=engine.createTemplateExpressionRule(Fe,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ArrayExpression")return true;for(let s of O(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Fe,message:"Array literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[Fe]}})(t,e)]:null,{requires:{htmlAst:true}});var _e=new Map([["bypassSecurityTrustHtml","HTML"],["bypassSecurityTrustScript","Script"],["bypassSecurityTrustStyle","Style"],["bypassSecurityTrustUrl","URL"],["bypassSecurityTrustResourceUrl","Resource URL"]]),mt=engine.createCallExpressionRule("no-bypass-sanitization",(t,e)=>{let r=(function(s){let c=g(s.callee);if(!c)return null;if(c.type==="Identifier"&&c.name)return _e.has(c.name)?c.name:null;if(C(c)){let f=N(c);return f&&_e.has(f)?f:null}return null})(t);if(!r)return null;let{line:n,column:a}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"no-bypass-sanitization",message:`\`${r}\` bypasses Angular's ${_e.get(r)} sanitization, which can expose unsafe content.`,line:n,column:a,severity:"error",fix:x["no-bypass-sanitization"]}});var Ar=new Map([["[innerHTML]",{desc:"innerHTML directly renders HTML markup and can execute injected scripts",severity:"error"}],["[outerHTML]",{desc:"outerHTML replaces the element with raw HTML and is susceptible to XSS",severity:"error"}],["[srcdoc]",{desc:"srcdoc embeds raw HTML inside an iframe and can execute injected scripts",severity:"error"}],["[style]",{desc:"binding complex expressions to [style] can enable CSS injection",severity:"warn"}]]),Cr=/\|\s*(safeHtml|safeStyle|safeUrl|safeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|trustStyle|trustUrl|trustResourceUrl|bypassSecurity)\b/i,vr=/\b(getSafeHtml|getSafeUrl|getSafeStyle|getSafeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|bypassSecurity)\s*\(/i,dt=engine.createTemplateAttributeRule("template-no-unsafe-bindings",(t,e)=>{let r=Ar.get(t.name);if(!r)return null;let n=t.value??"";if(Cr.test(n)||vr.test(n)||t.name==="[style]"&&!/[.(|?]/.test(n))return null;let{line:a,column:s}=e.locator.location(I(e,t.sourceSpan.start));return {filePath:e.filePath,ruleName:"template-no-unsafe-bindings",message:`\`${t.name}\` binds raw content: ${r.desc}. Unsanitized values can create injection risk.`,line:a,column:s,severity:r.severity,fix:x["template-no-unsafe-bindings"]}},{requires:{htmlAst:true}});var pe="no-document-access",Rr=new Set(["document","window","localStorage","sessionStorage","navigator","location"]),gt=engine.createAnyAngularClassRule(pe,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let{typeChecker:n}=e;if(!n)return null;let a=D(e);if(!a)return null;let s=(function(p){let i=new Set,l=[...p];for(;l.length;){let o=g(l.pop());if(o){if(o.type==="VariableDeclarator"&&o.init){let u=g(o.init);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=o.id??o.key;m?.type==="Identifier"&&m.name&&i.add(m.name);}}if(o.type==="AssignmentExpression"&&o.right){let u=g(o.right);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=g(o.left);if(m&&C(m)&&g(m.object)?.type==="ThisExpression"){let y=m.property?.name;typeof y=="string"&&y&&i.add(y);}}}for(let u of O(o))l.push(u);}}return i})(r),c=[],f=new Set,d=[...r];for(;d.length;){let p=g(d.pop());if(p){if(p.type==="IfStatement"&&p.test){let i=g(p.test);if(i){let l=(function(o,u){let m=[o];for(;m.length;){let y=g(m.pop());if(y){if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformBrowser"))return "browser";if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformServer"))return "server";if(y.type==="UnaryExpression"&&y.operator==="!"&&y.argument){let h=g(y.argument);if(h?.type==="CallExpression"&&h.callee&&T(h.callee,"isPlatformServer"))return "browser"}if(y.type==="Identifier"&&u.has(y.name))return "browser";for(let h of O(y))m.push(h);}}return null})(i,s);if(l==="browser"){p.alternate&&d.push(p.alternate);continue}if(l==="server"){p.consequent&&d.push(p.consequent);continue}}}if(p.type==="CallExpression"&&p.callee){let i=g(p.callee);if(i&&(T(i,"afterNextRender")||T(i,"afterRender"))){let l=p.arguments??[];for(let o=1;o<l.length;o++)d.push(l[o]);continue}}if(C(p)){let i=(function(o){let u=o;for(;u&&C(u);)u=g(u.object);return u?.type==="Identifier"?u:null})(p),l=i?.name;if(i&&l&&Rr.has(l)&&(function(o,u,m){let y=(function(E,S){let A,v=w=>{if(!A){if(M__default.default.isIdentifier(w)&&w.getStart()===S){A=w;return}M__default.default.forEachChild(w,v);}};return v(E),A})(u,b(o));if(!y)return false;let h=m.getSymbolAtLocation(y);return Q((h&&h.flags&M__default.default.SymbolFlags.Alias?m.getAliasedSymbol(h):h)??void 0)})(i,a,n)){let o=b(i);if(o!==void 0&&!f.has(o)){f.add(o);let{line:u,column:m}=e.locator.location(o);c.push({filePath:e.filePath,ruleName:pe,message:`Direct access to \`${l}\` can run during SSR where browser globals do not exist.`,line:u,column:m,severity:"error",fix:x[pe],codeExample:P[pe]});}}}for(let i of O(p))d.push(i);}}return c.length?c:null},{requires:{typeChecker:true}});var fe="prefer-after-render-over-after-view-init",Mr=new Set(["ngAfterViewInit","ngAfterContentInit"]),ht=engine.createAnyAngularClassRule(fe,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r}=e;if(!r)return null;let n=(function(s,c){let f=D(c);if(!f)return;let d=b(s);for(let p of f.statements)if(M__default.default.isClassDeclaration(p)&&p.pos<=d&&d<=p.end)return p})(t.node,e);if(!n)return null;let a=[];for(let s of n.members){if(!M__default.default.isMethodDeclaration(s)||!s.body||!M__default.default.isIdentifier(s.name))continue;let c=s.name.text;if(!Mr.has(c)||!(function(p,i){let l=false,o=u=>{if(!l){if(M__default.default.isPropertyAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M__default.default.isElementAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M__default.default.isIdentifier(u)&&!(function(m){let y=m.parent;return !!y&&!!(M__default.default.isPropertyAccessExpression(y)&&y.name===m||M__default.default.isQualifiedName(y)&&y.right===m)})(u)){let m=i.getSymbolAtLocation(u);if(Q((m&&m.flags&M__default.default.SymbolFlags.Alias?i.getAliasedSymbol(m):m)??void 0)){l=true;return}}M__default.default.forEachChild(u,o);}};return o(p),l})(s.body,r))continue;let{line:f,column:d}=e.locator.location(s.getStart());a.push({filePath:e.filePath,ruleName:fe,message:`\`${c}\` contains DOM access that can run before browser-only APIs are safe.`,line:f,column:d,severity:"warn",fix:x[fe],codeExample:P[fe]});}return a.length?a:null},{requires:{typeChecker:true}});function yt(t){let e=t.aliasSymbol??t.symbol;return !!e&&Q(e)}var me=new Map;function Be(t){let e=D(t);if(!e)return false;for(let r of e.statements)if(M__default.default.isClassDeclaration(r))for(let n of r.members){if(!M__default.default.isMethodDeclaration(n)||!n.name||!M__default.default.isIdentifier(n.name)||n.name.text!=="ngOnDestroy"||!n.body)continue;let a=false,s=c=>{if(!a){if(M__default.default.isCallExpression(c)&&M__default.default.isPropertyAccessExpression(c.expression)&&c.expression.name.text==="unsubscribe"&&c.arguments.length===0){a=true;return}M__default.default.forEachChild(c,s);}};if(s(n.body),a)return true}return false}var xt=engine.createCallExpressionRule("rxjs-require-takeUntilDestroyed",(t,e)=>{if(!oe(e)||!te(t))return null;let r=g(t.callee),n=C(r)?r?.object:null;if(n&&re(n)||ie(ne(n))||(function(f){let d=me.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return me.size>=500&&me.clear(),me.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:"rxjs-require-takeUntilDestroyed",message:"A component subscription without teardown can keep running after the component is destroyed.",line:s,column:c,severity:"error",fix:x["rxjs-require-takeUntilDestroyed"]}},{requires:{typeChecker:true}});var de=new Map,ge="rxjs-no-subscribe-in-component",Et=engine.createCallExpressionRule(ge,(t,e)=>{if(!oe(e)||!te(t)||(function(f){let d=g(f.callee);if(!d||!C(d))return false;let p=g(d.object);if(!p)return false;if(p.type==="CallExpression"){let i=g(p.callee);if(C(i)&&N(i)==="pipe"&&(Array.isArray(p.arguments)?p.arguments:[]).some(l=>{let o=g(l);if(o?.type!=="CallExpression")return false;let u=g(o.callee)?.name;return u==="take"||u==="first"}))return true}return ie(ne(p))})(t))return null;let r=g(t.callee),n=g(r?.object);if(n&&re(n)||(function(f){let d=de.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return de.size>=500&&de.clear(),de.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:ge,message:(function(f,d){let p="Open-ended subscriptions in components can outlive the component and make state harder to track.",i=d.crossRef?.templateReferences;if(!i)return p;let l=g(f.callee),o=g(l?.object),u=o?N(o):null;if(!u)return p;let m=u.endsWith("$")?u.slice(0,-1):u;return i.has(u)||i.has(m)?`'${u}' is read by the template, so subscribing manually adds state and teardown work the template can own.`:p})(t,e),line:s,column:c,severity:"error",fix:x[ge],codeExample:P[ge]}},{requires:{typeChecker:true,projectContext:true}});var ye="rxjs-avoid-subject-as-event-bus",bt=engine.createAnyAngularClassRule(ye,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=F(t.node);if(a.length===0)return null;let s=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=g(u.callee);if(m&&(m.type==="Identifier"?m.name:C(m)?N(m):"")==="takeUntil")for(let y of Array.isArray(u.arguments)?u.arguments:[]){let h=St(y);h&&l.add(h);}});return l})(a),c=(function(i){let l=new Set,o=m=>{he(m??null,y=>{let h=Ue(y,"next");h&&l.add(h);});},u=Qe(i);for(let m of(u&&o(z(u)),i))if(H(m)){let y=m.key?.name;m.kind==="set"&&(function(h){let E=h.decorators;if(!Array.isArray(E))return false;for(let S of E){let A=g(S.expression);if(A?.name==="Input"||g(A?.callee)?.name==="Input")return true}return false})(m)&&o(m),y==="ngOnChanges"&&o(z(m));}else m.type==="PropertyDefinition"&&m.value&&o(m.value);return l})(a),f=(function(i){let l=new Set;for(let o of i)H(o)&&o.key?.name==="ngOnDestroy"&&he(z(o),u=>{let m=Ue(u,"complete");m&&l.add(m);});return l})(a),d=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=Ue(u,"pipe");m&&l.add(m);});return l})(a),p=[];for(let i of a){if(i.type!=="PropertyDefinition"||i.accessibility==="public")continue;let l=i.key?.name??"";if(!l||s.has(l)||c.has(l)||f.has(l)||d.has(l))continue;let o=et(i.key,e);if(!o)continue;let u=o.valueDeclaration??o.declarations?.[0];if(!u)continue;let m=r.getTypeOfSymbolAtLocation(o,u);if(!n.isSubjectLike(m))continue;let{line:y,column:h}=e.locator.location(b(i));p.push({filePath:e.filePath,ruleName:ye,message:`'${l}' is a Subject the class signals into without piping or external exposure \u2014 components are easier to follow when local state lives in fields or signals.`,line:y,column:h,severity:"warn",fix:x[ye],codeExample:P[ye]});}return p.length>0?p:null});function he(t,e){if(!t)return;let r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&e(n),O(n)))r.push(a);}}function St(t){let e=g(t);if(!e||!C(e))return null;let r=g(e.object),n=N(e);return n&&r?.type==="ThisExpression"?n:null}function Ue(t,e){let r=g(t.callee);return r&&C(r)&&N(r)===e?St(r.object):null}var qe="rxjs-prefer-toSignal-for-template-state",At=engine.createAnyAngularClassRule(qe,(t,e)=>{if(t.metadata?.type!=="Component")return null;let n=e.crossRef?.templateReferences;if(n===void 0)return null;let{typeChecker:a,angularTypes:s}=e;if(!a||!s)return null;let c=(function(p,i){let l=D(i);if(!l)return;let o=b(p);for(let u of l.statements)if(M__default.default.isClassDeclaration(u)&&u.pos<=o&&o<=u.end)return u})(t.node,e);if(!c)return null;let f=[];for(let p of c.members){var d;if(!M__default.default.isPropertyDeclaration(p))continue;let i=(function(m){if(M__default.default.isIdentifier(m.name)||M__default.default.isStringLiteral(m.name))return m.name.text})(p);if(!i||!n.has(i)&&!n.has((d=i).endsWith("$")?d.slice(0,-1):d)||(function(m,y,h){let E=M__default.default.getDecorators(m);if(!E)return false;for(let S of E){let A=M__default.default.isCallExpression(S.expression)?S.expression.expression:S.expression;if(!M__default.default.isIdentifier(A)||A.text!=="Output")continue;let v=y.getSymbolAtLocation(A),w=v&&v.flags&M__default.default.SymbolFlags.Alias?y.getAliasedSymbol(v):v;if(h.isFromAngularCore(w))return true}return false})(p,a,s))continue;let l=a.getTypeAtLocation(p);if(!s.isObservable(l)&&!s.isSubjectLike(l))continue;let{line:o,column:u}=e.locator.location(p.getStart());f.push({filePath:e.filePath,ruleName:qe,message:`Observable "${i}" is read by the template, which can add async-pipe churn and weaker signal integration.`,line:o,column:u,severity:"warn",fix:x[qe]});}return f.length?f:null},{requires:{projectContext:true,htmlAst:true,typeChecker:true}});var He="toSignal-require-initialValue",Ct=engine.createCallExpressionRule(He,(t,e)=>{if(!T(t.callee,"toSignal"))return null;let r=Array.isArray(t.arguments)?t.arguments:[],n=r[1]?g(r[1]):null;if(!n||n.type!=="ObjectExpression"||!(function(a){let s=Y(a,"initialValue");if(s&&!we(s.value))return true;let c=Y(a,"requireSync");return !!c&&Re(c.value)})(n)){let{line:a,column:s}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:He,message:"toSignal() can emit undefined before the observable produces a value.",line:a,column:s,severity:"warn",fix:x[He]}}return null});var ze="signal-prefer-computed-over-sync-effect",Lr=new Set(["setTimeout","setInterval","queueMicrotask","requestAnimationFrame"]),jr=new Set(["then","catch","finally"]),Fr=new Set(["set","update","mutate"]),Nt=engine.createCallExpressionRule(ze,(t,e)=>{var r,n;let a,s,c,f,d,p;if(!T(t.callee,"effect"))return null;let{typeChecker:i,angularTypes:l}=e;if(!i||!l)return null;let o=(function(S,A){let v,w=D(S);if(!w)return;let L=k=>{if(!v){if(M__default.default.isCallExpression(k)&&k.getStart()===A){v=k;return}M__default.default.forEachChild(k,L);}};return L(w),v})(e,b(t));if(!o)return null;let u=o.arguments[0];if(!u||!(M__default.default.isArrowFunction(u)||M__default.default.isFunctionExpression(u)))return null;let m=(r=u.body,n={typeChecker:i,angularTypes:l},s=false,c=false,f=false,d=false,(p=S=>{f&&d&&s&&c||((S.kind===M__default.default.SyntaxKind.AwaitExpression||S.kind===M__default.default.SyntaxKind.YieldExpression)&&(f=true),M__default.default.isCallExpression(S)&&(function(A,v,w){var L,k;if(M__default.default.isPropertyAccessExpression(A.expression)){let U,j=A.expression.name.text,K=A.expression.expression,q=v.typeChecker.getTypeAtLocation(K);return Fr.has(j)&&v.angularTypes.isWritableSignal(q)?w.onSignalWrite():(j==="subscribe"&&(v.angularTypes.isObservable(q)||v.angularTypes.isSubjectLike(q))||jr.has(j)&&(U=(L=q).aliasSymbol??L.symbol)&&U.name==="Promise"&&vt(U))&&w.onAsync()}if(M__default.default.isIdentifier(A.expression)){let U,j=A.expression.text;if(j==="linkedSignal")return w.onLinkedSignal();if(Lr.has(j)&&(k=A.expression,(U=v.typeChecker.getSymbolAtLocation(k))&&vt(U)))return w.onAsync();A.arguments.length===0&&(function(K,q){let Z=q.typeChecker.getSymbolAtLocation(K);if(!Z)return false;let Ve=Z.valueDeclaration??Z.declarations?.[0];if(!Ve)return false;let qt=q.typeChecker.getTypeOfSymbolAtLocation(Z,Ve);return q.angularTypes.isSignal(qt)})(A.expression,v)&&w.onSignalRead();}})(S,n,{onSignalRead:()=>{s=true;},onSignalWrite:()=>{c=true,a??=S;},onAsync:()=>{f=true;},onLinkedSignal:()=>{d=true;}}),M__default.default.forEachChild(S,p));})(r),{hasSignalRead:s,hasSignalWrite:c,hasAsync:f,hasLinkedSignal:d,firstWrite:a});if(!m.hasSignalRead||!m.hasSignalWrite||m.hasAsync||m.hasLinkedSignal)return null;let y=m.firstWrite??o,{line:h,column:E}=e.locator.location(y.getStart());return {filePath:e.filePath,ruleName:ze,message:"This effect reads reactive values and writes derived state, which adds extra reactive cycles.",line:h,column:E,severity:"warn",fix:x[ze]}},{requires:{typeChecker:true}});function vt(t){let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib."))return true;return false}var Rt=new Set(["afterRender","afterNextRender"]),$r=/\bafterNextRender\s*\(|\bafterRender\s*\(/,xe=new Map,wt=engine.createCallExpressionRule("signal-avoid-untracked-overuse",(t,e)=>{if(!T(t.callee,"untracked")||(function(a,s){let c=s.sourceText??s.fileContent;if(typeof c=="string"&&!$r.test(c))return false;let f=a.parent;for(;f;){if(f.type==="CallExpression"&&Rt.has(Ne(f)))return true;f=f.parent;}let d=b(a);return (function(p){let i=xe.get(p.filePath);if(i!==void 0)return i;let l=p.program;return i=l?(function(o){let u=[],m=o.body,y=Array.isArray(m)?[...m]:[o];for(;y.length;){let h=g(y.pop());if(h){if(h.type==="CallExpression"&&Rt.has(Ne(h))){let E=g(h.arguments?.[0]);if(E){let S=b(E),A=E.end??E.span?.end??b(E);A>S&&u.push([S,A]);}}for(let E of O(h))y.push(E);}}return u})(l):[],xe.size>=300&&xe.clear(),xe.set(p.filePath,i),i})(s).some(([p,i])=>d>=p&&d<i)})(t,e))return null;let{line:r,column:n}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"signal-avoid-untracked-overuse",message:"untracked() hides this read from dependency tracking, which can mask stale reactive state.",line:r,column:n,severity:"warn",fix:x["signal-avoid-untracked-overuse"]}});var Ee="prefer-inject-over-constructor-di",Ur=new Set(["Inject","Optional","Self","SkipSelf","Host"]),Mt=engine.createAnyAngularClassRule(Ee,(t,e)=>{let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(l,o){var u;let m=(u=o).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M__default.default.createSourceFile(u.filePath,u.fileContent,M__default.default.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!m)return;let y=b(l);for(let h of m.statements)if(M__default.default.isClassDeclaration(h)&&h.pos<=y&&y<=h.end)return h})(t.node,e);if(!a)return null;let s=a.members.find(M__default.default.isConstructorDeclaration);if(!s||s.parameters.length===0)return null;let c=[];for(let l of s.parameters){var f;(function(o,u,m){if((function(E,S,A){let v=M__default.default.getDecorators(E);if(!v||v.length===0)return false;for(let w of v){let L=(function(j){let K=M__default.default.isCallExpression(j.expression)?j.expression.expression:j.expression;return M__default.default.isIdentifier(K)?K:void 0})(w);if(!L||!Ur.has(L.text))continue;let k=S.getSymbolAtLocation(L),U=k&&k.flags&M__default.default.SymbolFlags.Alias?S.getAliasedSymbol(k):k;if(A.isFromAngularCore(U))return true}return false})(o,u,m))return true;if(!o.type)return false;let y=u.getTypeFromTypeNode(o.type);if(m.isInjectionToken(y))return true;let h=y.aliasSymbol??y.symbol;return !!h&&m.isInjectableClass(h)})(l,r,n)&&c.push((f=l,{name:M__default.default.isIdentifier(f.name)?f.name.text:"<binding>",typeText:f.type?f.type.getText():"<inferred>"}));}if(c.length===0)return null;let{line:d,column:p}=e.locator.location(b(s)),i=c.map(l=>`${l.name}: ${l.typeText}`).join(", ");return {filePath:e.filePath,ruleName:Ee,message:`Constructor dependency injection makes class setup less composable than inject(). Offending params: ${i}.`,line:d,column:p,severity:"warn",fix:x[Ee],codeExample:P[Ee]}},{requires:{typeChecker:true}});var be="signal-prefer-input-signal";function Hr(t){let e=g(t.expression??t);if(!e)return false;if(e.type==="Identifier")return e.name==="Input";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"&&r.name==="Input"}return false}var Pt=engine.createAnyAngularClassRule(be,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=[],a=e.project?.standaloneComponents?.has(e.filePath)??false;for(let s of r){let c=g(s);if(c&&(c.type==="PropertyDefinition"||c.type==="AccessorProperty")&&Array.isArray(c.decorators)&&c.decorators.some(Hr)){let f=b(c),{line:d,column:p}=e.locator.location(f),i=g(c.key),l=(i?.type==="Identifier"?i.name:i?.type==="Literal"?String(i.value):"")||"(unknown)",o=`'${l}' uses @Input(), which keeps this input outside Angular's signal graph.`;a&&(o+=" Standalone declarations benefit most from signal inputs."),n.push({filePath:e.filePath,ruleName:be,message:o,line:d,column:p,severity:a?"error":"warn",fix:x[be],codeExample:P[be]});}}return n.length>0?n:null},{requires:{projectContext:true}});var Se="signal-prefer-output-function",Tt=engine.createAnyAngularClassRule(Se,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(c,f){let d=D(f);if(!d)return;let p=b(c);for(let i of d.statements)if(M__default.default.isClassDeclaration(i)&&i.pos<=p&&p<=i.end)return i})(t.node,e);if(!a)return null;let s=[];for(let c of a.members){if(!M__default.default.isPropertyDeclaration(c)||!(function(i,l,o){let u=M__default.default.getDecorators(i);if(!u)return false;for(let m of u){let y=M__default.default.isCallExpression(m.expression)?m.expression.expression:m.expression;if(!M__default.default.isIdentifier(y)||y.text!=="Output")continue;let h=l.getSymbolAtLocation(y),E=h&&h.flags&M__default.default.SymbolFlags.Alias?l.getAliasedSymbol(h):h;if(o.isFromAngularCore(E))return true}return false})(c,r,n)||!(function(i,l,o){if(i.type){let m=l.getTypeFromTypeNode(i.type);if(o.isEventEmitter(m))return true}if(i.initializer){let m=l.getTypeAtLocation(i.initializer);if(o.isEventEmitter(m))return true}let u=l.getSymbolAtLocation(i.name);if(u){let m=l.getTypeOfSymbolAtLocation(u,i);if(o.isEventEmitter(m))return true}return false})(c,r,n))continue;let f=(function(i){let l=i.name;if(M__default.default.isIdentifier(l)||M__default.default.isStringLiteral(l))return l.text})(c)??"(unknown)",{line:d,column:p}=e.locator.location(c.getStart());s.push({filePath:e.filePath,ruleName:Se,message:`'${f}' uses @Output() EventEmitter, which adds boilerplate compared with output().`,line:d,column:p,severity:"warn",fix:x[Se],codeExample:P[Se]});}return s.length>0?s:null},{requires:{typeChecker:true}});var Ae="signal-prefer-model";function Ot(t,e){return Array.isArray(t.decorators)&&t.decorators.some(r=>{let n=g(r.expression??r);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(n.type==="CallExpression"){let a=g(n.callee);return a?.type==="Identifier"&&a.name===e}return false})}function kt(t,e){let r=g(t.value);if(!r||r.type!=="CallExpression")return false;let n=g(r.callee);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(C(n)){let a=g(n.object);return a?.type==="Identifier"&&a.name===e}return false}var Dt=engine.createAnyAngularClassRule(Ae,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=new Map,a=new Map;for(let c of r){let f=g(c);if(!f||f.type!=="PropertyDefinition"&&f.type!=="AccessorProperty")continue;let d=(function(p){let i=g(p.key);return i?i.type==="Identifier"?i.name??null:i.type==="Literal"?String(i.value):null:null})(f);d&&((Ot(f,"Input")||kt(f,"input"))&&n.set(d,f),(Ot(f,"Output")||kt(f,"output"))&&a.set(d,f));}let s=[];for(let[c,f]of a){if(!c.endsWith("Change"))continue;let d=c.slice(0,-6),p=n.get(d);if(p){let i=b(p),{line:l,column:o}=e.locator.location(i);s.push({filePath:e.filePath,ruleName:Ae,message:`The \`${d}\` / \`${c}\` pair implements two-way binding with extra wiring that model() avoids.`,line:l,column:o,severity:"warn",fix:x[Ae],codeExample:P[Ae]});}}return s.length>0?s:null});var Kr=new Map([["*ngIf","@if"],["*ngFor","@for"],["*ngSwitch","@switch"],["[ngSwitch]","@switch"],["*ngSwitchCase","@case"],["*ngSwitchDefault","@default"]]),We="template-prefer-control-flow",It=engine.createTemplateAttributeRule(We,(t,e)=>{var r;let n=(r=t.name,Kr.get(r)??null);if(!n)return null;let a=I(e,t.sourceSpan.start),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:We,message:`\`${t.name}\` uses legacy structural directive syntax, so it misses the \`${n}\` control flow benefits.`,line:s,column:c,severity:"error",fix:x[We]}},{requires:{htmlAst:true}});var Lt=new WeakMap,jt=engine.createTemplateExpressionRule("template-no-async-pipe-duplication",(t,e)=>{let r,n,a=(function p(i){let l=g(i);if(!l)return null;if(l.type==="BinaryExpression"&&l.operator==="|"){let o=g(l.right);return o?.type==="Identifier"&&o.name==="async"?g(l.left):p(l.left)}return null})(t.expression),s=a?(function p(i,l=0){if(!i||l>10)return null;if(i.type==="Identifier")return i.name;if(i.type==="ThisExpression")return "this";if(i.type==="Literal"){let o=i.value;return o===null?"null":typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="bigint"?String(o):null}if(i.type==="CallExpression"){let o=p(i.callee,l+1),u=(Array.isArray(i.arguments)?i.arguments:[]).map(m=>p(m,l+1)??"?");return `${o}(${u.join(",")})`}if(C(i)){let o=p(i.object,l+1),u=N(i);if(o&&u)return `${o}.${u}`}if(i.type==="UnaryExpression")return `${i.operator}${p(i.argument,l+1)}`;if(i.type==="ConditionalExpression")return `${p(i.test,l+1)}?${p(i.consequent,l+1)}:${p(i.alternate,l+1)}`;if(i.type==="OptionalExpression"||i.type==="ChainExpression")return p(i.expression,l+1);if(i.type==="LogicalExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="BinaryExpression"&&i.operator!=="|"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="ArrayExpression")return `[${(i.elements??[]).map(u=>p(u,l+1)??"?").join(",")}]`;if(i.type==="ObjectExpression")return `{${(i.properties??[]).map(u=>{let m=u.key?p(u.key,l+1):"?",y=u.value?p(u.value,l+1):"?";return `${m}:${y}`}).join(",")}}`;if(i.type==="TemplateLiteral")return "`tmpl`";if(i.type==="AssignmentExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}return null})(a):null;if(!s)return null;let c=(r=e.template,n=r?.templateStartOffset,`${e.filePath}@${typeof n=="number"&&Number.isFinite(n)?n:0}`),f=Lt.get(e);f||(f=new Map,Lt.set(e,f));let d=f.get(c);if(d||(d=new Set,f.set(c,d)),d.has(s)){let p=I(e,t.sourceSpan.start),{line:i,column:l}=e.locator.location(p);return {filePath:e.filePath,ruleName:"template-no-async-pipe-duplication",message:`Duplicate async pipe subscriptions for "${s}" can create repeated work and inconsistent loading states.`,line:i,column:l,severity:"warn",fix:x["template-no-async-pipe-duplication"]}}return d.add(s),null},{requires:{htmlAst:true}});var Yr=new Set(["fdescribe","fit","describe.only","it.only","test.only","context.only","xdescribe","xit","xtest","xcontext"]),Qr=new Set(["xdescribe","xit","xtest","xcontext"]);function Ft(t){return t.type==="Identifier"?t.name??null:null}var _t=engine.createCallExpressionRule("spec-no-focused-test",(t,e)=>{var r;let n;if(!((r=e.filePath).endsWith(".spec.ts")||r.endsWith(".test.ts")))return null;let a=g(t.callee);if(!a)return null;let s=(n=Ft(a)||(function(i){if(i.type==="MemberExpression"||i.type==="StaticMemberExpression"||i.type==="OptionalMemberExpression"){let l=g(i.object),o=i.property?.name??"",u=(l?.type==="Identifier"?l.name:"")??"";return u?`${u}.${o}`:null}return null})(a))&&Yr.has(n)?n:null;if(!s){if(Ft(a)==="pending"){let i=b(t),{line:l,column:o}=e.locator.location(i);return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:"`pending()` disables the test body, so the committed suite can miss coverage.",line:l,column:o,severity:"error",fix:x["spec-no-focused-test"]}}return null}let c=b(t),{line:f,column:d}=e.locator.location(c),p=Qr.has(s)?`\`${s}\` disables a test that may be forgotten.`:`\`${s}\` is a focused test helper that can skip the rest of the suite in CI.`;return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:p,line:f,column:d,severity:"error",fix:x["spec-no-focused-test"]}},{dependencyType:"spec",requires:{tsAst:true}});function $t(){R(tt,"correctness"),R(rt,"correctness"),R(nt,"correctness"),R(ot,"correctness"),R(at,"performance"),R(lt,"performance"),R(ct,"performance"),R(pt,"performance"),R(ft,"performance"),R(mt,"security"),R(dt,"security"),R(gt,"ssr"),R(ht,"ssr"),R(Et,"reactivity"),R(xt,"reactivity"),R(bt,"reactivity"),R(At,"reactivity"),R(Ct,"reactivity"),R(Nt,"reactivity"),R(wt,"reactivity"),R(Mt,"modern-api"),R(Pt,"modern-api"),R(Tt,"modern-api"),R(Dt,"modern-api"),R(It,"template"),R(jt,"template"),R(_t,"testing");}var Bt=(t,e,r,n,a)=>{let s=0,c=0;for(let f of r)for(let d of f.failures)d.severity==="error"?s++:d.severity==="warn"&&c++;return {kind:"file-progress",filePath:t,taskCount:e,issueCount:s+c,errorCount:s,warningCount:c,duration:n,typeAware:a}};$t(),engine.configureRuleExecutor(Xe,Ke),process.on("message",t=>{rn(t);});var rn=async t=>{let e=[],r=engine.createTypeAwareAnalysisContext(t.rootDir,t.files,t.parserOptions,{buildProjectContext:t.buildProjectContext,programRootFiles:t.programRootFiles});try{await r.warmup();let n=planner.groupTasksByFile(t.tasks),a=await nn(Array.from(n),Math.max(1,t.fileConcurrency??1),async([s,c])=>{let f=performance.now();try{let d=await engine.executeBatchedTasks(c,r);return Ut(s,c.length,d,performance.now()-f),d}catch{return Ut(s,c.length,[],performance.now()-f),[]}finally{r.evict(s);}});e.push(...a.flat()),process.send?.({kind:"complete",results:e});}catch(n){process.send?.({kind:"error",error:n instanceof Error?n.message:String(n)});}finally{r.dispose(),process.disconnect?.();}};async function nn(t,e,r){let n=Array(t.length),a=0,s=Math.min(e,t.length);return await Promise.all(Array.from({length:s},async()=>{for(;a<t.length;){let c=a++;n[c]=await r(t[c]);}})),n}var Ut=(t,e,r,n)=>{process.send?.(Bt(t,e,r,n,true));};//# sourceMappingURL=type-aware-worker.cjs.map | ||
| });`};var Ge;function g(t){let e=t;for(;e;){let r=e.type;if(r==="ChainExpression"||r==="TSNonNullExpression"||r==="TSAsExpression"||r==="ParenthesizedExpression"||r==="TSInstantiationExpression"||r==="TSSatisfiesExpression"){e=e.expression;continue}break}return e??null}function C(t){let e=t?.type;return e==="MemberExpression"||e==="StaticMemberExpression"||e==="OptionalMemberExpression"}function N(t){if(!t)return "";let e=t.property;return e?t.computed?e.type==="Literal"&&typeof e.value=="string"?e.value:"":e.name??"":""}function b(t){return t?t.start??t.span?.start??0:0}function T(t,e){let r=g(t);return !!r&&(r.type==="Identifier"?(r.name??"")===e:!!C(r)&&N(r)===e)}function Ne(t){let e=g(t);if(!e||e.type!=="CallExpression")return "";let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}function te(t){let e=g(t?.callee);return !!C(e)&&N(e)==="subscribe"}function Y(t,e){if(!t||t.type!=="ObjectExpression")return null;let r=t.properties;if(!Array.isArray(r))return null;for(let n of r){if(!n||n.type!=="Property")continue;let a=n.key;if((a?.type==="Identifier"?a.name:a?.type==="Literal"&&typeof a.value=="string"?a.value:"")===e)return n}return null}function Re(t){let e=g(t);return !!(e&&e.type==="Literal"&&e.value===true)}function we(t){let e=g(t);return !e||e.type==="Literal"&&e.value===null||e.type==="Identifier"&&e.name==="undefined"}var Kt=new Set(["parent","span","loc","range","start","end","type"]);function*k(t){if(t&&typeof t=="object"){if(Array.isArray(t)){for(let e of t)e&&typeof e=="object"&&(yield e);return}for(let e in t){if(Kt.has(e))continue;let r=t[e];if(r)if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&(yield n);else typeof r=="object"&&r.type&&(yield r);}}}function Me(t){if(!t)return false;if(t.kind==="constructor")return true;let e=t.key;return e?.type==="Identifier"&&e.name==="constructor"||e?.type==="Literal"&&e.value==="constructor"}function H(t){if(!t)return false;let e=t.type;return e==="MethodDefinition"||e==="TSAbstractMethodDefinition"||e==="ClassMethod"||e==="MethodDeclaration"}function Qe(t){for(let e of t)if(e&&H(e)&&Me(e))return e;return null}function z(t){return t?(t.value??t)?.body??null:null}function Ze(t){let e=t?.key;return e?e.type==="Identifier"?e.name??"<method>":e.type==="Literal"&&typeof e.value=="string"?e.value:"<method>":"<method>"}function F(t){if(!t)return [];let e=t.body;if(Array.isArray(e))return e;if(e&&typeof e=="object"&&"body"in e){let r=e.body;if(Array.isArray(r))return r}return []}function Xt(t){let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=e.arguments;if(!Array.isArray(r)||r.length<2)return false;let n=g(r[1]);if(!n||n.type!=="ObjectExpression")return false;let a=Y(n,"injector");if(a&&!we(a.value))return true;let s=Y(n,"manualCleanup");return !!(s&&Re(s.value))}function Je(t){if(!t)return [];let e=[],r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&T(n.callee,"effect")&&!Xt(n)&&e.push(n),k(n)))r.push(a);}return e}var Gt=new Set(["takeUntilDestroyed","takeUntil","take","first","takeWhile"]);function Yt(t){let e=g(t);if(!e)return "";if(e.type==="Identifier")return e.name??"";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}return C(e)?N(e):""}function Qt(t){let e=t.arguments;if(!Array.isArray(e))return false;for(let r of e)if(Gt.has(Yt(r)))return true;return false}function re(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)==="pipe"&&Qt(r))return true;e=n?.object;}return false}function I(t,e){return e}var Zt=new Set(["get","post","put","patch","delete","head","options","jsonp","request"]),Jt=new Set(["http","httpClient","_http","_httpClient"]),er=["get","fetch","load","save","create","update","delete","remove","submit","send","post","put","patch","upload","download"];function ne(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)!=="pipe")return r;e=n?.object;}return null}function ie(t){if(!t)return false;let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=g(e.callee);if(!C(r))return false;let n=N(r);if(!n)return false;let a=g(r?.object),s=Array.isArray(e.arguments)?e.arguments:[];if(Zt.has(n)&&C(a)){let c=N(a);if(Jt.has(c))return true}if(s.length>0){let c=n.toLowerCase();for(let f of er)if(c.startsWith(f)&&n.length>f.length)return true}return false}var Ye=false;function Pe(){if(!Ye){try{Ge=zt("typescript");}catch{}Ye=true;}return Ge}function et(t,e){if(!t||!e.typeChecker)return;let r=Pe();if(r)try{!e.sourceFile&&e.fileContent&&(e.sourceFile=r.createSourceFile(e.filePath,e.fileContent,r.ScriptTarget.Latest,!0));let n=e.sourceFile;if(!n)return;let a=(function(s,c,f){if(c<s.getStart()||c>=s.getEnd())return;let d=s;for(;;){let p=f.forEachChild(d,i=>{if(c>=i.getStart()&&c<i.getEnd())return i});if(!p)break;d=p;}return d})(n,b(t),r);return a?e.typeChecker.getSymbolAtLocation(a):void 0}catch{return}}function D(t){if(t.sourceFile)return t.sourceFile;if(!t.fileContent)return;let e=Pe();if(e)return t.sourceFile=e.createSourceFile(t.filePath,t.fileContent,e.ScriptTarget.Latest,true),t.sourceFile}var ee=new Map;function oe(t){let e=ee.get(t.filePath);if(e!==void 0)return e;let r=(function(n){let{typeChecker:a,angularTypes:s}=n;if(!a||!s)return false;let c=Pe(),f=D(n);if(!c||!f)return false;for(let d of f.statements){if(!c.isClassDeclaration(d)||!c.canHaveDecorators(d))continue;let p=c.getDecorators(d);if(p)for(let i of p){let l=c.isCallExpression(i.expression)?i.expression.expression:i.expression;if(!c.isIdentifier(l)||l.text!=="Component"&&l.text!=="Directive")continue;let o=a.getSymbolAtLocation(l),u=o&&o.flags&c.SymbolFlags.Alias?a.getAliasedSymbol(o):o;if(s.isFromAngularCore(u))return true}}return false})(t);return ee.size>=1024&&ee.clear(),ee.set(t.filePath,r),r}function Q(t){if(!t)return false;let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib.dom"))return true;return false}var se="component-no-manual-detect-changes",ir=new Set(["detectChanges","markForCheck"]),tt=engine.createAnyAngularClassRule(se,(t,e)=>{let r,n=t.node,a=(r=ast.analyzeComponent(n),r?.type!=="Component"?{isComponent:false,isOnPush:false}:{isComponent:true,isOnPush:r.changeDetection?.kind==="literal"&&r.changeDetection.value===ast.ChangeDetectionStrategy.OnPush});if(!a.isComponent)return null;let{typeChecker:s,angularTypes:c}=e;if(!s||!c)return null;let f=(function(i,l){let o=D(l);if(!o)return;let u=b(i);for(let m of o.statements)if(M__default.default.isClassDeclaration(m)&&m.pos<=u&&u<=m.end)return m})(n,e);if(!f)return null;let d=[],p=i=>{if(M__default.default.isCallExpression(i)){let l=(function(o,u,m,y,h){if(!M__default.default.isPropertyAccessExpression(o.expression))return null;let E=o.expression.name.text;if(!ir.has(E)||y.isOnPush&&E==="markForCheck")return null;let S=u.getTypeAtLocation(o.expression.expression);if(!m.isChangeDetectorRef(S))return null;let{line:A,column:v}=h.locator.location(o.getStart());return {filePath:h.filePath,ruleName:se,message:y.isOnPush?"Manual change detection in an OnPush component couples rendering to imperative calls.":`Manual change detection (${E}) can hide state-flow bugs and make rendering harder to predict.`,line:A,column:v,severity:y.isOnPush?"warn":"error",fix:x[se],codeExample:P[se]}})(i,s,c,a,e);l&&d.push(l);}M__default.default.forEachChild(i,p);};return p(f),d.length>0?d:null});var Te="signal-no-side-effects-in-computed",ar=new Set(["set","update","mutate"]),sr=new Set(["next","complete","error"]),rt=engine.createCallExpressionRule(Te,(t,e)=>{var r,n;let a,s;if(!T(t.callee,"computed"))return null;let{typeChecker:c,angularTypes:f}=e;if(!c||!f)return null;let d=(function(l,o){var u;let m,y=(u=l).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M__default.default.createSourceFile(u.filePath,u.fileContent,M__default.default.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!y)return;let h=E=>{if(!m){if(M__default.default.isCallExpression(E)&&E.getStart()===o){m=E;return}M__default.default.forEachChild(E,h);}};return h(y),m})(e,b(t));if(!d)return null;let p=d.arguments[0];if(!p||!(M__default.default.isArrowFunction(p)||M__default.default.isFunctionExpression(p)))return null;let i=(r=p.body,n={typeChecker:c,angularTypes:f},(s=l=>{var o,u,m,y;if(a)return;let h=(o=l,u=n,M__default.default.isBinaryExpression(o)&&(m=o.operatorToken.kind)>=M__default.default.SyntaxKind.FirstAssignment&&m<=M__default.default.SyntaxKind.LastAssignment?ke(o.left)?{node:o,kind:"write"}:void 0:M__default.default.isPostfixUnaryExpression(o)||M__default.default.isPrefixUnaryExpression(o)?(o.operator===M__default.default.SyntaxKind.PlusPlusToken||o.operator===M__default.default.SyntaxKind.MinusMinusToken)&&ke(o.operand)?{node:o,kind:"write"}:void 0:M__default.default.isDeleteExpression(o)&&ke(o.expression)?{node:o,kind:"write"}:M__default.default.isCallExpression(o)?(function(E,S){if(!M__default.default.isPropertyAccessExpression(E.expression))return;let A=E.expression.name.text,v=E.expression.expression,w=S.typeChecker.getTypeAtLocation(v);return ar.has(A)&&S.angularTypes.isWritableSignal(w)?{node:E,kind:"write"}:sr.has(A)&&S.angularTypes.isSubjectLike(w)||S.angularTypes.isHttpClient(w)?{node:E,kind:"effect"}:void 0})(o,u):void 0);if(h){a=h;return}y=l,M__default.default.isArrowFunction(y)||M__default.default.isFunctionExpression(y)||M__default.default.isFunctionDeclaration(y)||M__default.default.isMethodDeclaration(y)||M__default.default.isGetAccessorDeclaration(y)||M__default.default.isSetAccessorDeclaration(y)||M__default.default.forEachChild(l,s);})(r),a);return i?(function(l,o,u){let m=l.node.getStart(),{line:y,column:h}=u.locator.location(m||b(o));return {filePath:u.filePath,ruleName:Te,message:l.kind==="write"?"computed() writes to state, which can create reactive cycles.":"computed() contains a side effect, so it is no longer a pure derivation.",line:y,column:h,severity:"error",fix:x[Te]}})(i,t,e):null},{requires:{typeChecker:true}});function ke(t){return M__default.default.isPropertyAccessExpression(t)||M__default.default.isElementAccessExpression(t)}var Oe="signal-effect-must-be-destroy-scoped",nt=engine.createAnyAngularClassRule(Oe,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let n=[];for(let a of r)a&&H(a)&&!Me(a)&&n.push(...(function(s,c){let f=z(s);if(!f)return [];let d=Ze(s),p=[];for(let i of Je(f))(function(l){if(l.type!=="CallExpression")return false;let o=g(l.callee);return !!o&&(o.type==="Identifier"?o.name==="effect":!!C(o)&&N(o)==="effect")})(i)&&!(function(l){let o=g((Array.isArray(l.arguments)?l.arguments:[])[1]);if(!o||o.type!=="ObjectExpression")return false;for(let u of Array.isArray(o.properties)?o.properties:[]){let m=g(u);if(m?.type==="Property"){let y=g(m.key),h=y?.type==="Identifier"?y.name:N(y)||"";if(h==="injector")return true;if(h==="manualCleanup"){let E=g(m.value);if(E?.type==="Literal"&&E.value===true)return true}}}return false})(i)&&p.push((function(l,o,u){let m=b(l),{line:y,column:h}=u.locator.location(m);return {filePath:u.filePath,ruleName:Oe,message:`effect() inside "${o}" has no explicit lifecycle owner, so cleanup can be unclear.`,line:y,column:h,severity:"error",fix:x[Oe]}})(i,d,c));return p})(a,e));return n.length>0?n:null});var le="rxjs-no-nested-subscribe",cr=new Set(["next","error","complete"]),pr=new Set(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"]);function De(t){if(t.type!=="CallExpression")return false;let e=g(t.callee);return !!C(e)&&N(e)==="subscribe"}function it(t){return !!t&&(t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression")}var ot=engine.createCallExpressionRule(le,(t,e)=>{if(!De(t))return null;for(let r of (function(n){if(!De(n))return [];let a=Array.isArray(n.arguments)?n.arguments:[];if(a.length===0)return [];let s=g(a[0]);if(s?.type==="ObjectExpression"){if(s.type!=="ObjectExpression")return [];let f=[];for(let d of Array.isArray(s.properties)?s.properties:[]){let p=g(d);if(p?.type==="Property"&&cr.has((function(i){let l=g(i.key);return l?l.type==="Identifier"?l.name:N(l)||"":""})(p))){let i=g(p.value);it(i)&&f.push(i);}}return f}let c=[];for(let f=0;f<Math.min(a.length,3);f++){let d=g(a[f]);it(d)&&c.push(d);}return c})(t)){let n=g(r.body);if(n&&(function(a){let s=[a];for(;s.length>0;){var c;let f=g(s.pop());if(f){if(f!==a&&De(f))return true;if(!(f!==a&&(c=f).type&&pr.has(c.type)))for(let d of k(f))s.push(d);}}return false})(n))return (function(a,s){let c=b(a),{line:f,column:d}=s.locator.location(c);return {filePath:s.filePath,ruleName:le,message:"Nested subscribe() calls make stream lifetimes harder to reason about and can leak work.",line:f,column:d,severity:"error",fix:x[le],codeExample:P[le]}})(t,e)}return null});var ue="prefer-on-push-component-change-detection";function ce(t,e){let r=t?.[e];return typeof r=="number"?r:void 0}function Ie(t){return t.replace(/\\/g,"/")}var at=engine.createComponentRule(ue,(t,e)=>{let r=t.metadata??{};return r.type!=="Component"||!(function(n){if(!n||typeof n!="object")return false;let{kind:a,value:s}=n;return a!=="non-literal"&&(a==="literal"?s!==ast.ChangeDetectionStrategy.OnPush:a==="missing")})(r.changeDetection)?null:(function(n,a){let s,c,f,d,p=(s=n.metadata??{},c=n.node,ce(s,"decoratorStart")??ce(s,"start")??ce(c,"start")??ce(n,"start")??0),{line:i,column:l}=a.locator.location(p),o=(f=n.metadata,typeof(d=f?.className)=="string"?d:"AnonymousComponent"),u=(function(m,y){if(!y.project)return null;let h=m.metadata,E=h?.className;if(typeof E!="string"||!E)return null;let S=Ie(y.filePath),{ngModuleMap:A,classToFile:v}=y.project;for(let[w,L]of A){if(L.isStandalone||!L.declarations.has(E))continue;let O=v.get(E);if(!O||Ie(O)===S)return {moduleName:(Ie(w).split("/").pop()??w).replace(/\.ts$/,""),siblingDeclarationCount:Math.max(0,L.declarations.size-1)}}return null})(n,a);return {filePath:a.filePath,ruleName:ue,message:(function(m,y){let h=`Component '${m}' uses default change detection, which can re-render more often than needed.`;if(!y)return h;let{moduleName:E,siblingDeclarationCount:S}=y;return S===0?`${h} It is declared in '${E}'.`:`${h} It is declared in '${E}' alongside ${S} other declaration${S===1?"":"s"}.`})(o,u),line:i,column:l,severity:"error",fix:x[ue],codeExample:P[ue]}})(t,e)},{requires:{projectContext:true}});var Le="template-no-call-expression",yr=new Set(["translate","$localize","$any"]),hr=new Set(["slice","toString","toFixed","toUpperCase","toLowerCase","trim","join","includes","indexOf","startsWith","endsWith","charAt","substring","replace","split","concat","toISOString","toLocaleDateString","toLocaleTimeString","toLocaleString"]);function st(t){let e=g(t);return !!e&&(e.type==="CallExpression"||e.type==="OptionalCallExpression")}var lt=engine.createTemplateExpressionRule(Le,(t,e)=>(function(r,n){let a=r?[r]:[];for(;a.length>0;){let s=g(a.pop());if(s){if(st(s)&&!(function(c){let f=g(c);if(!f||!st(f))return false;let d=g(f.callee);if(!d)return false;if(d.type==="Identifier")return yr.has(d.name);if(!C(d))return false;let p=N(d);return !!p&&hr.has(p)})(s)){if((function(f){let d=g(f);return Array.isArray(d?.arguments)?d.arguments:[]})(s).length>0)return true;let c=(function(f){let d=g(f);if(!d)return "";let p=g(d.callee);return p?p.type==="Identifier"?p.name??"":C(p)?N(p):"":""})(s);if(c&&!(function(f,d){if(d.crossRef?.signalMembers?.has(f))return true;let{typeChecker:p,angularTypes:i,crossRef:l}=d;if(!p||!i||!l?.componentPath)return false;let o=(function(u,m,y){let h=y.getProgram?.(),E=h?.getSourceFile(m);if(!E)return;let S=E.statements.find(M__default.default.isClassDeclaration);if(!S)return;let A=y.getTypeAtLocation(S),v=y.getPropertyOfType(A,u);if(!v)return;let w=v.valueDeclaration??v.declarations?.[0];if(w)return y.getTypeOfSymbolAtLocation(v,w)})(f,l.componentPath,p);return !!o&&i.isSignal(o)})(c,n))return true}for(let c of k(s))a.push(c);}}return false})(t.expression,e)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Le,message:"Template method calls run on every change detection cycle and can make rendering slower.",line:s,column:c,severity:"error",fix:x[Le]}})(t,e)]:null,{requires:{htmlAst:true,typeChecker:true,projectContext:true}});function ut(t,e,r,n){let a=I(t,e.sourceSpan.start),{line:s,column:c}=t.locator.location(a);return {filePath:t.filePath,ruleName:r,message:n,line:s,column:c,severity:"error",fix:x[r]}}var ct=engine.createTemplateRule("template-trackby-required",(t,e)=>{let r=[];for(let n of t.attributes)n.name==="*ngFor"&&!(function(a){return !!a.match(/\btrackBy\s*:\s*([^;]+?)\s*(?:;|$)/)?.[1]?.trim()})(n.value??"")&&r.push(ut(e,n,"template-trackby-required-for-ngfor","*ngFor without trackBy can recreate DOM nodes unnecessarily when list items change."));for(let n of t.blocks)n.name!=="for"||n.parameters.some(a=>{let s=a.expression?.trim()??"";return !!s&&!!/^track\b/.test(s)&&s.replace(/^track\b/,"").trim().length>0})||r.push(ut(e,n,"template-track-required-for-atfor","@for without a track expression can recreate DOM nodes unnecessarily when list items change."));return r.length>0?r:null},{requires:{htmlAst:true}});var je="template-no-object-literal-binding",pt=engine.createTemplateExpressionRule(je,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ObjectExpression")return true;for(let s of k(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:je,message:"Object literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[je]}})(t,e)]:null,{requires:{htmlAst:true}});var Fe="template-no-array-literal-binding",ft=engine.createTemplateExpressionRule(Fe,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ArrayExpression")return true;for(let s of k(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Fe,message:"Array literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[Fe]}})(t,e)]:null,{requires:{htmlAst:true}});var _e=new Map([["bypassSecurityTrustHtml","HTML"],["bypassSecurityTrustScript","Script"],["bypassSecurityTrustStyle","Style"],["bypassSecurityTrustUrl","URL"],["bypassSecurityTrustResourceUrl","Resource URL"]]),mt=engine.createCallExpressionRule("no-bypass-sanitization",(t,e)=>{let r=(function(s){let c=g(s.callee);if(!c)return null;if(c.type==="Identifier"&&c.name)return _e.has(c.name)?c.name:null;if(C(c)){let f=N(c);return f&&_e.has(f)?f:null}return null})(t);if(!r)return null;let{line:n,column:a}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"no-bypass-sanitization",message:`\`${r}\` bypasses Angular's ${_e.get(r)} sanitization, which can expose unsafe content.`,line:n,column:a,severity:"error",fix:x["no-bypass-sanitization"]}});var Cr=new Map([["[innerHTML]",{desc:"innerHTML directly renders HTML markup and can execute injected scripts",severity:"error"}],["[outerHTML]",{desc:"outerHTML replaces the element with raw HTML and is susceptible to XSS",severity:"error"}],["[srcdoc]",{desc:"srcdoc embeds raw HTML inside an iframe and can execute injected scripts",severity:"error"}],["[style]",{desc:"binding complex expressions to [style] can enable CSS injection",severity:"warn"}]]),vr=/\|\s*(safeHtml|safeStyle|safeUrl|safeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|trustStyle|trustUrl|trustResourceUrl|bypassSecurity)\b/i,Nr=/\b(getSafeHtml|getSafeUrl|getSafeStyle|getSafeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|bypassSecurity)\s*\(/i,dt=engine.createTemplateAttributeRule("template-no-unsafe-bindings",(t,e)=>{let r=Cr.get(t.name);if(!r)return null;let n=t.value??"";if(vr.test(n)||Nr.test(n)||t.name==="[style]"&&!/[.(|?]/.test(n))return null;let{line:a,column:s}=e.locator.location(I(e,t.sourceSpan.start));return {filePath:e.filePath,ruleName:"template-no-unsafe-bindings",message:`\`${t.name}\` binds raw content: ${r.desc}. Unsanitized values can create injection risk.`,line:a,column:s,severity:r.severity,fix:x["template-no-unsafe-bindings"]}},{requires:{htmlAst:true}});var pe="no-document-access",wr=new Set(["document","window","localStorage","sessionStorage","navigator","location"]),gt=engine.createAnyAngularClassRule(pe,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let{typeChecker:n}=e;if(!n)return null;let a=D(e);if(!a)return null;let s=(function(p){let i=new Set,l=[...p];for(;l.length;){let o=g(l.pop());if(o){if(o.type==="VariableDeclarator"&&o.init){let u=g(o.init);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=o.id??o.key;m?.type==="Identifier"&&m.name&&i.add(m.name);}}if(o.type==="AssignmentExpression"&&o.right){let u=g(o.right);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=g(o.left);if(m&&C(m)&&g(m.object)?.type==="ThisExpression"){let y=m.property?.name;typeof y=="string"&&y&&i.add(y);}}}for(let u of k(o))l.push(u);}}return i})(r),c=[],f=new Set,d=[...r];for(;d.length;){let p=g(d.pop());if(p){if(p.type==="IfStatement"&&p.test){let i=g(p.test);if(i){let l=(function(o,u){let m=[o];for(;m.length;){let y=g(m.pop());if(y){if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformBrowser"))return "browser";if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformServer"))return "server";if(y.type==="UnaryExpression"&&y.operator==="!"&&y.argument){let h=g(y.argument);if(h?.type==="CallExpression"&&h.callee&&T(h.callee,"isPlatformServer"))return "browser"}if(y.type==="Identifier"&&u.has(y.name))return "browser";for(let h of k(y))m.push(h);}}return null})(i,s);if(l==="browser"){p.alternate&&d.push(p.alternate);continue}if(l==="server"){p.consequent&&d.push(p.consequent);continue}}}if(p.type==="CallExpression"&&p.callee){let i=g(p.callee);if(i&&(T(i,"afterNextRender")||T(i,"afterRender"))){let l=p.arguments??[];for(let o=1;o<l.length;o++)d.push(l[o]);continue}}if(C(p)){let i=(function(o){let u=o;for(;u&&C(u);)u=g(u.object);return u?.type==="Identifier"?u:null})(p),l=i?.name;if(i&&l&&wr.has(l)&&(function(o,u,m){let y=(function(E,S){let A,v=w=>{if(!A){if(M__default.default.isIdentifier(w)&&w.getStart()===S){A=w;return}M__default.default.forEachChild(w,v);}};return v(E),A})(u,b(o));if(!y)return false;let h=m.getSymbolAtLocation(y);return Q((h&&h.flags&M__default.default.SymbolFlags.Alias?m.getAliasedSymbol(h):h)??void 0)})(i,a,n)){let o=b(i);if(o!==void 0&&!f.has(o)){f.add(o);let{line:u,column:m}=e.locator.location(o);c.push({filePath:e.filePath,ruleName:pe,message:`Direct access to \`${l}\` can run during SSR where browser globals do not exist.`,line:u,column:m,severity:"error",fix:x[pe],codeExample:P[pe]});}}}for(let i of k(p))d.push(i);}}return c.length?c:null},{requires:{typeChecker:true}});var fe="prefer-after-render-over-after-view-init",Pr=new Set(["ngAfterViewInit","ngAfterContentInit"]),ht=engine.createAnyAngularClassRule(fe,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r}=e;if(!r)return null;let n=(function(s,c){let f=D(c);if(!f)return;let d=b(s);for(let p of f.statements)if(M__default.default.isClassDeclaration(p)&&p.pos<=d&&d<=p.end)return p})(t.node,e);if(!n)return null;let a=[];for(let s of n.members){if(!M__default.default.isMethodDeclaration(s)||!s.body||!M__default.default.isIdentifier(s.name))continue;let c=s.name.text;if(!Pr.has(c)||!(function(p,i){let l=false,o=u=>{if(!l){if(M__default.default.isPropertyAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M__default.default.isElementAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M__default.default.isIdentifier(u)&&!(function(m){let y=m.parent;return !!y&&!!(M__default.default.isPropertyAccessExpression(y)&&y.name===m||M__default.default.isQualifiedName(y)&&y.right===m)})(u)){let m=i.getSymbolAtLocation(u);if(Q((m&&m.flags&M__default.default.SymbolFlags.Alias?i.getAliasedSymbol(m):m)??void 0)){l=true;return}}M__default.default.forEachChild(u,o);}};return o(p),l})(s.body,r))continue;let{line:f,column:d}=e.locator.location(s.getStart());a.push({filePath:e.filePath,ruleName:fe,message:`\`${c}\` contains DOM access that can run before browser-only APIs are safe.`,line:f,column:d,severity:"warn",fix:x[fe],codeExample:P[fe]});}return a.length?a:null},{requires:{typeChecker:true}});function yt(t){let e=t.aliasSymbol??t.symbol;return !!e&&Q(e)}var me=new Map;function Be(t){let e=D(t);if(!e)return false;for(let r of e.statements)if(M__default.default.isClassDeclaration(r))for(let n of r.members){if(!M__default.default.isMethodDeclaration(n)||!n.name||!M__default.default.isIdentifier(n.name)||n.name.text!=="ngOnDestroy"||!n.body)continue;let a=false,s=c=>{if(!a){if(M__default.default.isCallExpression(c)&&M__default.default.isPropertyAccessExpression(c.expression)&&c.expression.name.text==="unsubscribe"&&c.arguments.length===0){a=true;return}M__default.default.forEachChild(c,s);}};if(s(n.body),a)return true}return false}var xt=engine.createCallExpressionRule("rxjs-require-takeUntilDestroyed",(t,e)=>{if(!oe(e)||!te(t))return null;let r=g(t.callee),n=C(r)?r?.object:null;if(n&&re(n)||ie(ne(n))||(function(f){let d=me.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return me.size>=500&&me.clear(),me.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:"rxjs-require-takeUntilDestroyed",message:"A component subscription without teardown can keep running after the component is destroyed.",line:s,column:c,severity:"error",fix:x["rxjs-require-takeUntilDestroyed"]}},{requires:{typeChecker:true}});var de=new Map,ge="rxjs-no-subscribe-in-component",Et=engine.createCallExpressionRule(ge,(t,e)=>{if(!oe(e)||!te(t)||(function(f){let d=g(f.callee);if(!d||!C(d))return false;let p=g(d.object);if(!p)return false;if(p.type==="CallExpression"){let i=g(p.callee);if(C(i)&&N(i)==="pipe"&&(Array.isArray(p.arguments)?p.arguments:[]).some(l=>{let o=g(l);if(o?.type!=="CallExpression")return false;let u=g(o.callee)?.name;return u==="take"||u==="first"}))return true}return ie(ne(p))})(t))return null;let r=g(t.callee),n=g(r?.object);if(n&&re(n)||(function(f){let d=de.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return de.size>=500&&de.clear(),de.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:ge,message:(function(f,d){let p="Open-ended subscriptions in components can outlive the component and make state harder to track.",i=d.crossRef?.templateReferences;if(!i)return p;let l=g(f.callee),o=g(l?.object),u=o?N(o):null;if(!u)return p;let m=u.endsWith("$")?u.slice(0,-1):u;return i.has(u)||i.has(m)?`'${u}' is read by the template, so subscribing manually adds state and teardown work the template can own.`:p})(t,e),line:s,column:c,severity:"error",fix:x[ge],codeExample:P[ge]}},{requires:{typeChecker:true,projectContext:true}});var ye="rxjs-avoid-subject-as-event-bus",bt=engine.createAnyAngularClassRule(ye,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=F(t.node);if(a.length===0)return null;let s=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=g(u.callee);if(m&&(m.type==="Identifier"?m.name:C(m)?N(m):"")==="takeUntil")for(let y of Array.isArray(u.arguments)?u.arguments:[]){let h=St(y);h&&l.add(h);}});return l})(a),c=(function(i){let l=new Set,o=m=>{he(m??null,y=>{let h=Ue(y,"next");h&&l.add(h);});},u=Qe(i);for(let m of(u&&o(z(u)),i))if(H(m)){let y=m.key?.name;m.kind==="set"&&(function(h){let E=h.decorators;if(!Array.isArray(E))return false;for(let S of E){let A=g(S.expression);if(A?.name==="Input"||g(A?.callee)?.name==="Input")return true}return false})(m)&&o(m),y==="ngOnChanges"&&o(z(m));}else m.type==="PropertyDefinition"&&m.value&&o(m.value);return l})(a),f=(function(i){let l=new Set;for(let o of i)H(o)&&o.key?.name==="ngOnDestroy"&&he(z(o),u=>{let m=Ue(u,"complete");m&&l.add(m);});return l})(a),d=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=Ue(u,"pipe");m&&l.add(m);});return l})(a),p=[];for(let i of a){if(i.type!=="PropertyDefinition"||i.accessibility==="public")continue;let l=i.key?.name??"";if(!l||s.has(l)||c.has(l)||f.has(l)||d.has(l))continue;let o=et(i.key,e);if(!o)continue;let u=o.valueDeclaration??o.declarations?.[0];if(!u)continue;let m=r.getTypeOfSymbolAtLocation(o,u);if(!n.isSubjectLike(m))continue;let{line:y,column:h}=e.locator.location(b(i));p.push({filePath:e.filePath,ruleName:ye,message:`'${l}' is a Subject the class signals into without piping or external exposure \u2014 components are easier to follow when local state lives in fields or signals.`,line:y,column:h,severity:"warn",fix:x[ye],codeExample:P[ye]});}return p.length>0?p:null});function he(t,e){if(!t)return;let r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&e(n),k(n)))r.push(a);}}function St(t){let e=g(t);if(!e||!C(e))return null;let r=g(e.object),n=N(e);return n&&r?.type==="ThisExpression"?n:null}function Ue(t,e){let r=g(t.callee);return r&&C(r)&&N(r)===e?St(r.object):null}var qe="rxjs-prefer-toSignal-for-template-state",At=engine.createAnyAngularClassRule(qe,(t,e)=>{if(t.metadata?.type!=="Component")return null;let n=e.crossRef?.templateReferences;if(n===void 0)return null;let{typeChecker:a,angularTypes:s}=e;if(!a||!s)return null;let c=(function(p,i){let l=D(i);if(!l)return;let o=b(p);for(let u of l.statements)if(M__default.default.isClassDeclaration(u)&&u.pos<=o&&o<=u.end)return u})(t.node,e);if(!c)return null;let f=[];for(let p of c.members){var d;if(!M__default.default.isPropertyDeclaration(p))continue;let i=(function(m){if(M__default.default.isIdentifier(m.name)||M__default.default.isStringLiteral(m.name))return m.name.text})(p);if(!i||!n.has(i)&&!n.has((d=i).endsWith("$")?d.slice(0,-1):d)||(function(m,y,h){let E=M__default.default.getDecorators(m);if(!E)return false;for(let S of E){let A=M__default.default.isCallExpression(S.expression)?S.expression.expression:S.expression;if(!M__default.default.isIdentifier(A)||A.text!=="Output")continue;let v=y.getSymbolAtLocation(A),w=v&&v.flags&M__default.default.SymbolFlags.Alias?y.getAliasedSymbol(v):v;if(h.isFromAngularCore(w))return true}return false})(p,a,s))continue;let l=a.getTypeAtLocation(p);if(!s.isObservable(l)&&!s.isSubjectLike(l))continue;let{line:o,column:u}=e.locator.location(p.getStart());f.push({filePath:e.filePath,ruleName:qe,message:`Observable "${i}" is read by the template, which can add async-pipe churn and weaker signal integration.`,line:o,column:u,severity:"warn",fix:x[qe]});}return f.length?f:null},{requires:{projectContext:true,htmlAst:true,typeChecker:true}});var He="toSignal-require-initialValue",Ct=engine.createCallExpressionRule(He,(t,e)=>{if(!T(t.callee,"toSignal"))return null;let r=Array.isArray(t.arguments)?t.arguments:[],n=r[1]?g(r[1]):null;if(!n||n.type!=="ObjectExpression"||!(function(a){let s=Y(a,"initialValue");if(s&&!we(s.value))return true;let c=Y(a,"requireSync");return !!c&&Re(c.value)})(n)){let{line:a,column:s}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:He,message:"toSignal() can emit undefined before the observable produces a value.",line:a,column:s,severity:"warn",fix:x[He]}}return null});var ze="signal-prefer-computed-over-sync-effect",jr=new Set(["setTimeout","setInterval","queueMicrotask","requestAnimationFrame"]),Fr=new Set(["then","catch","finally"]),_r=new Set(["set","update","mutate"]),Nt=engine.createCallExpressionRule(ze,(t,e)=>{var r,n;let a,s,c,f,d,p;if(!T(t.callee,"effect"))return null;let{typeChecker:i,angularTypes:l}=e;if(!i||!l)return null;let o=(function(S,A){let v,w=D(S);if(!w)return;let L=O=>{if(!v){if(M__default.default.isCallExpression(O)&&O.getStart()===A){v=O;return}M__default.default.forEachChild(O,L);}};return L(w),v})(e,b(t));if(!o)return null;let u=o.arguments[0];if(!u||!(M__default.default.isArrowFunction(u)||M__default.default.isFunctionExpression(u)))return null;let m=(r=u.body,n={typeChecker:i,angularTypes:l},s=false,c=false,f=false,d=false,(p=S=>{f&&d&&s&&c||((S.kind===M__default.default.SyntaxKind.AwaitExpression||S.kind===M__default.default.SyntaxKind.YieldExpression)&&(f=true),M__default.default.isCallExpression(S)&&(function(A,v,w){var L,O;if(M__default.default.isPropertyAccessExpression(A.expression)){let U,j=A.expression.name.text,K=A.expression.expression,q=v.typeChecker.getTypeAtLocation(K);return _r.has(j)&&v.angularTypes.isWritableSignal(q)?w.onSignalWrite():(j==="subscribe"&&(v.angularTypes.isObservable(q)||v.angularTypes.isSubjectLike(q))||Fr.has(j)&&(U=(L=q).aliasSymbol??L.symbol)&&U.name==="Promise"&&vt(U))&&w.onAsync()}if(M__default.default.isIdentifier(A.expression)){let U,j=A.expression.text;if(j==="linkedSignal")return w.onLinkedSignal();if(jr.has(j)&&(O=A.expression,(U=v.typeChecker.getSymbolAtLocation(O))&&vt(U)))return w.onAsync();A.arguments.length===0&&(function(K,q){let Z=q.typeChecker.getSymbolAtLocation(K);if(!Z)return false;let Ve=Z.valueDeclaration??Z.declarations?.[0];if(!Ve)return false;let Ht=q.typeChecker.getTypeOfSymbolAtLocation(Z,Ve);return q.angularTypes.isSignal(Ht)})(A.expression,v)&&w.onSignalRead();}})(S,n,{onSignalRead:()=>{s=true;},onSignalWrite:()=>{c=true,a??=S;},onAsync:()=>{f=true;},onLinkedSignal:()=>{d=true;}}),M__default.default.forEachChild(S,p));})(r),{hasSignalRead:s,hasSignalWrite:c,hasAsync:f,hasLinkedSignal:d,firstWrite:a});if(!m.hasSignalRead||!m.hasSignalWrite||m.hasAsync||m.hasLinkedSignal)return null;let y=m.firstWrite??o,{line:h,column:E}=e.locator.location(y.getStart());return {filePath:e.filePath,ruleName:ze,message:"This effect reads reactive values and writes derived state, which adds extra reactive cycles.",line:h,column:E,severity:"warn",fix:x[ze]}},{requires:{typeChecker:true}});function vt(t){let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib."))return true;return false}var Rt=new Set(["afterRender","afterNextRender"]),Br=/\bafterNextRender\s*\(|\bafterRender\s*\(/,xe=new Map,wt=engine.createCallExpressionRule("signal-avoid-untracked-overuse",(t,e)=>{if(!T(t.callee,"untracked")||(function(a,s){let c=s.sourceText??s.fileContent;if(typeof c=="string"&&!Br.test(c))return false;let f=a.parent;for(;f;){if(f.type==="CallExpression"&&Rt.has(Ne(f)))return true;f=f.parent;}let d=b(a);return (function(p){let i=xe.get(p.filePath);if(i!==void 0)return i;let l=p.program;return i=l?(function(o){let u=[],m=o.body,y=Array.isArray(m)?[...m]:[o];for(;y.length;){let h=g(y.pop());if(h){if(h.type==="CallExpression"&&Rt.has(Ne(h))){let E=g(h.arguments?.[0]);if(E){let S=b(E),A=E.end??E.span?.end??b(E);A>S&&u.push([S,A]);}}for(let E of k(h))y.push(E);}}return u})(l):[],xe.size>=300&&xe.clear(),xe.set(p.filePath,i),i})(s).some(([p,i])=>d>=p&&d<i)})(t,e))return null;let{line:r,column:n}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"signal-avoid-untracked-overuse",message:"untracked() hides this read from dependency tracking, which can mask stale reactive state.",line:r,column:n,severity:"warn",fix:x["signal-avoid-untracked-overuse"]}});var Ee="prefer-inject-over-constructor-di",qr=new Set(["Inject","Optional","Self","SkipSelf","Host"]),Mt=engine.createAnyAngularClassRule(Ee,(t,e)=>{let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(l,o){var u;let m=(u=o).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M__default.default.createSourceFile(u.filePath,u.fileContent,M__default.default.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!m)return;let y=b(l);for(let h of m.statements)if(M__default.default.isClassDeclaration(h)&&h.pos<=y&&y<=h.end)return h})(t.node,e);if(!a)return null;let s=a.members.find(M__default.default.isConstructorDeclaration);if(!s||s.parameters.length===0)return null;let c=[];for(let l of s.parameters){var f;(function(o,u,m){if((function(E,S,A){let v=M__default.default.getDecorators(E);if(!v||v.length===0)return false;for(let w of v){let L=(function(j){let K=M__default.default.isCallExpression(j.expression)?j.expression.expression:j.expression;return M__default.default.isIdentifier(K)?K:void 0})(w);if(!L||!qr.has(L.text))continue;let O=S.getSymbolAtLocation(L),U=O&&O.flags&M__default.default.SymbolFlags.Alias?S.getAliasedSymbol(O):O;if(A.isFromAngularCore(U))return true}return false})(o,u,m))return true;if(!o.type)return false;let y=u.getTypeFromTypeNode(o.type);if(m.isInjectionToken(y))return true;let h=y.aliasSymbol??y.symbol;return !!h&&m.isInjectableClass(h)})(l,r,n)&&c.push((f=l,{name:M__default.default.isIdentifier(f.name)?f.name.text:"<binding>",typeText:f.type?f.type.getText():"<inferred>"}));}if(c.length===0)return null;let{line:d,column:p}=e.locator.location(b(s)),i=c.map(l=>`${l.name}: ${l.typeText}`).join(", ");return {filePath:e.filePath,ruleName:Ee,message:`Constructor dependency injection makes class setup less composable than inject(). Offending params: ${i}.`,line:d,column:p,severity:"warn",fix:x[Ee],codeExample:P[Ee]}},{requires:{typeChecker:true}});var be="signal-prefer-input-signal";function zr(t){let e=g(t.expression??t);if(!e)return false;if(e.type==="Identifier")return e.name==="Input";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"&&r.name==="Input"}return false}var Pt=engine.createAnyAngularClassRule(be,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=[],a=e.project?.standaloneComponents?.has(e.filePath)??false;for(let s of r){let c=g(s);if(c&&(c.type==="PropertyDefinition"||c.type==="AccessorProperty")&&Array.isArray(c.decorators)&&c.decorators.some(zr)){let f=b(c),{line:d,column:p}=e.locator.location(f),i=g(c.key),l=(i?.type==="Identifier"?i.name:i?.type==="Literal"?String(i.value):"")||"(unknown)",o=`'${l}' uses @Input(), which keeps this input outside Angular's signal graph.`;a&&(o+=" Standalone declarations benefit most from signal inputs."),n.push({filePath:e.filePath,ruleName:be,message:o,line:d,column:p,severity:a?"error":"warn",fix:x[be],codeExample:P[be]});}}return n.length>0?n:null},{requires:{projectContext:true}});var Se="signal-prefer-output-function",Tt=engine.createAnyAngularClassRule(Se,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(c,f){let d=D(f);if(!d)return;let p=b(c);for(let i of d.statements)if(M__default.default.isClassDeclaration(i)&&i.pos<=p&&p<=i.end)return i})(t.node,e);if(!a)return null;let s=[];for(let c of a.members){if(!M__default.default.isPropertyDeclaration(c)||!(function(i,l,o){let u=M__default.default.getDecorators(i);if(!u)return false;for(let m of u){let y=M__default.default.isCallExpression(m.expression)?m.expression.expression:m.expression;if(!M__default.default.isIdentifier(y)||y.text!=="Output")continue;let h=l.getSymbolAtLocation(y),E=h&&h.flags&M__default.default.SymbolFlags.Alias?l.getAliasedSymbol(h):h;if(o.isFromAngularCore(E))return true}return false})(c,r,n)||!(function(i,l,o){if(i.type){let m=l.getTypeFromTypeNode(i.type);if(o.isEventEmitter(m))return true}if(i.initializer){let m=l.getTypeAtLocation(i.initializer);if(o.isEventEmitter(m))return true}let u=l.getSymbolAtLocation(i.name);if(u){let m=l.getTypeOfSymbolAtLocation(u,i);if(o.isEventEmitter(m))return true}return false})(c,r,n))continue;let f=(function(i){let l=i.name;if(M__default.default.isIdentifier(l)||M__default.default.isStringLiteral(l))return l.text})(c)??"(unknown)",{line:d,column:p}=e.locator.location(c.getStart());s.push({filePath:e.filePath,ruleName:Se,message:`'${f}' uses @Output() EventEmitter, which adds boilerplate compared with output().`,line:d,column:p,severity:"warn",fix:x[Se],codeExample:P[Se]});}return s.length>0?s:null},{requires:{typeChecker:true}});var Ae="signal-prefer-model";function kt(t,e){return Array.isArray(t.decorators)&&t.decorators.some(r=>{let n=g(r.expression??r);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(n.type==="CallExpression"){let a=g(n.callee);return a?.type==="Identifier"&&a.name===e}return false})}function Ot(t,e){let r=g(t.value);if(!r||r.type!=="CallExpression")return false;let n=g(r.callee);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(C(n)){let a=g(n.object);return a?.type==="Identifier"&&a.name===e}return false}var Dt=engine.createAnyAngularClassRule(Ae,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=new Map,a=new Map;for(let c of r){let f=g(c);if(!f||f.type!=="PropertyDefinition"&&f.type!=="AccessorProperty")continue;let d=(function(p){let i=g(p.key);return i?i.type==="Identifier"?i.name??null:i.type==="Literal"?String(i.value):null:null})(f);d&&((kt(f,"Input")||Ot(f,"input"))&&n.set(d,f),(kt(f,"Output")||Ot(f,"output"))&&a.set(d,f));}let s=[];for(let[c,f]of a){if(!c.endsWith("Change"))continue;let d=c.slice(0,-6),p=n.get(d);if(p){let i=b(p),{line:l,column:o}=e.locator.location(i);s.push({filePath:e.filePath,ruleName:Ae,message:`The \`${d}\` / \`${c}\` pair implements two-way binding with extra wiring that model() avoids.`,line:l,column:o,severity:"warn",fix:x[Ae],codeExample:P[Ae]});}}return s.length>0?s:null});var Xr=new Map([["*ngIf","@if"],["*ngFor","@for"],["*ngSwitch","@switch"],["[ngSwitch]","@switch"],["*ngSwitchCase","@case"],["*ngSwitchDefault","@default"]]),We="template-prefer-control-flow",It=engine.createTemplateAttributeRule(We,(t,e)=>{var r;let n=(r=t.name,Xr.get(r)??null);if(!n)return null;let a=I(e,t.sourceSpan.start),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:We,message:`\`${t.name}\` uses legacy structural directive syntax, so it misses the \`${n}\` control flow benefits.`,line:s,column:c,severity:"error",fix:x[We]}},{requires:{htmlAst:true}});var Lt=new WeakMap,jt=engine.createTemplateExpressionRule("template-no-async-pipe-duplication",(t,e)=>{let r,n,a=(function p(i){let l=g(i);if(!l)return null;if(l.type==="BinaryExpression"&&l.operator==="|"){let o=g(l.right);return o?.type==="Identifier"&&o.name==="async"?g(l.left):p(l.left)}return null})(t.expression),s=a?(function p(i,l=0){if(!i||l>10)return null;if(i.type==="Identifier")return i.name;if(i.type==="ThisExpression")return "this";if(i.type==="Literal"){let o=i.value;return o===null?"null":typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="bigint"?String(o):null}if(i.type==="CallExpression"){let o=p(i.callee,l+1),u=(Array.isArray(i.arguments)?i.arguments:[]).map(m=>p(m,l+1)??"?");return `${o}(${u.join(",")})`}if(C(i)){let o=p(i.object,l+1),u=N(i);if(o&&u)return `${o}.${u}`}if(i.type==="UnaryExpression")return `${i.operator}${p(i.argument,l+1)}`;if(i.type==="ConditionalExpression")return `${p(i.test,l+1)}?${p(i.consequent,l+1)}:${p(i.alternate,l+1)}`;if(i.type==="OptionalExpression"||i.type==="ChainExpression")return p(i.expression,l+1);if(i.type==="LogicalExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="BinaryExpression"&&i.operator!=="|"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="ArrayExpression")return `[${(i.elements??[]).map(u=>p(u,l+1)??"?").join(",")}]`;if(i.type==="ObjectExpression")return `{${(i.properties??[]).map(u=>{let m=u.key?p(u.key,l+1):"?",y=u.value?p(u.value,l+1):"?";return `${m}:${y}`}).join(",")}}`;if(i.type==="TemplateLiteral")return "`tmpl`";if(i.type==="AssignmentExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}return null})(a):null;if(!s)return null;let c=(r=e.template,n=r?.templateStartOffset,`${e.filePath}@${typeof n=="number"&&Number.isFinite(n)?n:0}`),f=Lt.get(e);f||(f=new Map,Lt.set(e,f));let d=f.get(c);if(d||(d=new Set,f.set(c,d)),d.has(s)){let p=I(e,t.sourceSpan.start),{line:i,column:l}=e.locator.location(p);return {filePath:e.filePath,ruleName:"template-no-async-pipe-duplication",message:`Duplicate async pipe subscriptions for "${s}" can create repeated work and inconsistent loading states.`,line:i,column:l,severity:"warn",fix:x["template-no-async-pipe-duplication"]}}return d.add(s),null},{requires:{htmlAst:true}});var Qr=new Set(["fdescribe","fit","describe.only","it.only","test.only","context.only","xdescribe","xit","xtest","xcontext"]),Zr=new Set(["xdescribe","xit","xtest","xcontext"]);function Ft(t){return t.type==="Identifier"?t.name??null:null}var _t=engine.createCallExpressionRule("spec-no-focused-test",(t,e)=>{var r;let n;if(!((r=e.filePath).endsWith(".spec.ts")||r.endsWith(".test.ts")))return null;let a=g(t.callee);if(!a)return null;let s=(n=Ft(a)||(function(i){if(i.type==="MemberExpression"||i.type==="StaticMemberExpression"||i.type==="OptionalMemberExpression"){let l=g(i.object),o=i.property?.name??"",u=(l?.type==="Identifier"?l.name:"")??"";return u?`${u}.${o}`:null}return null})(a))&&Qr.has(n)?n:null;if(!s){if(Ft(a)==="pending"){let i=b(t),{line:l,column:o}=e.locator.location(i);return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:"`pending()` disables the test body, so the committed suite can miss coverage.",line:l,column:o,severity:"error",fix:x["spec-no-focused-test"]}}return null}let c=b(t),{line:f,column:d}=e.locator.location(c),p=Zr.has(s)?`\`${s}\` disables a test that may be forgotten.`:`\`${s}\` is a focused test helper that can skip the rest of the suite in CI.`;return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:p,line:f,column:d,severity:"error",fix:x["spec-no-focused-test"]}},{dependencyType:"spec",requires:{tsAst:true}});function $t(){R(tt,"correctness"),R(rt,"correctness"),R(nt,"correctness"),R(ot,"correctness"),R(at,"performance"),R(lt,"performance"),R(ct,"performance"),R(pt,"performance"),R(ft,"performance"),R(mt,"security"),R(dt,"security"),R(gt,"ssr"),R(ht,"ssr"),R(Et,"reactivity"),R(xt,"reactivity"),R(bt,"reactivity"),R(At,"reactivity"),R(Ct,"reactivity"),R(Nt,"reactivity"),R(wt,"reactivity"),R(Mt,"modern-api"),R(Pt,"modern-api"),R(Tt,"modern-api"),R(Dt,"modern-api"),R(It,"template"),R(jt,"template"),R(_t,"testing");}var Bt=(t,e,r,n,a)=>{let s=0,c=0;for(let f of r)for(let d of f.failures)d.severity==="error"?s++:d.severity==="warn"&&c++;return {kind:"file-progress",filePath:t,taskCount:e,issueCount:s+c,errorCount:s,warningCount:c,duration:n,typeAware:a}};$t(),engine.configureRuleExecutor(Xe,Ke),process.on("message",t=>{on(t);});var on=async t=>{let e=engine.createTypeAwareAnalysisContext(t.rootDir,t.files,t.parserOptions,{buildProjectContext:t.buildProjectContext,programRootFiles:t.programRootFiles});try{await e.warmup(),process.send?.({kind:"ready"});let r=planner.groupTasksByFile(t.tasks);await an(Array.from(r),Math.max(1,t.fileConcurrency??1),async([n,a])=>{process.send?.({kind:"file-start",filePath:n});let s=performance.now();try{let c=await engine.executeBatchedTasks(a,e);Ut(n,a.length,c,performance.now()-s),qt(n,c);}catch{Ut(n,a.length,[],performance.now()-s),qt(n,[]);}finally{e.evict(n),engine.requestGarbageCollectionUnderPressure(.8);}}),process.send?.({kind:"complete"});}catch(r){process.send?.({kind:"error",error:r instanceof Error?r.message:String(r)});}finally{e.dispose(),process.disconnect?.();}};async function an(t,e,r){let n=Array(t.length),a=0,s=Math.min(e,t.length);return await Promise.all(Array.from({length:s},async()=>{for(;a<t.length;){let c=a++;n[c]=await r(t[c]);}})),n}var Ut=(t,e,r,n)=>{process.send?.(Bt(t,e,r,n,true));},qt=(t,e)=>{process.send?.({kind:"file-result",filePath:t,results:e});};//# sourceMappingURL=type-aware-worker.cjs.map | ||
| //# sourceMappingURL=type-aware-worker.cjs.map |
@@ -1,2 +0,2 @@ | ||
| import {groupTasksByFile}from'@ngcompass/planner';import {createAnyAngularClassRule,createCallExpressionRule,createComponentRule,createTemplateExpressionRule,createTemplateRule,createTemplateAttributeRule,configureRuleExecutor,createTypeAwareAnalysisContext,executeBatchedTasks,runSinglePassAnalysis}from'@ngcompass/engine';import {debug}from'@ngcompass/common';import M from'typescript';import {analyzeComponent,ChangeDetectionStrategy}from'@ngcompass/ast';var Ht=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var zt={severity:"warn",options:{}},ve=class{_handlers=new Map;_meta=new Map;register(e,r={}){if(this._handlers.has(e.name)&&!r.allowOverride)throw Error(`[ngcompass] Rule "${e.name}" is already registered. Use allowOverride: true to replace an existing rule intentionally.`);this._handlers.set(e.name,e.handler),e.meta&&this._meta.set(e.name,e.meta);}get(e){return this._handlers.get(e)}has(e){return this._handlers.has(e)}getRuleNames(){return Array.from(this._handlers.keys())}getAll(){return this._handlers}getMeta(e){return this._meta.get(e)}getMetadata(e){if(!this._handlers.has(e))return;let r=this._meta.get(e)??{};return {name:e,description:r.description??`Rule: ${e}`,category:r.category??"general",dependencyType:r.dependencyType??"standalone",requires:{tsAst:true,...r.requires},filePatterns:r.filePatterns}}getRegistryEntry(e){let r=this.getMetadata(e);if(r)return {name:e,metadata:r,defaultConfig:zt}}toReadonlyMap(){let e=new Map;for(let r of this._handlers.keys()){let n=this.getRegistryEntry(r);n&&e.set(r,n);}return e}get size(){return this._handlers.size}},Ce=null,J=()=>(Ce||(Ce=new ve),Ce);var R=(t,e)=>{let r={name:t.name,handler:t,meta:{dependencyType:"component",...t.meta,category:e??t.meta?.category??"best-practice",requires:t.meta?.requires??{}}};J().register(r),debug("engine",`Registered rule: ${t.name}`);},Ke=t=>J().has(t),Xe=(t,e)=>{let r=J(),n=[];for(let f of t){let d=r.get(f);d&&n.push(d);}if(n.length===0)return [];debug("engine",`Executing ${n.length} rules in single pass on ${e.filePath}`);let{results:a,performance:s}=runSinglePassAnalysis(n,e);debug("engine",`Single-pass complete: ${s.traversalMs.toFixed(2)}ms, ${s.nodesVisited} nodes`);let c=s.cacheStats.hits+s.cacheStats.misses;if(c>0){let f=s.cacheStats.hits/c*100;debug("engine",`Component metadata cache hit rate: ${f.toFixed(1)}%`);}return s.budgetViolations.length>0&&debug("engine",`Performance budget violations: ${s.budgetViolations.join("; ")}`),a};var x={"prefer-on-push-component-change-detection":"Add `changeDetection: ChangeDetectionStrategy.OnPush` to the component metadata.","template-no-call-expression":"Move the value to a pipe, computed signal, or cached component property.","rxjs-no-subscribe-in-component":"Use `toSignal()` or the `async` pipe for view state; add `takeUntilDestroyed()` for long-lived imperative subscriptions.","template-trackby-required":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-trackby-required-for-ngfor":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-no-object-literal-binding":"Move the object to a component property, signal, computed value, or pure pipe.","template-no-array-literal-binding":"Move the array to a component property, signal, computed value, or pure pipe.","toSignal-require-initialValue":"Pass `{ initialValue }` or `{ requireSync: true }` so the signal has a stable type.","rxjs-avoid-subject-as-event-bus":"Use `signal()` for component UI state; move complex async pipelines into a service.","signal-no-side-effects-in-computed":"Move side effects to an `effect()` or method, and keep `computed()` pure.","signal-no-writes-in-computed":"Move `.set()` or `.update()` calls to an `effect()` or event handler.","prefer-inject-over-constructor-di":"Replace constructor parameters with field initializers that call `inject()`.","component-no-manual-detect-changes":"Use signals, `async` pipe, or input-driven state instead of calling `detectChanges()` or `markForCheck()`.","rxjs-require-takeUntilDestroyed":"Add `takeUntilDestroyed()` or another teardown operator before `subscribe()`.","template-no-async-pipe-duplication":"Store the async value once with `@if (... | async; as value)` or a view-model signal.","rxjs-prefer-toSignal-for-template-state":"Convert template-used observables to `toSignal()` and read them as signals in the template.","signal-effect-must-be-destroy-scoped":"Create the effect in an injection context or pass an explicit `{ injector }`.","signal-no-effect-in-constructor":"Move the `effect()` call to a field initializer.","signal-prefer-computed-over-sync-effect":"Replace the write-producing `effect()` with a `computed()` signal.","signal-avoid-untracked-overuse":"Remove `untracked()` unless the dependency must be intentionally ignored.","template-prefer-control-flow":"Replace the legacy directive with the matching `@if`, `@for`, or `@switch` block.","signal-prefer-input-signal":"Replace `@Input()` with `input()` or `input.required()`.","signal-prefer-output-function":"Replace `@Output() EventEmitter` with `output<T>()`.","no-bypass-sanitization":"Use Angular sanitization or a trusted server-side sanitizer instead of `bypassSecurityTrust*`.","rxjs-no-nested-subscribe":"Flatten the stream with `switchMap`, `mergeMap`, `concatMap`, or `exhaustMap`.","no-document-access":"Inject `DOCUMENT` or move browser-only DOM work into `afterNextRender()`.","template-no-unsafe-bindings":"Sanitize the value before binding, or replace the raw HTML binding with structured template content.","signal-prefer-model":"Replace the `@Input()` / `@Output()Change` pair with `model()`.","prefer-after-render-over-after-view-init":"Move browser-only DOM access into `afterNextRender()`.","spec-no-focused-test":"Replace focused or disabled test helpers with normal `describe` and `it` calls."},P={"prefer-on-push-component-change-detection":`// Before: | ||
| import {groupTasksByFile}from'@ngcompass/planner';import {createAnyAngularClassRule,createCallExpressionRule,createComponentRule,createTemplateExpressionRule,createTemplateRule,createTemplateAttributeRule,configureRuleExecutor,createTypeAwareAnalysisContext,executeBatchedTasks,requestGarbageCollectionUnderPressure,runSinglePassAnalysis}from'@ngcompass/engine';import {debug}from'@ngcompass/common';import M from'typescript';import {analyzeComponent,ChangeDetectionStrategy}from'@ngcompass/ast';var zt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Wt={severity:"warn",options:{}},ve=class{_handlers=new Map;_meta=new Map;register(e,r={}){if(this._handlers.has(e.name)&&!r.allowOverride)throw Error(`[ngcompass] Rule "${e.name}" is already registered. Use allowOverride: true to replace an existing rule intentionally.`);this._handlers.set(e.name,e.handler),e.meta&&this._meta.set(e.name,e.meta);}get(e){return this._handlers.get(e)}has(e){return this._handlers.has(e)}getRuleNames(){return Array.from(this._handlers.keys())}getAll(){return this._handlers}getMeta(e){return this._meta.get(e)}getMetadata(e){if(!this._handlers.has(e))return;let r=this._meta.get(e)??{};return {name:e,description:r.description??`Rule: ${e}`,category:r.category??"general",dependencyType:r.dependencyType??"standalone",requires:{tsAst:true,...r.requires},filePatterns:r.filePatterns}}getRegistryEntry(e){let r=this.getMetadata(e);if(r)return {name:e,metadata:r,defaultConfig:Wt}}toReadonlyMap(){let e=new Map;for(let r of this._handlers.keys()){let n=this.getRegistryEntry(r);n&&e.set(r,n);}return e}get size(){return this._handlers.size}},Ce=null,J=()=>(Ce||(Ce=new ve),Ce);var R=(t,e)=>{let r={name:t.name,handler:t,meta:{dependencyType:"component",...t.meta,category:e??t.meta?.category??"best-practice",requires:t.meta?.requires??{}}};J().register(r),debug("engine",`Registered rule: ${t.name}`);},Ke=t=>J().has(t),Xe=(t,e)=>{let r=J(),n=[];for(let f of t){let d=r.get(f);d&&n.push(d);}if(n.length===0)return [];debug("engine",`Executing ${n.length} rules in single pass on ${e.filePath}`);let{results:a,performance:s}=runSinglePassAnalysis(n,e);debug("engine",`Single-pass complete: ${s.traversalMs.toFixed(2)}ms, ${s.nodesVisited} nodes`);let c=s.cacheStats.hits+s.cacheStats.misses;if(c>0){let f=s.cacheStats.hits/c*100;debug("engine",`Component metadata cache hit rate: ${f.toFixed(1)}%`);}return s.budgetViolations.length>0&&debug("engine",`Performance budget violations: ${s.budgetViolations.join("; ")}`),a};var x={"prefer-on-push-component-change-detection":"Add `changeDetection: ChangeDetectionStrategy.OnPush` to the component metadata.","template-no-call-expression":"Move the value to a pipe, computed signal, or cached component property.","rxjs-no-subscribe-in-component":"Use `toSignal()` or the `async` pipe for view state; add `takeUntilDestroyed()` for long-lived imperative subscriptions.","template-trackby-required":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-trackby-required-for-ngfor":"Add `trackBy` to `*ngFor`, or use `track` when migrating to `@for`.","template-no-object-literal-binding":"Move the object to a component property, signal, computed value, or pure pipe.","template-no-array-literal-binding":"Move the array to a component property, signal, computed value, or pure pipe.","toSignal-require-initialValue":"Pass `{ initialValue }` or `{ requireSync: true }` so the signal has a stable type.","rxjs-avoid-subject-as-event-bus":"Use `signal()` for component UI state; move complex async pipelines into a service.","signal-no-side-effects-in-computed":"Move side effects to an `effect()` or method, and keep `computed()` pure.","signal-no-writes-in-computed":"Move `.set()` or `.update()` calls to an `effect()` or event handler.","prefer-inject-over-constructor-di":"Replace constructor parameters with field initializers that call `inject()`.","component-no-manual-detect-changes":"Use signals, `async` pipe, or input-driven state instead of calling `detectChanges()` or `markForCheck()`.","rxjs-require-takeUntilDestroyed":"Add `takeUntilDestroyed()` or another teardown operator before `subscribe()`.","template-no-async-pipe-duplication":"Store the async value once with `@if (... | async; as value)` or a view-model signal.","rxjs-prefer-toSignal-for-template-state":"Convert template-used observables to `toSignal()` and read them as signals in the template.","signal-effect-must-be-destroy-scoped":"Create the effect in an injection context or pass an explicit `{ injector }`.","signal-no-effect-in-constructor":"Move the `effect()` call to a field initializer.","signal-prefer-computed-over-sync-effect":"Replace the write-producing `effect()` with a `computed()` signal.","signal-avoid-untracked-overuse":"Remove `untracked()` unless the dependency must be intentionally ignored.","template-prefer-control-flow":"Replace the legacy directive with the matching `@if`, `@for`, or `@switch` block.","signal-prefer-input-signal":"Replace `@Input()` with `input()` or `input.required()`.","signal-prefer-output-function":"Replace `@Output() EventEmitter` with `output<T>()`.","no-bypass-sanitization":"Use Angular sanitization or a trusted server-side sanitizer instead of `bypassSecurityTrust*`.","rxjs-no-nested-subscribe":"Flatten the stream with `switchMap`, `mergeMap`, `concatMap`, or `exhaustMap`.","no-document-access":"Inject `DOCUMENT` or move browser-only DOM work into `afterNextRender()`.","template-no-unsafe-bindings":"Sanitize the value before binding, or replace the raw HTML binding with structured template content.","signal-prefer-model":"Replace the `@Input()` / `@Output()Change` pair with `model()`.","prefer-after-render-over-after-view-init":"Move browser-only DOM access into `afterNextRender()`.","spec-no-focused-test":"Replace focused or disabled test helpers with normal `describe` and `it` calls."},P={"prefer-on-push-component-change-detection":`// Before: | ||
| @Component({ selector: 'app-foo', template: '...' }) | ||
@@ -216,3 +216,3 @@ export class FooComponent { } | ||
| it('should render', () => { ... }); | ||
| });`};var Ge;function g(t){let e=t;for(;e;){let r=e.type;if(r==="ChainExpression"||r==="TSNonNullExpression"||r==="TSAsExpression"||r==="ParenthesizedExpression"||r==="TSInstantiationExpression"||r==="TSSatisfiesExpression"){e=e.expression;continue}break}return e??null}function C(t){let e=t?.type;return e==="MemberExpression"||e==="StaticMemberExpression"||e==="OptionalMemberExpression"}function N(t){if(!t)return "";let e=t.property;return e?t.computed?e.type==="Literal"&&typeof e.value=="string"?e.value:"":e.name??"":""}function b(t){return t?t.start??t.span?.start??0:0}function T(t,e){let r=g(t);return !!r&&(r.type==="Identifier"?(r.name??"")===e:!!C(r)&&N(r)===e)}function Ne(t){let e=g(t);if(!e||e.type!=="CallExpression")return "";let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}function te(t){let e=g(t?.callee);return !!C(e)&&N(e)==="subscribe"}function Y(t,e){if(!t||t.type!=="ObjectExpression")return null;let r=t.properties;if(!Array.isArray(r))return null;for(let n of r){if(!n||n.type!=="Property")continue;let a=n.key;if((a?.type==="Identifier"?a.name:a?.type==="Literal"&&typeof a.value=="string"?a.value:"")===e)return n}return null}function Re(t){let e=g(t);return !!(e&&e.type==="Literal"&&e.value===true)}function we(t){let e=g(t);return !e||e.type==="Literal"&&e.value===null||e.type==="Identifier"&&e.name==="undefined"}var Vt=new Set(["parent","span","loc","range","start","end","type"]);function*O(t){if(t&&typeof t=="object"){if(Array.isArray(t)){for(let e of t)e&&typeof e=="object"&&(yield e);return}for(let e in t){if(Vt.has(e))continue;let r=t[e];if(r)if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&(yield n);else typeof r=="object"&&r.type&&(yield r);}}}function Me(t){if(!t)return false;if(t.kind==="constructor")return true;let e=t.key;return e?.type==="Identifier"&&e.name==="constructor"||e?.type==="Literal"&&e.value==="constructor"}function H(t){if(!t)return false;let e=t.type;return e==="MethodDefinition"||e==="TSAbstractMethodDefinition"||e==="ClassMethod"||e==="MethodDeclaration"}function Qe(t){for(let e of t)if(e&&H(e)&&Me(e))return e;return null}function z(t){return t?(t.value??t)?.body??null:null}function Ze(t){let e=t?.key;return e?e.type==="Identifier"?e.name??"<method>":e.type==="Literal"&&typeof e.value=="string"?e.value:"<method>":"<method>"}function F(t){if(!t)return [];let e=t.body;if(Array.isArray(e))return e;if(e&&typeof e=="object"&&"body"in e){let r=e.body;if(Array.isArray(r))return r}return []}function Kt(t){let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=e.arguments;if(!Array.isArray(r)||r.length<2)return false;let n=g(r[1]);if(!n||n.type!=="ObjectExpression")return false;let a=Y(n,"injector");if(a&&!we(a.value))return true;let s=Y(n,"manualCleanup");return !!(s&&Re(s.value))}function Je(t){if(!t)return [];let e=[],r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&T(n.callee,"effect")&&!Kt(n)&&e.push(n),O(n)))r.push(a);}return e}var Xt=new Set(["takeUntilDestroyed","takeUntil","take","first","takeWhile"]);function Gt(t){let e=g(t);if(!e)return "";if(e.type==="Identifier")return e.name??"";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}return C(e)?N(e):""}function Yt(t){let e=t.arguments;if(!Array.isArray(e))return false;for(let r of e)if(Xt.has(Gt(r)))return true;return false}function re(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)==="pipe"&&Yt(r))return true;e=n?.object;}return false}function I(t,e){return e}var Qt=new Set(["get","post","put","patch","delete","head","options","jsonp","request"]),Zt=new Set(["http","httpClient","_http","_httpClient"]),Jt=["get","fetch","load","save","create","update","delete","remove","submit","send","post","put","patch","upload","download"];function ne(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)!=="pipe")return r;e=n?.object;}return null}function ie(t){if(!t)return false;let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=g(e.callee);if(!C(r))return false;let n=N(r);if(!n)return false;let a=g(r?.object),s=Array.isArray(e.arguments)?e.arguments:[];if(Qt.has(n)&&C(a)){let c=N(a);if(Zt.has(c))return true}if(s.length>0){let c=n.toLowerCase();for(let f of Jt)if(c.startsWith(f)&&n.length>f.length)return true}return false}var Ye=false;function Pe(){if(!Ye){try{Ge=Ht("typescript");}catch{}Ye=true;}return Ge}function et(t,e){if(!t||!e.typeChecker)return;let r=Pe();if(r)try{!e.sourceFile&&e.fileContent&&(e.sourceFile=r.createSourceFile(e.filePath,e.fileContent,r.ScriptTarget.Latest,!0));let n=e.sourceFile;if(!n)return;let a=(function(s,c,f){if(c<s.getStart()||c>=s.getEnd())return;let d=s;for(;;){let p=f.forEachChild(d,i=>{if(c>=i.getStart()&&c<i.getEnd())return i});if(!p)break;d=p;}return d})(n,b(t),r);return a?e.typeChecker.getSymbolAtLocation(a):void 0}catch{return}}function D(t){if(t.sourceFile)return t.sourceFile;if(!t.fileContent)return;let e=Pe();if(e)return t.sourceFile=e.createSourceFile(t.filePath,t.fileContent,e.ScriptTarget.Latest,true),t.sourceFile}var ee=new Map;function oe(t){let e=ee.get(t.filePath);if(e!==void 0)return e;let r=(function(n){let{typeChecker:a,angularTypes:s}=n;if(!a||!s)return false;let c=Pe(),f=D(n);if(!c||!f)return false;for(let d of f.statements){if(!c.isClassDeclaration(d)||!c.canHaveDecorators(d))continue;let p=c.getDecorators(d);if(p)for(let i of p){let l=c.isCallExpression(i.expression)?i.expression.expression:i.expression;if(!c.isIdentifier(l)||l.text!=="Component"&&l.text!=="Directive")continue;let o=a.getSymbolAtLocation(l),u=o&&o.flags&c.SymbolFlags.Alias?a.getAliasedSymbol(o):o;if(s.isFromAngularCore(u))return true}}return false})(t);return ee.size>=1024&&ee.clear(),ee.set(t.filePath,r),r}function Q(t){if(!t)return false;let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib.dom"))return true;return false}var se="component-no-manual-detect-changes",nr=new Set(["detectChanges","markForCheck"]),tt=createAnyAngularClassRule(se,(t,e)=>{let r,n=t.node,a=(r=analyzeComponent(n),r?.type!=="Component"?{isComponent:false,isOnPush:false}:{isComponent:true,isOnPush:r.changeDetection?.kind==="literal"&&r.changeDetection.value===ChangeDetectionStrategy.OnPush});if(!a.isComponent)return null;let{typeChecker:s,angularTypes:c}=e;if(!s||!c)return null;let f=(function(i,l){let o=D(l);if(!o)return;let u=b(i);for(let m of o.statements)if(M.isClassDeclaration(m)&&m.pos<=u&&u<=m.end)return m})(n,e);if(!f)return null;let d=[],p=i=>{if(M.isCallExpression(i)){let l=(function(o,u,m,y,h){if(!M.isPropertyAccessExpression(o.expression))return null;let E=o.expression.name.text;if(!nr.has(E)||y.isOnPush&&E==="markForCheck")return null;let S=u.getTypeAtLocation(o.expression.expression);if(!m.isChangeDetectorRef(S))return null;let{line:A,column:v}=h.locator.location(o.getStart());return {filePath:h.filePath,ruleName:se,message:y.isOnPush?"Manual change detection in an OnPush component couples rendering to imperative calls.":`Manual change detection (${E}) can hide state-flow bugs and make rendering harder to predict.`,line:A,column:v,severity:y.isOnPush?"warn":"error",fix:x[se],codeExample:P[se]}})(i,s,c,a,e);l&&d.push(l);}M.forEachChild(i,p);};return p(f),d.length>0?d:null});var Te="signal-no-side-effects-in-computed",or=new Set(["set","update","mutate"]),ar=new Set(["next","complete","error"]),rt=createCallExpressionRule(Te,(t,e)=>{var r,n;let a,s;if(!T(t.callee,"computed"))return null;let{typeChecker:c,angularTypes:f}=e;if(!c||!f)return null;let d=(function(l,o){var u;let m,y=(u=l).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M.createSourceFile(u.filePath,u.fileContent,M.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!y)return;let h=E=>{if(!m){if(M.isCallExpression(E)&&E.getStart()===o){m=E;return}M.forEachChild(E,h);}};return h(y),m})(e,b(t));if(!d)return null;let p=d.arguments[0];if(!p||!(M.isArrowFunction(p)||M.isFunctionExpression(p)))return null;let i=(r=p.body,n={typeChecker:c,angularTypes:f},(s=l=>{var o,u,m,y;if(a)return;let h=(o=l,u=n,M.isBinaryExpression(o)&&(m=o.operatorToken.kind)>=M.SyntaxKind.FirstAssignment&&m<=M.SyntaxKind.LastAssignment?Oe(o.left)?{node:o,kind:"write"}:void 0:M.isPostfixUnaryExpression(o)||M.isPrefixUnaryExpression(o)?(o.operator===M.SyntaxKind.PlusPlusToken||o.operator===M.SyntaxKind.MinusMinusToken)&&Oe(o.operand)?{node:o,kind:"write"}:void 0:M.isDeleteExpression(o)&&Oe(o.expression)?{node:o,kind:"write"}:M.isCallExpression(o)?(function(E,S){if(!M.isPropertyAccessExpression(E.expression))return;let A=E.expression.name.text,v=E.expression.expression,w=S.typeChecker.getTypeAtLocation(v);return or.has(A)&&S.angularTypes.isWritableSignal(w)?{node:E,kind:"write"}:ar.has(A)&&S.angularTypes.isSubjectLike(w)||S.angularTypes.isHttpClient(w)?{node:E,kind:"effect"}:void 0})(o,u):void 0);if(h){a=h;return}y=l,M.isArrowFunction(y)||M.isFunctionExpression(y)||M.isFunctionDeclaration(y)||M.isMethodDeclaration(y)||M.isGetAccessorDeclaration(y)||M.isSetAccessorDeclaration(y)||M.forEachChild(l,s);})(r),a);return i?(function(l,o,u){let m=l.node.getStart(),{line:y,column:h}=u.locator.location(m||b(o));return {filePath:u.filePath,ruleName:Te,message:l.kind==="write"?"computed() writes to state, which can create reactive cycles.":"computed() contains a side effect, so it is no longer a pure derivation.",line:y,column:h,severity:"error",fix:x[Te]}})(i,t,e):null},{requires:{typeChecker:true}});function Oe(t){return M.isPropertyAccessExpression(t)||M.isElementAccessExpression(t)}var ke="signal-effect-must-be-destroy-scoped",nt=createAnyAngularClassRule(ke,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let n=[];for(let a of r)a&&H(a)&&!Me(a)&&n.push(...(function(s,c){let f=z(s);if(!f)return [];let d=Ze(s),p=[];for(let i of Je(f))(function(l){if(l.type!=="CallExpression")return false;let o=g(l.callee);return !!o&&(o.type==="Identifier"?o.name==="effect":!!C(o)&&N(o)==="effect")})(i)&&!(function(l){let o=g((Array.isArray(l.arguments)?l.arguments:[])[1]);if(!o||o.type!=="ObjectExpression")return false;for(let u of Array.isArray(o.properties)?o.properties:[]){let m=g(u);if(m?.type==="Property"){let y=g(m.key),h=y?.type==="Identifier"?y.name:N(y)||"";if(h==="injector")return true;if(h==="manualCleanup"){let E=g(m.value);if(E?.type==="Literal"&&E.value===true)return true}}}return false})(i)&&p.push((function(l,o,u){let m=b(l),{line:y,column:h}=u.locator.location(m);return {filePath:u.filePath,ruleName:ke,message:`effect() inside "${o}" has no explicit lifecycle owner, so cleanup can be unclear.`,line:y,column:h,severity:"error",fix:x[ke]}})(i,d,c));return p})(a,e));return n.length>0?n:null});var le="rxjs-no-nested-subscribe",ur=new Set(["next","error","complete"]),cr=new Set(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"]);function De(t){if(t.type!=="CallExpression")return false;let e=g(t.callee);return !!C(e)&&N(e)==="subscribe"}function it(t){return !!t&&(t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression")}var ot=createCallExpressionRule(le,(t,e)=>{if(!De(t))return null;for(let r of (function(n){if(!De(n))return [];let a=Array.isArray(n.arguments)?n.arguments:[];if(a.length===0)return [];let s=g(a[0]);if(s?.type==="ObjectExpression"){if(s.type!=="ObjectExpression")return [];let f=[];for(let d of Array.isArray(s.properties)?s.properties:[]){let p=g(d);if(p?.type==="Property"&&ur.has((function(i){let l=g(i.key);return l?l.type==="Identifier"?l.name:N(l)||"":""})(p))){let i=g(p.value);it(i)&&f.push(i);}}return f}let c=[];for(let f=0;f<Math.min(a.length,3);f++){let d=g(a[f]);it(d)&&c.push(d);}return c})(t)){let n=g(r.body);if(n&&(function(a){let s=[a];for(;s.length>0;){var c;let f=g(s.pop());if(f){if(f!==a&&De(f))return true;if(!(f!==a&&(c=f).type&&cr.has(c.type)))for(let d of O(f))s.push(d);}}return false})(n))return (function(a,s){let c=b(a),{line:f,column:d}=s.locator.location(c);return {filePath:s.filePath,ruleName:le,message:"Nested subscribe() calls make stream lifetimes harder to reason about and can leak work.",line:f,column:d,severity:"error",fix:x[le],codeExample:P[le]}})(t,e)}return null});var ue="prefer-on-push-component-change-detection";function ce(t,e){let r=t?.[e];return typeof r=="number"?r:void 0}function Ie(t){return t.replace(/\\/g,"/")}var at=createComponentRule(ue,(t,e)=>{let r=t.metadata??{};return r.type!=="Component"||!(function(n){if(!n||typeof n!="object")return false;let{kind:a,value:s}=n;return a!=="non-literal"&&(a==="literal"?s!==ChangeDetectionStrategy.OnPush:a==="missing")})(r.changeDetection)?null:(function(n,a){let s,c,f,d,p=(s=n.metadata??{},c=n.node,ce(s,"decoratorStart")??ce(s,"start")??ce(c,"start")??ce(n,"start")??0),{line:i,column:l}=a.locator.location(p),o=(f=n.metadata,typeof(d=f?.className)=="string"?d:"AnonymousComponent"),u=(function(m,y){if(!y.project)return null;let h=m.metadata,E=h?.className;if(typeof E!="string"||!E)return null;let S=Ie(y.filePath),{ngModuleMap:A,classToFile:v}=y.project;for(let[w,L]of A){if(L.isStandalone||!L.declarations.has(E))continue;let k=v.get(E);if(!k||Ie(k)===S)return {moduleName:(Ie(w).split("/").pop()??w).replace(/\.ts$/,""),siblingDeclarationCount:Math.max(0,L.declarations.size-1)}}return null})(n,a);return {filePath:a.filePath,ruleName:ue,message:(function(m,y){let h=`Component '${m}' uses default change detection, which can re-render more often than needed.`;if(!y)return h;let{moduleName:E,siblingDeclarationCount:S}=y;return S===0?`${h} It is declared in '${E}'.`:`${h} It is declared in '${E}' alongside ${S} other declaration${S===1?"":"s"}.`})(o,u),line:i,column:l,severity:"error",fix:x[ue],codeExample:P[ue]}})(t,e)},{requires:{projectContext:true}});var Le="template-no-call-expression",gr=new Set(["translate","$localize","$any"]),yr=new Set(["slice","toString","toFixed","toUpperCase","toLowerCase","trim","join","includes","indexOf","startsWith","endsWith","charAt","substring","replace","split","concat","toISOString","toLocaleDateString","toLocaleTimeString","toLocaleString"]);function st(t){let e=g(t);return !!e&&(e.type==="CallExpression"||e.type==="OptionalCallExpression")}var lt=createTemplateExpressionRule(Le,(t,e)=>(function(r,n){let a=r?[r]:[];for(;a.length>0;){let s=g(a.pop());if(s){if(st(s)&&!(function(c){let f=g(c);if(!f||!st(f))return false;let d=g(f.callee);if(!d)return false;if(d.type==="Identifier")return gr.has(d.name);if(!C(d))return false;let p=N(d);return !!p&&yr.has(p)})(s)){if((function(f){let d=g(f);return Array.isArray(d?.arguments)?d.arguments:[]})(s).length>0)return true;let c=(function(f){let d=g(f);if(!d)return "";let p=g(d.callee);return p?p.type==="Identifier"?p.name??"":C(p)?N(p):"":""})(s);if(c&&!(function(f,d){if(d.crossRef?.signalMembers?.has(f))return true;let{typeChecker:p,angularTypes:i,crossRef:l}=d;if(!p||!i||!l?.componentPath)return false;let o=(function(u,m,y){let h=y.getProgram?.(),E=h?.getSourceFile(m);if(!E)return;let S=E.statements.find(M.isClassDeclaration);if(!S)return;let A=y.getTypeAtLocation(S),v=y.getPropertyOfType(A,u);if(!v)return;let w=v.valueDeclaration??v.declarations?.[0];if(w)return y.getTypeOfSymbolAtLocation(v,w)})(f,l.componentPath,p);return !!o&&i.isSignal(o)})(c,n))return true}for(let c of O(s))a.push(c);}}return false})(t.expression,e)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Le,message:"Template method calls run on every change detection cycle and can make rendering slower.",line:s,column:c,severity:"error",fix:x[Le]}})(t,e)]:null,{requires:{htmlAst:true,typeChecker:true,projectContext:true}});function ut(t,e,r,n){let a=I(t,e.sourceSpan.start),{line:s,column:c}=t.locator.location(a);return {filePath:t.filePath,ruleName:r,message:n,line:s,column:c,severity:"error",fix:x[r]}}var ct=createTemplateRule("template-trackby-required",(t,e)=>{let r=[];for(let n of t.attributes)n.name==="*ngFor"&&!(function(a){return !!a.match(/\btrackBy\s*:\s*([^;]+?)\s*(?:;|$)/)?.[1]?.trim()})(n.value??"")&&r.push(ut(e,n,"template-trackby-required-for-ngfor","*ngFor without trackBy can recreate DOM nodes unnecessarily when list items change."));for(let n of t.blocks)n.name!=="for"||n.parameters.some(a=>{let s=a.expression?.trim()??"";return !!s&&!!/^track\b/.test(s)&&s.replace(/^track\b/,"").trim().length>0})||r.push(ut(e,n,"template-track-required-for-atfor","@for without a track expression can recreate DOM nodes unnecessarily when list items change."));return r.length>0?r:null},{requires:{htmlAst:true}});var je="template-no-object-literal-binding",pt=createTemplateExpressionRule(je,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ObjectExpression")return true;for(let s of O(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:je,message:"Object literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[je]}})(t,e)]:null,{requires:{htmlAst:true}});var Fe="template-no-array-literal-binding",ft=createTemplateExpressionRule(Fe,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ArrayExpression")return true;for(let s of O(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Fe,message:"Array literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[Fe]}})(t,e)]:null,{requires:{htmlAst:true}});var _e=new Map([["bypassSecurityTrustHtml","HTML"],["bypassSecurityTrustScript","Script"],["bypassSecurityTrustStyle","Style"],["bypassSecurityTrustUrl","URL"],["bypassSecurityTrustResourceUrl","Resource URL"]]),mt=createCallExpressionRule("no-bypass-sanitization",(t,e)=>{let r=(function(s){let c=g(s.callee);if(!c)return null;if(c.type==="Identifier"&&c.name)return _e.has(c.name)?c.name:null;if(C(c)){let f=N(c);return f&&_e.has(f)?f:null}return null})(t);if(!r)return null;let{line:n,column:a}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"no-bypass-sanitization",message:`\`${r}\` bypasses Angular's ${_e.get(r)} sanitization, which can expose unsafe content.`,line:n,column:a,severity:"error",fix:x["no-bypass-sanitization"]}});var Ar=new Map([["[innerHTML]",{desc:"innerHTML directly renders HTML markup and can execute injected scripts",severity:"error"}],["[outerHTML]",{desc:"outerHTML replaces the element with raw HTML and is susceptible to XSS",severity:"error"}],["[srcdoc]",{desc:"srcdoc embeds raw HTML inside an iframe and can execute injected scripts",severity:"error"}],["[style]",{desc:"binding complex expressions to [style] can enable CSS injection",severity:"warn"}]]),Cr=/\|\s*(safeHtml|safeStyle|safeUrl|safeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|trustStyle|trustUrl|trustResourceUrl|bypassSecurity)\b/i,vr=/\b(getSafeHtml|getSafeUrl|getSafeStyle|getSafeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|bypassSecurity)\s*\(/i,dt=createTemplateAttributeRule("template-no-unsafe-bindings",(t,e)=>{let r=Ar.get(t.name);if(!r)return null;let n=t.value??"";if(Cr.test(n)||vr.test(n)||t.name==="[style]"&&!/[.(|?]/.test(n))return null;let{line:a,column:s}=e.locator.location(I(e,t.sourceSpan.start));return {filePath:e.filePath,ruleName:"template-no-unsafe-bindings",message:`\`${t.name}\` binds raw content: ${r.desc}. Unsanitized values can create injection risk.`,line:a,column:s,severity:r.severity,fix:x["template-no-unsafe-bindings"]}},{requires:{htmlAst:true}});var pe="no-document-access",Rr=new Set(["document","window","localStorage","sessionStorage","navigator","location"]),gt=createAnyAngularClassRule(pe,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let{typeChecker:n}=e;if(!n)return null;let a=D(e);if(!a)return null;let s=(function(p){let i=new Set,l=[...p];for(;l.length;){let o=g(l.pop());if(o){if(o.type==="VariableDeclarator"&&o.init){let u=g(o.init);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=o.id??o.key;m?.type==="Identifier"&&m.name&&i.add(m.name);}}if(o.type==="AssignmentExpression"&&o.right){let u=g(o.right);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=g(o.left);if(m&&C(m)&&g(m.object)?.type==="ThisExpression"){let y=m.property?.name;typeof y=="string"&&y&&i.add(y);}}}for(let u of O(o))l.push(u);}}return i})(r),c=[],f=new Set,d=[...r];for(;d.length;){let p=g(d.pop());if(p){if(p.type==="IfStatement"&&p.test){let i=g(p.test);if(i){let l=(function(o,u){let m=[o];for(;m.length;){let y=g(m.pop());if(y){if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformBrowser"))return "browser";if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformServer"))return "server";if(y.type==="UnaryExpression"&&y.operator==="!"&&y.argument){let h=g(y.argument);if(h?.type==="CallExpression"&&h.callee&&T(h.callee,"isPlatformServer"))return "browser"}if(y.type==="Identifier"&&u.has(y.name))return "browser";for(let h of O(y))m.push(h);}}return null})(i,s);if(l==="browser"){p.alternate&&d.push(p.alternate);continue}if(l==="server"){p.consequent&&d.push(p.consequent);continue}}}if(p.type==="CallExpression"&&p.callee){let i=g(p.callee);if(i&&(T(i,"afterNextRender")||T(i,"afterRender"))){let l=p.arguments??[];for(let o=1;o<l.length;o++)d.push(l[o]);continue}}if(C(p)){let i=(function(o){let u=o;for(;u&&C(u);)u=g(u.object);return u?.type==="Identifier"?u:null})(p),l=i?.name;if(i&&l&&Rr.has(l)&&(function(o,u,m){let y=(function(E,S){let A,v=w=>{if(!A){if(M.isIdentifier(w)&&w.getStart()===S){A=w;return}M.forEachChild(w,v);}};return v(E),A})(u,b(o));if(!y)return false;let h=m.getSymbolAtLocation(y);return Q((h&&h.flags&M.SymbolFlags.Alias?m.getAliasedSymbol(h):h)??void 0)})(i,a,n)){let o=b(i);if(o!==void 0&&!f.has(o)){f.add(o);let{line:u,column:m}=e.locator.location(o);c.push({filePath:e.filePath,ruleName:pe,message:`Direct access to \`${l}\` can run during SSR where browser globals do not exist.`,line:u,column:m,severity:"error",fix:x[pe],codeExample:P[pe]});}}}for(let i of O(p))d.push(i);}}return c.length?c:null},{requires:{typeChecker:true}});var fe="prefer-after-render-over-after-view-init",Mr=new Set(["ngAfterViewInit","ngAfterContentInit"]),ht=createAnyAngularClassRule(fe,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r}=e;if(!r)return null;let n=(function(s,c){let f=D(c);if(!f)return;let d=b(s);for(let p of f.statements)if(M.isClassDeclaration(p)&&p.pos<=d&&d<=p.end)return p})(t.node,e);if(!n)return null;let a=[];for(let s of n.members){if(!M.isMethodDeclaration(s)||!s.body||!M.isIdentifier(s.name))continue;let c=s.name.text;if(!Mr.has(c)||!(function(p,i){let l=false,o=u=>{if(!l){if(M.isPropertyAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M.isElementAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M.isIdentifier(u)&&!(function(m){let y=m.parent;return !!y&&!!(M.isPropertyAccessExpression(y)&&y.name===m||M.isQualifiedName(y)&&y.right===m)})(u)){let m=i.getSymbolAtLocation(u);if(Q((m&&m.flags&M.SymbolFlags.Alias?i.getAliasedSymbol(m):m)??void 0)){l=true;return}}M.forEachChild(u,o);}};return o(p),l})(s.body,r))continue;let{line:f,column:d}=e.locator.location(s.getStart());a.push({filePath:e.filePath,ruleName:fe,message:`\`${c}\` contains DOM access that can run before browser-only APIs are safe.`,line:f,column:d,severity:"warn",fix:x[fe],codeExample:P[fe]});}return a.length?a:null},{requires:{typeChecker:true}});function yt(t){let e=t.aliasSymbol??t.symbol;return !!e&&Q(e)}var me=new Map;function Be(t){let e=D(t);if(!e)return false;for(let r of e.statements)if(M.isClassDeclaration(r))for(let n of r.members){if(!M.isMethodDeclaration(n)||!n.name||!M.isIdentifier(n.name)||n.name.text!=="ngOnDestroy"||!n.body)continue;let a=false,s=c=>{if(!a){if(M.isCallExpression(c)&&M.isPropertyAccessExpression(c.expression)&&c.expression.name.text==="unsubscribe"&&c.arguments.length===0){a=true;return}M.forEachChild(c,s);}};if(s(n.body),a)return true}return false}var xt=createCallExpressionRule("rxjs-require-takeUntilDestroyed",(t,e)=>{if(!oe(e)||!te(t))return null;let r=g(t.callee),n=C(r)?r?.object:null;if(n&&re(n)||ie(ne(n))||(function(f){let d=me.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return me.size>=500&&me.clear(),me.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:"rxjs-require-takeUntilDestroyed",message:"A component subscription without teardown can keep running after the component is destroyed.",line:s,column:c,severity:"error",fix:x["rxjs-require-takeUntilDestroyed"]}},{requires:{typeChecker:true}});var de=new Map,ge="rxjs-no-subscribe-in-component",Et=createCallExpressionRule(ge,(t,e)=>{if(!oe(e)||!te(t)||(function(f){let d=g(f.callee);if(!d||!C(d))return false;let p=g(d.object);if(!p)return false;if(p.type==="CallExpression"){let i=g(p.callee);if(C(i)&&N(i)==="pipe"&&(Array.isArray(p.arguments)?p.arguments:[]).some(l=>{let o=g(l);if(o?.type!=="CallExpression")return false;let u=g(o.callee)?.name;return u==="take"||u==="first"}))return true}return ie(ne(p))})(t))return null;let r=g(t.callee),n=g(r?.object);if(n&&re(n)||(function(f){let d=de.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return de.size>=500&&de.clear(),de.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:ge,message:(function(f,d){let p="Open-ended subscriptions in components can outlive the component and make state harder to track.",i=d.crossRef?.templateReferences;if(!i)return p;let l=g(f.callee),o=g(l?.object),u=o?N(o):null;if(!u)return p;let m=u.endsWith("$")?u.slice(0,-1):u;return i.has(u)||i.has(m)?`'${u}' is read by the template, so subscribing manually adds state and teardown work the template can own.`:p})(t,e),line:s,column:c,severity:"error",fix:x[ge],codeExample:P[ge]}},{requires:{typeChecker:true,projectContext:true}});var ye="rxjs-avoid-subject-as-event-bus",bt=createAnyAngularClassRule(ye,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=F(t.node);if(a.length===0)return null;let s=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=g(u.callee);if(m&&(m.type==="Identifier"?m.name:C(m)?N(m):"")==="takeUntil")for(let y of Array.isArray(u.arguments)?u.arguments:[]){let h=St(y);h&&l.add(h);}});return l})(a),c=(function(i){let l=new Set,o=m=>{he(m??null,y=>{let h=Ue(y,"next");h&&l.add(h);});},u=Qe(i);for(let m of(u&&o(z(u)),i))if(H(m)){let y=m.key?.name;m.kind==="set"&&(function(h){let E=h.decorators;if(!Array.isArray(E))return false;for(let S of E){let A=g(S.expression);if(A?.name==="Input"||g(A?.callee)?.name==="Input")return true}return false})(m)&&o(m),y==="ngOnChanges"&&o(z(m));}else m.type==="PropertyDefinition"&&m.value&&o(m.value);return l})(a),f=(function(i){let l=new Set;for(let o of i)H(o)&&o.key?.name==="ngOnDestroy"&&he(z(o),u=>{let m=Ue(u,"complete");m&&l.add(m);});return l})(a),d=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=Ue(u,"pipe");m&&l.add(m);});return l})(a),p=[];for(let i of a){if(i.type!=="PropertyDefinition"||i.accessibility==="public")continue;let l=i.key?.name??"";if(!l||s.has(l)||c.has(l)||f.has(l)||d.has(l))continue;let o=et(i.key,e);if(!o)continue;let u=o.valueDeclaration??o.declarations?.[0];if(!u)continue;let m=r.getTypeOfSymbolAtLocation(o,u);if(!n.isSubjectLike(m))continue;let{line:y,column:h}=e.locator.location(b(i));p.push({filePath:e.filePath,ruleName:ye,message:`'${l}' is a Subject the class signals into without piping or external exposure \u2014 components are easier to follow when local state lives in fields or signals.`,line:y,column:h,severity:"warn",fix:x[ye],codeExample:P[ye]});}return p.length>0?p:null});function he(t,e){if(!t)return;let r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&e(n),O(n)))r.push(a);}}function St(t){let e=g(t);if(!e||!C(e))return null;let r=g(e.object),n=N(e);return n&&r?.type==="ThisExpression"?n:null}function Ue(t,e){let r=g(t.callee);return r&&C(r)&&N(r)===e?St(r.object):null}var qe="rxjs-prefer-toSignal-for-template-state",At=createAnyAngularClassRule(qe,(t,e)=>{if(t.metadata?.type!=="Component")return null;let n=e.crossRef?.templateReferences;if(n===void 0)return null;let{typeChecker:a,angularTypes:s}=e;if(!a||!s)return null;let c=(function(p,i){let l=D(i);if(!l)return;let o=b(p);for(let u of l.statements)if(M.isClassDeclaration(u)&&u.pos<=o&&o<=u.end)return u})(t.node,e);if(!c)return null;let f=[];for(let p of c.members){var d;if(!M.isPropertyDeclaration(p))continue;let i=(function(m){if(M.isIdentifier(m.name)||M.isStringLiteral(m.name))return m.name.text})(p);if(!i||!n.has(i)&&!n.has((d=i).endsWith("$")?d.slice(0,-1):d)||(function(m,y,h){let E=M.getDecorators(m);if(!E)return false;for(let S of E){let A=M.isCallExpression(S.expression)?S.expression.expression:S.expression;if(!M.isIdentifier(A)||A.text!=="Output")continue;let v=y.getSymbolAtLocation(A),w=v&&v.flags&M.SymbolFlags.Alias?y.getAliasedSymbol(v):v;if(h.isFromAngularCore(w))return true}return false})(p,a,s))continue;let l=a.getTypeAtLocation(p);if(!s.isObservable(l)&&!s.isSubjectLike(l))continue;let{line:o,column:u}=e.locator.location(p.getStart());f.push({filePath:e.filePath,ruleName:qe,message:`Observable "${i}" is read by the template, which can add async-pipe churn and weaker signal integration.`,line:o,column:u,severity:"warn",fix:x[qe]});}return f.length?f:null},{requires:{projectContext:true,htmlAst:true,typeChecker:true}});var He="toSignal-require-initialValue",Ct=createCallExpressionRule(He,(t,e)=>{if(!T(t.callee,"toSignal"))return null;let r=Array.isArray(t.arguments)?t.arguments:[],n=r[1]?g(r[1]):null;if(!n||n.type!=="ObjectExpression"||!(function(a){let s=Y(a,"initialValue");if(s&&!we(s.value))return true;let c=Y(a,"requireSync");return !!c&&Re(c.value)})(n)){let{line:a,column:s}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:He,message:"toSignal() can emit undefined before the observable produces a value.",line:a,column:s,severity:"warn",fix:x[He]}}return null});var ze="signal-prefer-computed-over-sync-effect",Lr=new Set(["setTimeout","setInterval","queueMicrotask","requestAnimationFrame"]),jr=new Set(["then","catch","finally"]),Fr=new Set(["set","update","mutate"]),Nt=createCallExpressionRule(ze,(t,e)=>{var r,n;let a,s,c,f,d,p;if(!T(t.callee,"effect"))return null;let{typeChecker:i,angularTypes:l}=e;if(!i||!l)return null;let o=(function(S,A){let v,w=D(S);if(!w)return;let L=k=>{if(!v){if(M.isCallExpression(k)&&k.getStart()===A){v=k;return}M.forEachChild(k,L);}};return L(w),v})(e,b(t));if(!o)return null;let u=o.arguments[0];if(!u||!(M.isArrowFunction(u)||M.isFunctionExpression(u)))return null;let m=(r=u.body,n={typeChecker:i,angularTypes:l},s=false,c=false,f=false,d=false,(p=S=>{f&&d&&s&&c||((S.kind===M.SyntaxKind.AwaitExpression||S.kind===M.SyntaxKind.YieldExpression)&&(f=true),M.isCallExpression(S)&&(function(A,v,w){var L,k;if(M.isPropertyAccessExpression(A.expression)){let U,j=A.expression.name.text,K=A.expression.expression,q=v.typeChecker.getTypeAtLocation(K);return Fr.has(j)&&v.angularTypes.isWritableSignal(q)?w.onSignalWrite():(j==="subscribe"&&(v.angularTypes.isObservable(q)||v.angularTypes.isSubjectLike(q))||jr.has(j)&&(U=(L=q).aliasSymbol??L.symbol)&&U.name==="Promise"&&vt(U))&&w.onAsync()}if(M.isIdentifier(A.expression)){let U,j=A.expression.text;if(j==="linkedSignal")return w.onLinkedSignal();if(Lr.has(j)&&(k=A.expression,(U=v.typeChecker.getSymbolAtLocation(k))&&vt(U)))return w.onAsync();A.arguments.length===0&&(function(K,q){let Z=q.typeChecker.getSymbolAtLocation(K);if(!Z)return false;let Ve=Z.valueDeclaration??Z.declarations?.[0];if(!Ve)return false;let qt=q.typeChecker.getTypeOfSymbolAtLocation(Z,Ve);return q.angularTypes.isSignal(qt)})(A.expression,v)&&w.onSignalRead();}})(S,n,{onSignalRead:()=>{s=true;},onSignalWrite:()=>{c=true,a??=S;},onAsync:()=>{f=true;},onLinkedSignal:()=>{d=true;}}),M.forEachChild(S,p));})(r),{hasSignalRead:s,hasSignalWrite:c,hasAsync:f,hasLinkedSignal:d,firstWrite:a});if(!m.hasSignalRead||!m.hasSignalWrite||m.hasAsync||m.hasLinkedSignal)return null;let y=m.firstWrite??o,{line:h,column:E}=e.locator.location(y.getStart());return {filePath:e.filePath,ruleName:ze,message:"This effect reads reactive values and writes derived state, which adds extra reactive cycles.",line:h,column:E,severity:"warn",fix:x[ze]}},{requires:{typeChecker:true}});function vt(t){let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib."))return true;return false}var Rt=new Set(["afterRender","afterNextRender"]),$r=/\bafterNextRender\s*\(|\bafterRender\s*\(/,xe=new Map,wt=createCallExpressionRule("signal-avoid-untracked-overuse",(t,e)=>{if(!T(t.callee,"untracked")||(function(a,s){let c=s.sourceText??s.fileContent;if(typeof c=="string"&&!$r.test(c))return false;let f=a.parent;for(;f;){if(f.type==="CallExpression"&&Rt.has(Ne(f)))return true;f=f.parent;}let d=b(a);return (function(p){let i=xe.get(p.filePath);if(i!==void 0)return i;let l=p.program;return i=l?(function(o){let u=[],m=o.body,y=Array.isArray(m)?[...m]:[o];for(;y.length;){let h=g(y.pop());if(h){if(h.type==="CallExpression"&&Rt.has(Ne(h))){let E=g(h.arguments?.[0]);if(E){let S=b(E),A=E.end??E.span?.end??b(E);A>S&&u.push([S,A]);}}for(let E of O(h))y.push(E);}}return u})(l):[],xe.size>=300&&xe.clear(),xe.set(p.filePath,i),i})(s).some(([p,i])=>d>=p&&d<i)})(t,e))return null;let{line:r,column:n}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"signal-avoid-untracked-overuse",message:"untracked() hides this read from dependency tracking, which can mask stale reactive state.",line:r,column:n,severity:"warn",fix:x["signal-avoid-untracked-overuse"]}});var Ee="prefer-inject-over-constructor-di",Ur=new Set(["Inject","Optional","Self","SkipSelf","Host"]),Mt=createAnyAngularClassRule(Ee,(t,e)=>{let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(l,o){var u;let m=(u=o).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M.createSourceFile(u.filePath,u.fileContent,M.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!m)return;let y=b(l);for(let h of m.statements)if(M.isClassDeclaration(h)&&h.pos<=y&&y<=h.end)return h})(t.node,e);if(!a)return null;let s=a.members.find(M.isConstructorDeclaration);if(!s||s.parameters.length===0)return null;let c=[];for(let l of s.parameters){var f;(function(o,u,m){if((function(E,S,A){let v=M.getDecorators(E);if(!v||v.length===0)return false;for(let w of v){let L=(function(j){let K=M.isCallExpression(j.expression)?j.expression.expression:j.expression;return M.isIdentifier(K)?K:void 0})(w);if(!L||!Ur.has(L.text))continue;let k=S.getSymbolAtLocation(L),U=k&&k.flags&M.SymbolFlags.Alias?S.getAliasedSymbol(k):k;if(A.isFromAngularCore(U))return true}return false})(o,u,m))return true;if(!o.type)return false;let y=u.getTypeFromTypeNode(o.type);if(m.isInjectionToken(y))return true;let h=y.aliasSymbol??y.symbol;return !!h&&m.isInjectableClass(h)})(l,r,n)&&c.push((f=l,{name:M.isIdentifier(f.name)?f.name.text:"<binding>",typeText:f.type?f.type.getText():"<inferred>"}));}if(c.length===0)return null;let{line:d,column:p}=e.locator.location(b(s)),i=c.map(l=>`${l.name}: ${l.typeText}`).join(", ");return {filePath:e.filePath,ruleName:Ee,message:`Constructor dependency injection makes class setup less composable than inject(). Offending params: ${i}.`,line:d,column:p,severity:"warn",fix:x[Ee],codeExample:P[Ee]}},{requires:{typeChecker:true}});var be="signal-prefer-input-signal";function Hr(t){let e=g(t.expression??t);if(!e)return false;if(e.type==="Identifier")return e.name==="Input";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"&&r.name==="Input"}return false}var Pt=createAnyAngularClassRule(be,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=[],a=e.project?.standaloneComponents?.has(e.filePath)??false;for(let s of r){let c=g(s);if(c&&(c.type==="PropertyDefinition"||c.type==="AccessorProperty")&&Array.isArray(c.decorators)&&c.decorators.some(Hr)){let f=b(c),{line:d,column:p}=e.locator.location(f),i=g(c.key),l=(i?.type==="Identifier"?i.name:i?.type==="Literal"?String(i.value):"")||"(unknown)",o=`'${l}' uses @Input(), which keeps this input outside Angular's signal graph.`;a&&(o+=" Standalone declarations benefit most from signal inputs."),n.push({filePath:e.filePath,ruleName:be,message:o,line:d,column:p,severity:a?"error":"warn",fix:x[be],codeExample:P[be]});}}return n.length>0?n:null},{requires:{projectContext:true}});var Se="signal-prefer-output-function",Tt=createAnyAngularClassRule(Se,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(c,f){let d=D(f);if(!d)return;let p=b(c);for(let i of d.statements)if(M.isClassDeclaration(i)&&i.pos<=p&&p<=i.end)return i})(t.node,e);if(!a)return null;let s=[];for(let c of a.members){if(!M.isPropertyDeclaration(c)||!(function(i,l,o){let u=M.getDecorators(i);if(!u)return false;for(let m of u){let y=M.isCallExpression(m.expression)?m.expression.expression:m.expression;if(!M.isIdentifier(y)||y.text!=="Output")continue;let h=l.getSymbolAtLocation(y),E=h&&h.flags&M.SymbolFlags.Alias?l.getAliasedSymbol(h):h;if(o.isFromAngularCore(E))return true}return false})(c,r,n)||!(function(i,l,o){if(i.type){let m=l.getTypeFromTypeNode(i.type);if(o.isEventEmitter(m))return true}if(i.initializer){let m=l.getTypeAtLocation(i.initializer);if(o.isEventEmitter(m))return true}let u=l.getSymbolAtLocation(i.name);if(u){let m=l.getTypeOfSymbolAtLocation(u,i);if(o.isEventEmitter(m))return true}return false})(c,r,n))continue;let f=(function(i){let l=i.name;if(M.isIdentifier(l)||M.isStringLiteral(l))return l.text})(c)??"(unknown)",{line:d,column:p}=e.locator.location(c.getStart());s.push({filePath:e.filePath,ruleName:Se,message:`'${f}' uses @Output() EventEmitter, which adds boilerplate compared with output().`,line:d,column:p,severity:"warn",fix:x[Se],codeExample:P[Se]});}return s.length>0?s:null},{requires:{typeChecker:true}});var Ae="signal-prefer-model";function Ot(t,e){return Array.isArray(t.decorators)&&t.decorators.some(r=>{let n=g(r.expression??r);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(n.type==="CallExpression"){let a=g(n.callee);return a?.type==="Identifier"&&a.name===e}return false})}function kt(t,e){let r=g(t.value);if(!r||r.type!=="CallExpression")return false;let n=g(r.callee);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(C(n)){let a=g(n.object);return a?.type==="Identifier"&&a.name===e}return false}var Dt=createAnyAngularClassRule(Ae,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=new Map,a=new Map;for(let c of r){let f=g(c);if(!f||f.type!=="PropertyDefinition"&&f.type!=="AccessorProperty")continue;let d=(function(p){let i=g(p.key);return i?i.type==="Identifier"?i.name??null:i.type==="Literal"?String(i.value):null:null})(f);d&&((Ot(f,"Input")||kt(f,"input"))&&n.set(d,f),(Ot(f,"Output")||kt(f,"output"))&&a.set(d,f));}let s=[];for(let[c,f]of a){if(!c.endsWith("Change"))continue;let d=c.slice(0,-6),p=n.get(d);if(p){let i=b(p),{line:l,column:o}=e.locator.location(i);s.push({filePath:e.filePath,ruleName:Ae,message:`The \`${d}\` / \`${c}\` pair implements two-way binding with extra wiring that model() avoids.`,line:l,column:o,severity:"warn",fix:x[Ae],codeExample:P[Ae]});}}return s.length>0?s:null});var Kr=new Map([["*ngIf","@if"],["*ngFor","@for"],["*ngSwitch","@switch"],["[ngSwitch]","@switch"],["*ngSwitchCase","@case"],["*ngSwitchDefault","@default"]]),We="template-prefer-control-flow",It=createTemplateAttributeRule(We,(t,e)=>{var r;let n=(r=t.name,Kr.get(r)??null);if(!n)return null;let a=I(e,t.sourceSpan.start),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:We,message:`\`${t.name}\` uses legacy structural directive syntax, so it misses the \`${n}\` control flow benefits.`,line:s,column:c,severity:"error",fix:x[We]}},{requires:{htmlAst:true}});var Lt=new WeakMap,jt=createTemplateExpressionRule("template-no-async-pipe-duplication",(t,e)=>{let r,n,a=(function p(i){let l=g(i);if(!l)return null;if(l.type==="BinaryExpression"&&l.operator==="|"){let o=g(l.right);return o?.type==="Identifier"&&o.name==="async"?g(l.left):p(l.left)}return null})(t.expression),s=a?(function p(i,l=0){if(!i||l>10)return null;if(i.type==="Identifier")return i.name;if(i.type==="ThisExpression")return "this";if(i.type==="Literal"){let o=i.value;return o===null?"null":typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="bigint"?String(o):null}if(i.type==="CallExpression"){let o=p(i.callee,l+1),u=(Array.isArray(i.arguments)?i.arguments:[]).map(m=>p(m,l+1)??"?");return `${o}(${u.join(",")})`}if(C(i)){let o=p(i.object,l+1),u=N(i);if(o&&u)return `${o}.${u}`}if(i.type==="UnaryExpression")return `${i.operator}${p(i.argument,l+1)}`;if(i.type==="ConditionalExpression")return `${p(i.test,l+1)}?${p(i.consequent,l+1)}:${p(i.alternate,l+1)}`;if(i.type==="OptionalExpression"||i.type==="ChainExpression")return p(i.expression,l+1);if(i.type==="LogicalExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="BinaryExpression"&&i.operator!=="|"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="ArrayExpression")return `[${(i.elements??[]).map(u=>p(u,l+1)??"?").join(",")}]`;if(i.type==="ObjectExpression")return `{${(i.properties??[]).map(u=>{let m=u.key?p(u.key,l+1):"?",y=u.value?p(u.value,l+1):"?";return `${m}:${y}`}).join(",")}}`;if(i.type==="TemplateLiteral")return "`tmpl`";if(i.type==="AssignmentExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}return null})(a):null;if(!s)return null;let c=(r=e.template,n=r?.templateStartOffset,`${e.filePath}@${typeof n=="number"&&Number.isFinite(n)?n:0}`),f=Lt.get(e);f||(f=new Map,Lt.set(e,f));let d=f.get(c);if(d||(d=new Set,f.set(c,d)),d.has(s)){let p=I(e,t.sourceSpan.start),{line:i,column:l}=e.locator.location(p);return {filePath:e.filePath,ruleName:"template-no-async-pipe-duplication",message:`Duplicate async pipe subscriptions for "${s}" can create repeated work and inconsistent loading states.`,line:i,column:l,severity:"warn",fix:x["template-no-async-pipe-duplication"]}}return d.add(s),null},{requires:{htmlAst:true}});var Yr=new Set(["fdescribe","fit","describe.only","it.only","test.only","context.only","xdescribe","xit","xtest","xcontext"]),Qr=new Set(["xdescribe","xit","xtest","xcontext"]);function Ft(t){return t.type==="Identifier"?t.name??null:null}var _t=createCallExpressionRule("spec-no-focused-test",(t,e)=>{var r;let n;if(!((r=e.filePath).endsWith(".spec.ts")||r.endsWith(".test.ts")))return null;let a=g(t.callee);if(!a)return null;let s=(n=Ft(a)||(function(i){if(i.type==="MemberExpression"||i.type==="StaticMemberExpression"||i.type==="OptionalMemberExpression"){let l=g(i.object),o=i.property?.name??"",u=(l?.type==="Identifier"?l.name:"")??"";return u?`${u}.${o}`:null}return null})(a))&&Yr.has(n)?n:null;if(!s){if(Ft(a)==="pending"){let i=b(t),{line:l,column:o}=e.locator.location(i);return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:"`pending()` disables the test body, so the committed suite can miss coverage.",line:l,column:o,severity:"error",fix:x["spec-no-focused-test"]}}return null}let c=b(t),{line:f,column:d}=e.locator.location(c),p=Qr.has(s)?`\`${s}\` disables a test that may be forgotten.`:`\`${s}\` is a focused test helper that can skip the rest of the suite in CI.`;return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:p,line:f,column:d,severity:"error",fix:x["spec-no-focused-test"]}},{dependencyType:"spec",requires:{tsAst:true}});function $t(){R(tt,"correctness"),R(rt,"correctness"),R(nt,"correctness"),R(ot,"correctness"),R(at,"performance"),R(lt,"performance"),R(ct,"performance"),R(pt,"performance"),R(ft,"performance"),R(mt,"security"),R(dt,"security"),R(gt,"ssr"),R(ht,"ssr"),R(Et,"reactivity"),R(xt,"reactivity"),R(bt,"reactivity"),R(At,"reactivity"),R(Ct,"reactivity"),R(Nt,"reactivity"),R(wt,"reactivity"),R(Mt,"modern-api"),R(Pt,"modern-api"),R(Tt,"modern-api"),R(Dt,"modern-api"),R(It,"template"),R(jt,"template"),R(_t,"testing");}var Bt=(t,e,r,n,a)=>{let s=0,c=0;for(let f of r)for(let d of f.failures)d.severity==="error"?s++:d.severity==="warn"&&c++;return {kind:"file-progress",filePath:t,taskCount:e,issueCount:s+c,errorCount:s,warningCount:c,duration:n,typeAware:a}};$t(),configureRuleExecutor(Xe,Ke),process.on("message",t=>{rn(t);});var rn=async t=>{let e=[],r=createTypeAwareAnalysisContext(t.rootDir,t.files,t.parserOptions,{buildProjectContext:t.buildProjectContext,programRootFiles:t.programRootFiles});try{await r.warmup();let n=groupTasksByFile(t.tasks),a=await nn(Array.from(n),Math.max(1,t.fileConcurrency??1),async([s,c])=>{let f=performance.now();try{let d=await executeBatchedTasks(c,r);return Ut(s,c.length,d,performance.now()-f),d}catch{return Ut(s,c.length,[],performance.now()-f),[]}finally{r.evict(s);}});e.push(...a.flat()),process.send?.({kind:"complete",results:e});}catch(n){process.send?.({kind:"error",error:n instanceof Error?n.message:String(n)});}finally{r.dispose(),process.disconnect?.();}};async function nn(t,e,r){let n=Array(t.length),a=0,s=Math.min(e,t.length);return await Promise.all(Array.from({length:s},async()=>{for(;a<t.length;){let c=a++;n[c]=await r(t[c]);}})),n}var Ut=(t,e,r,n)=>{process.send?.(Bt(t,e,r,n,true));};//# sourceMappingURL=type-aware-worker.js.map | ||
| });`};var Ge;function g(t){let e=t;for(;e;){let r=e.type;if(r==="ChainExpression"||r==="TSNonNullExpression"||r==="TSAsExpression"||r==="ParenthesizedExpression"||r==="TSInstantiationExpression"||r==="TSSatisfiesExpression"){e=e.expression;continue}break}return e??null}function C(t){let e=t?.type;return e==="MemberExpression"||e==="StaticMemberExpression"||e==="OptionalMemberExpression"}function N(t){if(!t)return "";let e=t.property;return e?t.computed?e.type==="Literal"&&typeof e.value=="string"?e.value:"":e.name??"":""}function b(t){return t?t.start??t.span?.start??0:0}function T(t,e){let r=g(t);return !!r&&(r.type==="Identifier"?(r.name??"")===e:!!C(r)&&N(r)===e)}function Ne(t){let e=g(t);if(!e||e.type!=="CallExpression")return "";let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}function te(t){let e=g(t?.callee);return !!C(e)&&N(e)==="subscribe"}function Y(t,e){if(!t||t.type!=="ObjectExpression")return null;let r=t.properties;if(!Array.isArray(r))return null;for(let n of r){if(!n||n.type!=="Property")continue;let a=n.key;if((a?.type==="Identifier"?a.name:a?.type==="Literal"&&typeof a.value=="string"?a.value:"")===e)return n}return null}function Re(t){let e=g(t);return !!(e&&e.type==="Literal"&&e.value===true)}function we(t){let e=g(t);return !e||e.type==="Literal"&&e.value===null||e.type==="Identifier"&&e.name==="undefined"}var Kt=new Set(["parent","span","loc","range","start","end","type"]);function*k(t){if(t&&typeof t=="object"){if(Array.isArray(t)){for(let e of t)e&&typeof e=="object"&&(yield e);return}for(let e in t){if(Kt.has(e))continue;let r=t[e];if(r)if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&(yield n);else typeof r=="object"&&r.type&&(yield r);}}}function Me(t){if(!t)return false;if(t.kind==="constructor")return true;let e=t.key;return e?.type==="Identifier"&&e.name==="constructor"||e?.type==="Literal"&&e.value==="constructor"}function H(t){if(!t)return false;let e=t.type;return e==="MethodDefinition"||e==="TSAbstractMethodDefinition"||e==="ClassMethod"||e==="MethodDeclaration"}function Qe(t){for(let e of t)if(e&&H(e)&&Me(e))return e;return null}function z(t){return t?(t.value??t)?.body??null:null}function Ze(t){let e=t?.key;return e?e.type==="Identifier"?e.name??"<method>":e.type==="Literal"&&typeof e.value=="string"?e.value:"<method>":"<method>"}function F(t){if(!t)return [];let e=t.body;if(Array.isArray(e))return e;if(e&&typeof e=="object"&&"body"in e){let r=e.body;if(Array.isArray(r))return r}return []}function Xt(t){let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=e.arguments;if(!Array.isArray(r)||r.length<2)return false;let n=g(r[1]);if(!n||n.type!=="ObjectExpression")return false;let a=Y(n,"injector");if(a&&!we(a.value))return true;let s=Y(n,"manualCleanup");return !!(s&&Re(s.value))}function Je(t){if(!t)return [];let e=[],r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&T(n.callee,"effect")&&!Xt(n)&&e.push(n),k(n)))r.push(a);}return e}var Gt=new Set(["takeUntilDestroyed","takeUntil","take","first","takeWhile"]);function Yt(t){let e=g(t);if(!e)return "";if(e.type==="Identifier")return e.name??"";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"?r.name??"":C(r)?N(r):""}return C(e)?N(e):""}function Qt(t){let e=t.arguments;if(!Array.isArray(e))return false;for(let r of e)if(Gt.has(Yt(r)))return true;return false}function re(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)==="pipe"&&Qt(r))return true;e=n?.object;}return false}function I(t,e){return e}var Zt=new Set(["get","post","put","patch","delete","head","options","jsonp","request"]),Jt=new Set(["http","httpClient","_http","_httpClient"]),er=["get","fetch","load","save","create","update","delete","remove","submit","send","post","put","patch","upload","download"];function ne(t){let e=t;for(;e;){let r=g(e);if(!r||r.type!=="CallExpression")break;let n=g(r.callee);if(!C(n))break;if(N(n)!=="pipe")return r;e=n?.object;}return null}function ie(t){if(!t)return false;let e=g(t);if(!e||e.type!=="CallExpression")return false;let r=g(e.callee);if(!C(r))return false;let n=N(r);if(!n)return false;let a=g(r?.object),s=Array.isArray(e.arguments)?e.arguments:[];if(Zt.has(n)&&C(a)){let c=N(a);if(Jt.has(c))return true}if(s.length>0){let c=n.toLowerCase();for(let f of er)if(c.startsWith(f)&&n.length>f.length)return true}return false}var Ye=false;function Pe(){if(!Ye){try{Ge=zt("typescript");}catch{}Ye=true;}return Ge}function et(t,e){if(!t||!e.typeChecker)return;let r=Pe();if(r)try{!e.sourceFile&&e.fileContent&&(e.sourceFile=r.createSourceFile(e.filePath,e.fileContent,r.ScriptTarget.Latest,!0));let n=e.sourceFile;if(!n)return;let a=(function(s,c,f){if(c<s.getStart()||c>=s.getEnd())return;let d=s;for(;;){let p=f.forEachChild(d,i=>{if(c>=i.getStart()&&c<i.getEnd())return i});if(!p)break;d=p;}return d})(n,b(t),r);return a?e.typeChecker.getSymbolAtLocation(a):void 0}catch{return}}function D(t){if(t.sourceFile)return t.sourceFile;if(!t.fileContent)return;let e=Pe();if(e)return t.sourceFile=e.createSourceFile(t.filePath,t.fileContent,e.ScriptTarget.Latest,true),t.sourceFile}var ee=new Map;function oe(t){let e=ee.get(t.filePath);if(e!==void 0)return e;let r=(function(n){let{typeChecker:a,angularTypes:s}=n;if(!a||!s)return false;let c=Pe(),f=D(n);if(!c||!f)return false;for(let d of f.statements){if(!c.isClassDeclaration(d)||!c.canHaveDecorators(d))continue;let p=c.getDecorators(d);if(p)for(let i of p){let l=c.isCallExpression(i.expression)?i.expression.expression:i.expression;if(!c.isIdentifier(l)||l.text!=="Component"&&l.text!=="Directive")continue;let o=a.getSymbolAtLocation(l),u=o&&o.flags&c.SymbolFlags.Alias?a.getAliasedSymbol(o):o;if(s.isFromAngularCore(u))return true}}return false})(t);return ee.size>=1024&&ee.clear(),ee.set(t.filePath,r),r}function Q(t){if(!t)return false;let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib.dom"))return true;return false}var se="component-no-manual-detect-changes",ir=new Set(["detectChanges","markForCheck"]),tt=createAnyAngularClassRule(se,(t,e)=>{let r,n=t.node,a=(r=analyzeComponent(n),r?.type!=="Component"?{isComponent:false,isOnPush:false}:{isComponent:true,isOnPush:r.changeDetection?.kind==="literal"&&r.changeDetection.value===ChangeDetectionStrategy.OnPush});if(!a.isComponent)return null;let{typeChecker:s,angularTypes:c}=e;if(!s||!c)return null;let f=(function(i,l){let o=D(l);if(!o)return;let u=b(i);for(let m of o.statements)if(M.isClassDeclaration(m)&&m.pos<=u&&u<=m.end)return m})(n,e);if(!f)return null;let d=[],p=i=>{if(M.isCallExpression(i)){let l=(function(o,u,m,y,h){if(!M.isPropertyAccessExpression(o.expression))return null;let E=o.expression.name.text;if(!ir.has(E)||y.isOnPush&&E==="markForCheck")return null;let S=u.getTypeAtLocation(o.expression.expression);if(!m.isChangeDetectorRef(S))return null;let{line:A,column:v}=h.locator.location(o.getStart());return {filePath:h.filePath,ruleName:se,message:y.isOnPush?"Manual change detection in an OnPush component couples rendering to imperative calls.":`Manual change detection (${E}) can hide state-flow bugs and make rendering harder to predict.`,line:A,column:v,severity:y.isOnPush?"warn":"error",fix:x[se],codeExample:P[se]}})(i,s,c,a,e);l&&d.push(l);}M.forEachChild(i,p);};return p(f),d.length>0?d:null});var Te="signal-no-side-effects-in-computed",ar=new Set(["set","update","mutate"]),sr=new Set(["next","complete","error"]),rt=createCallExpressionRule(Te,(t,e)=>{var r,n;let a,s;if(!T(t.callee,"computed"))return null;let{typeChecker:c,angularTypes:f}=e;if(!c||!f)return null;let d=(function(l,o){var u;let m,y=(u=l).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M.createSourceFile(u.filePath,u.fileContent,M.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!y)return;let h=E=>{if(!m){if(M.isCallExpression(E)&&E.getStart()===o){m=E;return}M.forEachChild(E,h);}};return h(y),m})(e,b(t));if(!d)return null;let p=d.arguments[0];if(!p||!(M.isArrowFunction(p)||M.isFunctionExpression(p)))return null;let i=(r=p.body,n={typeChecker:c,angularTypes:f},(s=l=>{var o,u,m,y;if(a)return;let h=(o=l,u=n,M.isBinaryExpression(o)&&(m=o.operatorToken.kind)>=M.SyntaxKind.FirstAssignment&&m<=M.SyntaxKind.LastAssignment?ke(o.left)?{node:o,kind:"write"}:void 0:M.isPostfixUnaryExpression(o)||M.isPrefixUnaryExpression(o)?(o.operator===M.SyntaxKind.PlusPlusToken||o.operator===M.SyntaxKind.MinusMinusToken)&&ke(o.operand)?{node:o,kind:"write"}:void 0:M.isDeleteExpression(o)&&ke(o.expression)?{node:o,kind:"write"}:M.isCallExpression(o)?(function(E,S){if(!M.isPropertyAccessExpression(E.expression))return;let A=E.expression.name.text,v=E.expression.expression,w=S.typeChecker.getTypeAtLocation(v);return ar.has(A)&&S.angularTypes.isWritableSignal(w)?{node:E,kind:"write"}:sr.has(A)&&S.angularTypes.isSubjectLike(w)||S.angularTypes.isHttpClient(w)?{node:E,kind:"effect"}:void 0})(o,u):void 0);if(h){a=h;return}y=l,M.isArrowFunction(y)||M.isFunctionExpression(y)||M.isFunctionDeclaration(y)||M.isMethodDeclaration(y)||M.isGetAccessorDeclaration(y)||M.isSetAccessorDeclaration(y)||M.forEachChild(l,s);})(r),a);return i?(function(l,o,u){let m=l.node.getStart(),{line:y,column:h}=u.locator.location(m||b(o));return {filePath:u.filePath,ruleName:Te,message:l.kind==="write"?"computed() writes to state, which can create reactive cycles.":"computed() contains a side effect, so it is no longer a pure derivation.",line:y,column:h,severity:"error",fix:x[Te]}})(i,t,e):null},{requires:{typeChecker:true}});function ke(t){return M.isPropertyAccessExpression(t)||M.isElementAccessExpression(t)}var Oe="signal-effect-must-be-destroy-scoped",nt=createAnyAngularClassRule(Oe,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let n=[];for(let a of r)a&&H(a)&&!Me(a)&&n.push(...(function(s,c){let f=z(s);if(!f)return [];let d=Ze(s),p=[];for(let i of Je(f))(function(l){if(l.type!=="CallExpression")return false;let o=g(l.callee);return !!o&&(o.type==="Identifier"?o.name==="effect":!!C(o)&&N(o)==="effect")})(i)&&!(function(l){let o=g((Array.isArray(l.arguments)?l.arguments:[])[1]);if(!o||o.type!=="ObjectExpression")return false;for(let u of Array.isArray(o.properties)?o.properties:[]){let m=g(u);if(m?.type==="Property"){let y=g(m.key),h=y?.type==="Identifier"?y.name:N(y)||"";if(h==="injector")return true;if(h==="manualCleanup"){let E=g(m.value);if(E?.type==="Literal"&&E.value===true)return true}}}return false})(i)&&p.push((function(l,o,u){let m=b(l),{line:y,column:h}=u.locator.location(m);return {filePath:u.filePath,ruleName:Oe,message:`effect() inside "${o}" has no explicit lifecycle owner, so cleanup can be unclear.`,line:y,column:h,severity:"error",fix:x[Oe]}})(i,d,c));return p})(a,e));return n.length>0?n:null});var le="rxjs-no-nested-subscribe",cr=new Set(["next","error","complete"]),pr=new Set(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"]);function De(t){if(t.type!=="CallExpression")return false;let e=g(t.callee);return !!C(e)&&N(e)==="subscribe"}function it(t){return !!t&&(t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression")}var ot=createCallExpressionRule(le,(t,e)=>{if(!De(t))return null;for(let r of (function(n){if(!De(n))return [];let a=Array.isArray(n.arguments)?n.arguments:[];if(a.length===0)return [];let s=g(a[0]);if(s?.type==="ObjectExpression"){if(s.type!=="ObjectExpression")return [];let f=[];for(let d of Array.isArray(s.properties)?s.properties:[]){let p=g(d);if(p?.type==="Property"&&cr.has((function(i){let l=g(i.key);return l?l.type==="Identifier"?l.name:N(l)||"":""})(p))){let i=g(p.value);it(i)&&f.push(i);}}return f}let c=[];for(let f=0;f<Math.min(a.length,3);f++){let d=g(a[f]);it(d)&&c.push(d);}return c})(t)){let n=g(r.body);if(n&&(function(a){let s=[a];for(;s.length>0;){var c;let f=g(s.pop());if(f){if(f!==a&&De(f))return true;if(!(f!==a&&(c=f).type&&pr.has(c.type)))for(let d of k(f))s.push(d);}}return false})(n))return (function(a,s){let c=b(a),{line:f,column:d}=s.locator.location(c);return {filePath:s.filePath,ruleName:le,message:"Nested subscribe() calls make stream lifetimes harder to reason about and can leak work.",line:f,column:d,severity:"error",fix:x[le],codeExample:P[le]}})(t,e)}return null});var ue="prefer-on-push-component-change-detection";function ce(t,e){let r=t?.[e];return typeof r=="number"?r:void 0}function Ie(t){return t.replace(/\\/g,"/")}var at=createComponentRule(ue,(t,e)=>{let r=t.metadata??{};return r.type!=="Component"||!(function(n){if(!n||typeof n!="object")return false;let{kind:a,value:s}=n;return a!=="non-literal"&&(a==="literal"?s!==ChangeDetectionStrategy.OnPush:a==="missing")})(r.changeDetection)?null:(function(n,a){let s,c,f,d,p=(s=n.metadata??{},c=n.node,ce(s,"decoratorStart")??ce(s,"start")??ce(c,"start")??ce(n,"start")??0),{line:i,column:l}=a.locator.location(p),o=(f=n.metadata,typeof(d=f?.className)=="string"?d:"AnonymousComponent"),u=(function(m,y){if(!y.project)return null;let h=m.metadata,E=h?.className;if(typeof E!="string"||!E)return null;let S=Ie(y.filePath),{ngModuleMap:A,classToFile:v}=y.project;for(let[w,L]of A){if(L.isStandalone||!L.declarations.has(E))continue;let O=v.get(E);if(!O||Ie(O)===S)return {moduleName:(Ie(w).split("/").pop()??w).replace(/\.ts$/,""),siblingDeclarationCount:Math.max(0,L.declarations.size-1)}}return null})(n,a);return {filePath:a.filePath,ruleName:ue,message:(function(m,y){let h=`Component '${m}' uses default change detection, which can re-render more often than needed.`;if(!y)return h;let{moduleName:E,siblingDeclarationCount:S}=y;return S===0?`${h} It is declared in '${E}'.`:`${h} It is declared in '${E}' alongside ${S} other declaration${S===1?"":"s"}.`})(o,u),line:i,column:l,severity:"error",fix:x[ue],codeExample:P[ue]}})(t,e)},{requires:{projectContext:true}});var Le="template-no-call-expression",yr=new Set(["translate","$localize","$any"]),hr=new Set(["slice","toString","toFixed","toUpperCase","toLowerCase","trim","join","includes","indexOf","startsWith","endsWith","charAt","substring","replace","split","concat","toISOString","toLocaleDateString","toLocaleTimeString","toLocaleString"]);function st(t){let e=g(t);return !!e&&(e.type==="CallExpression"||e.type==="OptionalCallExpression")}var lt=createTemplateExpressionRule(Le,(t,e)=>(function(r,n){let a=r?[r]:[];for(;a.length>0;){let s=g(a.pop());if(s){if(st(s)&&!(function(c){let f=g(c);if(!f||!st(f))return false;let d=g(f.callee);if(!d)return false;if(d.type==="Identifier")return yr.has(d.name);if(!C(d))return false;let p=N(d);return !!p&&hr.has(p)})(s)){if((function(f){let d=g(f);return Array.isArray(d?.arguments)?d.arguments:[]})(s).length>0)return true;let c=(function(f){let d=g(f);if(!d)return "";let p=g(d.callee);return p?p.type==="Identifier"?p.name??"":C(p)?N(p):"":""})(s);if(c&&!(function(f,d){if(d.crossRef?.signalMembers?.has(f))return true;let{typeChecker:p,angularTypes:i,crossRef:l}=d;if(!p||!i||!l?.componentPath)return false;let o=(function(u,m,y){let h=y.getProgram?.(),E=h?.getSourceFile(m);if(!E)return;let S=E.statements.find(M.isClassDeclaration);if(!S)return;let A=y.getTypeAtLocation(S),v=y.getPropertyOfType(A,u);if(!v)return;let w=v.valueDeclaration??v.declarations?.[0];if(w)return y.getTypeOfSymbolAtLocation(v,w)})(f,l.componentPath,p);return !!o&&i.isSignal(o)})(c,n))return true}for(let c of k(s))a.push(c);}}return false})(t.expression,e)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Le,message:"Template method calls run on every change detection cycle and can make rendering slower.",line:s,column:c,severity:"error",fix:x[Le]}})(t,e)]:null,{requires:{htmlAst:true,typeChecker:true,projectContext:true}});function ut(t,e,r,n){let a=I(t,e.sourceSpan.start),{line:s,column:c}=t.locator.location(a);return {filePath:t.filePath,ruleName:r,message:n,line:s,column:c,severity:"error",fix:x[r]}}var ct=createTemplateRule("template-trackby-required",(t,e)=>{let r=[];for(let n of t.attributes)n.name==="*ngFor"&&!(function(a){return !!a.match(/\btrackBy\s*:\s*([^;]+?)\s*(?:;|$)/)?.[1]?.trim()})(n.value??"")&&r.push(ut(e,n,"template-trackby-required-for-ngfor","*ngFor without trackBy can recreate DOM nodes unnecessarily when list items change."));for(let n of t.blocks)n.name!=="for"||n.parameters.some(a=>{let s=a.expression?.trim()??"";return !!s&&!!/^track\b/.test(s)&&s.replace(/^track\b/,"").trim().length>0})||r.push(ut(e,n,"template-track-required-for-atfor","@for without a track expression can recreate DOM nodes unnecessarily when list items change."));return r.length>0?r:null},{requires:{htmlAst:true}});var je="template-no-object-literal-binding",pt=createTemplateExpressionRule(je,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ObjectExpression")return true;for(let s of k(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:je,message:"Object literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[je]}})(t,e)]:null,{requires:{htmlAst:true}});var Fe="template-no-array-literal-binding",ft=createTemplateExpressionRule(Fe,(t,e)=>(function(r){let n=r?[r]:[];for(;n.length>0;){let a=g(n.pop());if(a){if(a.type==="ArrayExpression")return true;for(let s of k(a))n.push(s);}}return false})(t.expression)?[(function(r,n){let a=I(n,r.sourceSpan.start),{line:s,column:c}=n.locator.location(a);return {filePath:n.filePath,ruleName:Fe,message:"Array literals in template bindings create a new reference on every change detection cycle.",line:s,column:c,severity:"warn",fix:x[Fe]}})(t,e)]:null,{requires:{htmlAst:true}});var _e=new Map([["bypassSecurityTrustHtml","HTML"],["bypassSecurityTrustScript","Script"],["bypassSecurityTrustStyle","Style"],["bypassSecurityTrustUrl","URL"],["bypassSecurityTrustResourceUrl","Resource URL"]]),mt=createCallExpressionRule("no-bypass-sanitization",(t,e)=>{let r=(function(s){let c=g(s.callee);if(!c)return null;if(c.type==="Identifier"&&c.name)return _e.has(c.name)?c.name:null;if(C(c)){let f=N(c);return f&&_e.has(f)?f:null}return null})(t);if(!r)return null;let{line:n,column:a}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"no-bypass-sanitization",message:`\`${r}\` bypasses Angular's ${_e.get(r)} sanitization, which can expose unsafe content.`,line:n,column:a,severity:"error",fix:x["no-bypass-sanitization"]}});var Cr=new Map([["[innerHTML]",{desc:"innerHTML directly renders HTML markup and can execute injected scripts",severity:"error"}],["[outerHTML]",{desc:"outerHTML replaces the element with raw HTML and is susceptible to XSS",severity:"error"}],["[srcdoc]",{desc:"srcdoc embeds raw HTML inside an iframe and can execute injected scripts",severity:"error"}],["[style]",{desc:"binding complex expressions to [style] can enable CSS injection",severity:"warn"}]]),vr=/\|\s*(safeHtml|safeStyle|safeUrl|safeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|trustStyle|trustUrl|trustResourceUrl|bypassSecurity)\b/i,Nr=/\b(getSafeHtml|getSafeUrl|getSafeStyle|getSafeResourceUrl|sanitize|sanitizeHtml|sanitizeUrl|trustHtml|bypassSecurity)\s*\(/i,dt=createTemplateAttributeRule("template-no-unsafe-bindings",(t,e)=>{let r=Cr.get(t.name);if(!r)return null;let n=t.value??"";if(vr.test(n)||Nr.test(n)||t.name==="[style]"&&!/[.(|?]/.test(n))return null;let{line:a,column:s}=e.locator.location(I(e,t.sourceSpan.start));return {filePath:e.filePath,ruleName:"template-no-unsafe-bindings",message:`\`${t.name}\` binds raw content: ${r.desc}. Unsanitized values can create injection risk.`,line:a,column:s,severity:r.severity,fix:x["template-no-unsafe-bindings"]}},{requires:{htmlAst:true}});var pe="no-document-access",wr=new Set(["document","window","localStorage","sessionStorage","navigator","location"]),gt=createAnyAngularClassRule(pe,(t,e)=>{let r=F(t.node);if(r.length===0)return null;let{typeChecker:n}=e;if(!n)return null;let a=D(e);if(!a)return null;let s=(function(p){let i=new Set,l=[...p];for(;l.length;){let o=g(l.pop());if(o){if(o.type==="VariableDeclarator"&&o.init){let u=g(o.init);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=o.id??o.key;m?.type==="Identifier"&&m.name&&i.add(m.name);}}if(o.type==="AssignmentExpression"&&o.right){let u=g(o.right);if(u?.type==="CallExpression"&&u.callee&&T(u.callee,"isPlatformBrowser")){let m=g(o.left);if(m&&C(m)&&g(m.object)?.type==="ThisExpression"){let y=m.property?.name;typeof y=="string"&&y&&i.add(y);}}}for(let u of k(o))l.push(u);}}return i})(r),c=[],f=new Set,d=[...r];for(;d.length;){let p=g(d.pop());if(p){if(p.type==="IfStatement"&&p.test){let i=g(p.test);if(i){let l=(function(o,u){let m=[o];for(;m.length;){let y=g(m.pop());if(y){if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformBrowser"))return "browser";if(y.type==="CallExpression"&&y.callee&&T(y.callee,"isPlatformServer"))return "server";if(y.type==="UnaryExpression"&&y.operator==="!"&&y.argument){let h=g(y.argument);if(h?.type==="CallExpression"&&h.callee&&T(h.callee,"isPlatformServer"))return "browser"}if(y.type==="Identifier"&&u.has(y.name))return "browser";for(let h of k(y))m.push(h);}}return null})(i,s);if(l==="browser"){p.alternate&&d.push(p.alternate);continue}if(l==="server"){p.consequent&&d.push(p.consequent);continue}}}if(p.type==="CallExpression"&&p.callee){let i=g(p.callee);if(i&&(T(i,"afterNextRender")||T(i,"afterRender"))){let l=p.arguments??[];for(let o=1;o<l.length;o++)d.push(l[o]);continue}}if(C(p)){let i=(function(o){let u=o;for(;u&&C(u);)u=g(u.object);return u?.type==="Identifier"?u:null})(p),l=i?.name;if(i&&l&&wr.has(l)&&(function(o,u,m){let y=(function(E,S){let A,v=w=>{if(!A){if(M.isIdentifier(w)&&w.getStart()===S){A=w;return}M.forEachChild(w,v);}};return v(E),A})(u,b(o));if(!y)return false;let h=m.getSymbolAtLocation(y);return Q((h&&h.flags&M.SymbolFlags.Alias?m.getAliasedSymbol(h):h)??void 0)})(i,a,n)){let o=b(i);if(o!==void 0&&!f.has(o)){f.add(o);let{line:u,column:m}=e.locator.location(o);c.push({filePath:e.filePath,ruleName:pe,message:`Direct access to \`${l}\` can run during SSR where browser globals do not exist.`,line:u,column:m,severity:"error",fix:x[pe],codeExample:P[pe]});}}}for(let i of k(p))d.push(i);}}return c.length?c:null},{requires:{typeChecker:true}});var fe="prefer-after-render-over-after-view-init",Pr=new Set(["ngAfterViewInit","ngAfterContentInit"]),ht=createAnyAngularClassRule(fe,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r}=e;if(!r)return null;let n=(function(s,c){let f=D(c);if(!f)return;let d=b(s);for(let p of f.statements)if(M.isClassDeclaration(p)&&p.pos<=d&&d<=p.end)return p})(t.node,e);if(!n)return null;let a=[];for(let s of n.members){if(!M.isMethodDeclaration(s)||!s.body||!M.isIdentifier(s.name))continue;let c=s.name.text;if(!Pr.has(c)||!(function(p,i){let l=false,o=u=>{if(!l){if(M.isPropertyAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M.isElementAccessExpression(u)){if(yt(i.getTypeAtLocation(u.expression))){l=true;return}}else if(M.isIdentifier(u)&&!(function(m){let y=m.parent;return !!y&&!!(M.isPropertyAccessExpression(y)&&y.name===m||M.isQualifiedName(y)&&y.right===m)})(u)){let m=i.getSymbolAtLocation(u);if(Q((m&&m.flags&M.SymbolFlags.Alias?i.getAliasedSymbol(m):m)??void 0)){l=true;return}}M.forEachChild(u,o);}};return o(p),l})(s.body,r))continue;let{line:f,column:d}=e.locator.location(s.getStart());a.push({filePath:e.filePath,ruleName:fe,message:`\`${c}\` contains DOM access that can run before browser-only APIs are safe.`,line:f,column:d,severity:"warn",fix:x[fe],codeExample:P[fe]});}return a.length?a:null},{requires:{typeChecker:true}});function yt(t){let e=t.aliasSymbol??t.symbol;return !!e&&Q(e)}var me=new Map;function Be(t){let e=D(t);if(!e)return false;for(let r of e.statements)if(M.isClassDeclaration(r))for(let n of r.members){if(!M.isMethodDeclaration(n)||!n.name||!M.isIdentifier(n.name)||n.name.text!=="ngOnDestroy"||!n.body)continue;let a=false,s=c=>{if(!a){if(M.isCallExpression(c)&&M.isPropertyAccessExpression(c.expression)&&c.expression.name.text==="unsubscribe"&&c.arguments.length===0){a=true;return}M.forEachChild(c,s);}};if(s(n.body),a)return true}return false}var xt=createCallExpressionRule("rxjs-require-takeUntilDestroyed",(t,e)=>{if(!oe(e)||!te(t))return null;let r=g(t.callee),n=C(r)?r?.object:null;if(n&&re(n)||ie(ne(n))||(function(f){let d=me.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return me.size>=500&&me.clear(),me.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:"rxjs-require-takeUntilDestroyed",message:"A component subscription without teardown can keep running after the component is destroyed.",line:s,column:c,severity:"error",fix:x["rxjs-require-takeUntilDestroyed"]}},{requires:{typeChecker:true}});var de=new Map,ge="rxjs-no-subscribe-in-component",Et=createCallExpressionRule(ge,(t,e)=>{if(!oe(e)||!te(t)||(function(f){let d=g(f.callee);if(!d||!C(d))return false;let p=g(d.object);if(!p)return false;if(p.type==="CallExpression"){let i=g(p.callee);if(C(i)&&N(i)==="pipe"&&(Array.isArray(p.arguments)?p.arguments:[]).some(l=>{let o=g(l);if(o?.type!=="CallExpression")return false;let u=g(o.callee)?.name;return u==="take"||u==="first"}))return true}return ie(ne(p))})(t))return null;let r=g(t.callee),n=g(r?.object);if(n&&re(n)||(function(f){let d=de.get(f.filePath);if(d!==void 0)return d;let p=Be(f);return de.size>=500&&de.clear(),de.set(f.filePath,p),p})(e))return null;let a=b(t),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:ge,message:(function(f,d){let p="Open-ended subscriptions in components can outlive the component and make state harder to track.",i=d.crossRef?.templateReferences;if(!i)return p;let l=g(f.callee),o=g(l?.object),u=o?N(o):null;if(!u)return p;let m=u.endsWith("$")?u.slice(0,-1):u;return i.has(u)||i.has(m)?`'${u}' is read by the template, so subscribing manually adds state and teardown work the template can own.`:p})(t,e),line:s,column:c,severity:"error",fix:x[ge],codeExample:P[ge]}},{requires:{typeChecker:true,projectContext:true}});var ye="rxjs-avoid-subject-as-event-bus",bt=createAnyAngularClassRule(ye,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=F(t.node);if(a.length===0)return null;let s=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=g(u.callee);if(m&&(m.type==="Identifier"?m.name:C(m)?N(m):"")==="takeUntil")for(let y of Array.isArray(u.arguments)?u.arguments:[]){let h=St(y);h&&l.add(h);}});return l})(a),c=(function(i){let l=new Set,o=m=>{he(m??null,y=>{let h=Ue(y,"next");h&&l.add(h);});},u=Qe(i);for(let m of(u&&o(z(u)),i))if(H(m)){let y=m.key?.name;m.kind==="set"&&(function(h){let E=h.decorators;if(!Array.isArray(E))return false;for(let S of E){let A=g(S.expression);if(A?.name==="Input"||g(A?.callee)?.name==="Input")return true}return false})(m)&&o(m),y==="ngOnChanges"&&o(z(m));}else m.type==="PropertyDefinition"&&m.value&&o(m.value);return l})(a),f=(function(i){let l=new Set;for(let o of i)H(o)&&o.key?.name==="ngOnDestroy"&&he(z(o),u=>{let m=Ue(u,"complete");m&&l.add(m);});return l})(a),d=(function(i){let l=new Set;for(let o of i)he((H(o)?z(o):o.type==="PropertyDefinition"?o.value:void 0)??null,u=>{let m=Ue(u,"pipe");m&&l.add(m);});return l})(a),p=[];for(let i of a){if(i.type!=="PropertyDefinition"||i.accessibility==="public")continue;let l=i.key?.name??"";if(!l||s.has(l)||c.has(l)||f.has(l)||d.has(l))continue;let o=et(i.key,e);if(!o)continue;let u=o.valueDeclaration??o.declarations?.[0];if(!u)continue;let m=r.getTypeOfSymbolAtLocation(o,u);if(!n.isSubjectLike(m))continue;let{line:y,column:h}=e.locator.location(b(i));p.push({filePath:e.filePath,ruleName:ye,message:`'${l}' is a Subject the class signals into without piping or external exposure \u2014 components are easier to follow when local state lives in fields or signals.`,line:y,column:h,severity:"warn",fix:x[ye],codeExample:P[ye]});}return p.length>0?p:null});function he(t,e){if(!t)return;let r=[t];for(;r.length;){let n=g(r.pop());if(n)for(let a of(n.type==="CallExpression"&&e(n),k(n)))r.push(a);}}function St(t){let e=g(t);if(!e||!C(e))return null;let r=g(e.object),n=N(e);return n&&r?.type==="ThisExpression"?n:null}function Ue(t,e){let r=g(t.callee);return r&&C(r)&&N(r)===e?St(r.object):null}var qe="rxjs-prefer-toSignal-for-template-state",At=createAnyAngularClassRule(qe,(t,e)=>{if(t.metadata?.type!=="Component")return null;let n=e.crossRef?.templateReferences;if(n===void 0)return null;let{typeChecker:a,angularTypes:s}=e;if(!a||!s)return null;let c=(function(p,i){let l=D(i);if(!l)return;let o=b(p);for(let u of l.statements)if(M.isClassDeclaration(u)&&u.pos<=o&&o<=u.end)return u})(t.node,e);if(!c)return null;let f=[];for(let p of c.members){var d;if(!M.isPropertyDeclaration(p))continue;let i=(function(m){if(M.isIdentifier(m.name)||M.isStringLiteral(m.name))return m.name.text})(p);if(!i||!n.has(i)&&!n.has((d=i).endsWith("$")?d.slice(0,-1):d)||(function(m,y,h){let E=M.getDecorators(m);if(!E)return false;for(let S of E){let A=M.isCallExpression(S.expression)?S.expression.expression:S.expression;if(!M.isIdentifier(A)||A.text!=="Output")continue;let v=y.getSymbolAtLocation(A),w=v&&v.flags&M.SymbolFlags.Alias?y.getAliasedSymbol(v):v;if(h.isFromAngularCore(w))return true}return false})(p,a,s))continue;let l=a.getTypeAtLocation(p);if(!s.isObservable(l)&&!s.isSubjectLike(l))continue;let{line:o,column:u}=e.locator.location(p.getStart());f.push({filePath:e.filePath,ruleName:qe,message:`Observable "${i}" is read by the template, which can add async-pipe churn and weaker signal integration.`,line:o,column:u,severity:"warn",fix:x[qe]});}return f.length?f:null},{requires:{projectContext:true,htmlAst:true,typeChecker:true}});var He="toSignal-require-initialValue",Ct=createCallExpressionRule(He,(t,e)=>{if(!T(t.callee,"toSignal"))return null;let r=Array.isArray(t.arguments)?t.arguments:[],n=r[1]?g(r[1]):null;if(!n||n.type!=="ObjectExpression"||!(function(a){let s=Y(a,"initialValue");if(s&&!we(s.value))return true;let c=Y(a,"requireSync");return !!c&&Re(c.value)})(n)){let{line:a,column:s}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:He,message:"toSignal() can emit undefined before the observable produces a value.",line:a,column:s,severity:"warn",fix:x[He]}}return null});var ze="signal-prefer-computed-over-sync-effect",jr=new Set(["setTimeout","setInterval","queueMicrotask","requestAnimationFrame"]),Fr=new Set(["then","catch","finally"]),_r=new Set(["set","update","mutate"]),Nt=createCallExpressionRule(ze,(t,e)=>{var r,n;let a,s,c,f,d,p;if(!T(t.callee,"effect"))return null;let{typeChecker:i,angularTypes:l}=e;if(!i||!l)return null;let o=(function(S,A){let v,w=D(S);if(!w)return;let L=O=>{if(!v){if(M.isCallExpression(O)&&O.getStart()===A){v=O;return}M.forEachChild(O,L);}};return L(w),v})(e,b(t));if(!o)return null;let u=o.arguments[0];if(!u||!(M.isArrowFunction(u)||M.isFunctionExpression(u)))return null;let m=(r=u.body,n={typeChecker:i,angularTypes:l},s=false,c=false,f=false,d=false,(p=S=>{f&&d&&s&&c||((S.kind===M.SyntaxKind.AwaitExpression||S.kind===M.SyntaxKind.YieldExpression)&&(f=true),M.isCallExpression(S)&&(function(A,v,w){var L,O;if(M.isPropertyAccessExpression(A.expression)){let U,j=A.expression.name.text,K=A.expression.expression,q=v.typeChecker.getTypeAtLocation(K);return _r.has(j)&&v.angularTypes.isWritableSignal(q)?w.onSignalWrite():(j==="subscribe"&&(v.angularTypes.isObservable(q)||v.angularTypes.isSubjectLike(q))||Fr.has(j)&&(U=(L=q).aliasSymbol??L.symbol)&&U.name==="Promise"&&vt(U))&&w.onAsync()}if(M.isIdentifier(A.expression)){let U,j=A.expression.text;if(j==="linkedSignal")return w.onLinkedSignal();if(jr.has(j)&&(O=A.expression,(U=v.typeChecker.getSymbolAtLocation(O))&&vt(U)))return w.onAsync();A.arguments.length===0&&(function(K,q){let Z=q.typeChecker.getSymbolAtLocation(K);if(!Z)return false;let Ve=Z.valueDeclaration??Z.declarations?.[0];if(!Ve)return false;let Ht=q.typeChecker.getTypeOfSymbolAtLocation(Z,Ve);return q.angularTypes.isSignal(Ht)})(A.expression,v)&&w.onSignalRead();}})(S,n,{onSignalRead:()=>{s=true;},onSignalWrite:()=>{c=true,a??=S;},onAsync:()=>{f=true;},onLinkedSignal:()=>{d=true;}}),M.forEachChild(S,p));})(r),{hasSignalRead:s,hasSignalWrite:c,hasAsync:f,hasLinkedSignal:d,firstWrite:a});if(!m.hasSignalRead||!m.hasSignalWrite||m.hasAsync||m.hasLinkedSignal)return null;let y=m.firstWrite??o,{line:h,column:E}=e.locator.location(y.getStart());return {filePath:e.filePath,ruleName:ze,message:"This effect reads reactive values and writes derived state, which adds extra reactive cycles.",line:h,column:E,severity:"warn",fix:x[ze]}},{requires:{typeChecker:true}});function vt(t){let e=t.getDeclarations();if(!e)return false;for(let r of e)if(r.getSourceFile().fileName.replace(/\\/g,"/").includes("/typescript/lib/lib."))return true;return false}var Rt=new Set(["afterRender","afterNextRender"]),Br=/\bafterNextRender\s*\(|\bafterRender\s*\(/,xe=new Map,wt=createCallExpressionRule("signal-avoid-untracked-overuse",(t,e)=>{if(!T(t.callee,"untracked")||(function(a,s){let c=s.sourceText??s.fileContent;if(typeof c=="string"&&!Br.test(c))return false;let f=a.parent;for(;f;){if(f.type==="CallExpression"&&Rt.has(Ne(f)))return true;f=f.parent;}let d=b(a);return (function(p){let i=xe.get(p.filePath);if(i!==void 0)return i;let l=p.program;return i=l?(function(o){let u=[],m=o.body,y=Array.isArray(m)?[...m]:[o];for(;y.length;){let h=g(y.pop());if(h){if(h.type==="CallExpression"&&Rt.has(Ne(h))){let E=g(h.arguments?.[0]);if(E){let S=b(E),A=E.end??E.span?.end??b(E);A>S&&u.push([S,A]);}}for(let E of k(h))y.push(E);}}return u})(l):[],xe.size>=300&&xe.clear(),xe.set(p.filePath,i),i})(s).some(([p,i])=>d>=p&&d<i)})(t,e))return null;let{line:r,column:n}=e.locator.location(b(t));return {filePath:e.filePath,ruleName:"signal-avoid-untracked-overuse",message:"untracked() hides this read from dependency tracking, which can mask stale reactive state.",line:r,column:n,severity:"warn",fix:x["signal-avoid-untracked-overuse"]}});var Ee="prefer-inject-over-constructor-di",qr=new Set(["Inject","Optional","Self","SkipSelf","Host"]),Mt=createAnyAngularClassRule(Ee,(t,e)=>{let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(l,o){var u;let m=(u=o).sourceFile?u.sourceFile:u.fileContent?(u.sourceFile=M.createSourceFile(u.filePath,u.fileContent,M.ScriptTarget.Latest,true),u.sourceFile):void 0;if(!m)return;let y=b(l);for(let h of m.statements)if(M.isClassDeclaration(h)&&h.pos<=y&&y<=h.end)return h})(t.node,e);if(!a)return null;let s=a.members.find(M.isConstructorDeclaration);if(!s||s.parameters.length===0)return null;let c=[];for(let l of s.parameters){var f;(function(o,u,m){if((function(E,S,A){let v=M.getDecorators(E);if(!v||v.length===0)return false;for(let w of v){let L=(function(j){let K=M.isCallExpression(j.expression)?j.expression.expression:j.expression;return M.isIdentifier(K)?K:void 0})(w);if(!L||!qr.has(L.text))continue;let O=S.getSymbolAtLocation(L),U=O&&O.flags&M.SymbolFlags.Alias?S.getAliasedSymbol(O):O;if(A.isFromAngularCore(U))return true}return false})(o,u,m))return true;if(!o.type)return false;let y=u.getTypeFromTypeNode(o.type);if(m.isInjectionToken(y))return true;let h=y.aliasSymbol??y.symbol;return !!h&&m.isInjectableClass(h)})(l,r,n)&&c.push((f=l,{name:M.isIdentifier(f.name)?f.name.text:"<binding>",typeText:f.type?f.type.getText():"<inferred>"}));}if(c.length===0)return null;let{line:d,column:p}=e.locator.location(b(s)),i=c.map(l=>`${l.name}: ${l.typeText}`).join(", ");return {filePath:e.filePath,ruleName:Ee,message:`Constructor dependency injection makes class setup less composable than inject(). Offending params: ${i}.`,line:d,column:p,severity:"warn",fix:x[Ee],codeExample:P[Ee]}},{requires:{typeChecker:true}});var be="signal-prefer-input-signal";function zr(t){let e=g(t.expression??t);if(!e)return false;if(e.type==="Identifier")return e.name==="Input";if(e.type==="CallExpression"){let r=g(e.callee);return r?.type==="Identifier"&&r.name==="Input"}return false}var Pt=createAnyAngularClassRule(be,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=[],a=e.project?.standaloneComponents?.has(e.filePath)??false;for(let s of r){let c=g(s);if(c&&(c.type==="PropertyDefinition"||c.type==="AccessorProperty")&&Array.isArray(c.decorators)&&c.decorators.some(zr)){let f=b(c),{line:d,column:p}=e.locator.location(f),i=g(c.key),l=(i?.type==="Identifier"?i.name:i?.type==="Literal"?String(i.value):"")||"(unknown)",o=`'${l}' uses @Input(), which keeps this input outside Angular's signal graph.`;a&&(o+=" Standalone declarations benefit most from signal inputs."),n.push({filePath:e.filePath,ruleName:be,message:o,line:d,column:p,severity:a?"error":"warn",fix:x[be],codeExample:P[be]});}}return n.length>0?n:null},{requires:{projectContext:true}});var Se="signal-prefer-output-function",Tt=createAnyAngularClassRule(Se,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let{typeChecker:r,angularTypes:n}=e;if(!r||!n)return null;let a=(function(c,f){let d=D(f);if(!d)return;let p=b(c);for(let i of d.statements)if(M.isClassDeclaration(i)&&i.pos<=p&&p<=i.end)return i})(t.node,e);if(!a)return null;let s=[];for(let c of a.members){if(!M.isPropertyDeclaration(c)||!(function(i,l,o){let u=M.getDecorators(i);if(!u)return false;for(let m of u){let y=M.isCallExpression(m.expression)?m.expression.expression:m.expression;if(!M.isIdentifier(y)||y.text!=="Output")continue;let h=l.getSymbolAtLocation(y),E=h&&h.flags&M.SymbolFlags.Alias?l.getAliasedSymbol(h):h;if(o.isFromAngularCore(E))return true}return false})(c,r,n)||!(function(i,l,o){if(i.type){let m=l.getTypeFromTypeNode(i.type);if(o.isEventEmitter(m))return true}if(i.initializer){let m=l.getTypeAtLocation(i.initializer);if(o.isEventEmitter(m))return true}let u=l.getSymbolAtLocation(i.name);if(u){let m=l.getTypeOfSymbolAtLocation(u,i);if(o.isEventEmitter(m))return true}return false})(c,r,n))continue;let f=(function(i){let l=i.name;if(M.isIdentifier(l)||M.isStringLiteral(l))return l.text})(c)??"(unknown)",{line:d,column:p}=e.locator.location(c.getStart());s.push({filePath:e.filePath,ruleName:Se,message:`'${f}' uses @Output() EventEmitter, which adds boilerplate compared with output().`,line:d,column:p,severity:"warn",fix:x[Se],codeExample:P[Se]});}return s.length>0?s:null},{requires:{typeChecker:true}});var Ae="signal-prefer-model";function kt(t,e){return Array.isArray(t.decorators)&&t.decorators.some(r=>{let n=g(r.expression??r);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(n.type==="CallExpression"){let a=g(n.callee);return a?.type==="Identifier"&&a.name===e}return false})}function Ot(t,e){let r=g(t.value);if(!r||r.type!=="CallExpression")return false;let n=g(r.callee);if(!n)return false;if(n.type==="Identifier")return n.name===e;if(C(n)){let a=g(n.object);return a?.type==="Identifier"&&a.name===e}return false}var Dt=createAnyAngularClassRule(Ae,(t,e)=>{if(t.decoratorName!=="Component"&&t.decoratorName!=="Directive")return null;let r=F(t.node),n=new Map,a=new Map;for(let c of r){let f=g(c);if(!f||f.type!=="PropertyDefinition"&&f.type!=="AccessorProperty")continue;let d=(function(p){let i=g(p.key);return i?i.type==="Identifier"?i.name??null:i.type==="Literal"?String(i.value):null:null})(f);d&&((kt(f,"Input")||Ot(f,"input"))&&n.set(d,f),(kt(f,"Output")||Ot(f,"output"))&&a.set(d,f));}let s=[];for(let[c,f]of a){if(!c.endsWith("Change"))continue;let d=c.slice(0,-6),p=n.get(d);if(p){let i=b(p),{line:l,column:o}=e.locator.location(i);s.push({filePath:e.filePath,ruleName:Ae,message:`The \`${d}\` / \`${c}\` pair implements two-way binding with extra wiring that model() avoids.`,line:l,column:o,severity:"warn",fix:x[Ae],codeExample:P[Ae]});}}return s.length>0?s:null});var Xr=new Map([["*ngIf","@if"],["*ngFor","@for"],["*ngSwitch","@switch"],["[ngSwitch]","@switch"],["*ngSwitchCase","@case"],["*ngSwitchDefault","@default"]]),We="template-prefer-control-flow",It=createTemplateAttributeRule(We,(t,e)=>{var r;let n=(r=t.name,Xr.get(r)??null);if(!n)return null;let a=I(e,t.sourceSpan.start),{line:s,column:c}=e.locator.location(a);return {filePath:e.filePath,ruleName:We,message:`\`${t.name}\` uses legacy structural directive syntax, so it misses the \`${n}\` control flow benefits.`,line:s,column:c,severity:"error",fix:x[We]}},{requires:{htmlAst:true}});var Lt=new WeakMap,jt=createTemplateExpressionRule("template-no-async-pipe-duplication",(t,e)=>{let r,n,a=(function p(i){let l=g(i);if(!l)return null;if(l.type==="BinaryExpression"&&l.operator==="|"){let o=g(l.right);return o?.type==="Identifier"&&o.name==="async"?g(l.left):p(l.left)}return null})(t.expression),s=a?(function p(i,l=0){if(!i||l>10)return null;if(i.type==="Identifier")return i.name;if(i.type==="ThisExpression")return "this";if(i.type==="Literal"){let o=i.value;return o===null?"null":typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="bigint"?String(o):null}if(i.type==="CallExpression"){let o=p(i.callee,l+1),u=(Array.isArray(i.arguments)?i.arguments:[]).map(m=>p(m,l+1)??"?");return `${o}(${u.join(",")})`}if(C(i)){let o=p(i.object,l+1),u=N(i);if(o&&u)return `${o}.${u}`}if(i.type==="UnaryExpression")return `${i.operator}${p(i.argument,l+1)}`;if(i.type==="ConditionalExpression")return `${p(i.test,l+1)}?${p(i.consequent,l+1)}:${p(i.alternate,l+1)}`;if(i.type==="OptionalExpression"||i.type==="ChainExpression")return p(i.expression,l+1);if(i.type==="LogicalExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="BinaryExpression"&&i.operator!=="|"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}if(i.type==="ArrayExpression")return `[${(i.elements??[]).map(u=>p(u,l+1)??"?").join(",")}]`;if(i.type==="ObjectExpression")return `{${(i.properties??[]).map(u=>{let m=u.key?p(u.key,l+1):"?",y=u.value?p(u.value,l+1):"?";return `${m}:${y}`}).join(",")}}`;if(i.type==="TemplateLiteral")return "`tmpl`";if(i.type==="AssignmentExpression"){let o=p(i.left,l+1),u=p(i.right,l+1);if(o&&u)return `${o}${i.operator}${u}`}return null})(a):null;if(!s)return null;let c=(r=e.template,n=r?.templateStartOffset,`${e.filePath}@${typeof n=="number"&&Number.isFinite(n)?n:0}`),f=Lt.get(e);f||(f=new Map,Lt.set(e,f));let d=f.get(c);if(d||(d=new Set,f.set(c,d)),d.has(s)){let p=I(e,t.sourceSpan.start),{line:i,column:l}=e.locator.location(p);return {filePath:e.filePath,ruleName:"template-no-async-pipe-duplication",message:`Duplicate async pipe subscriptions for "${s}" can create repeated work and inconsistent loading states.`,line:i,column:l,severity:"warn",fix:x["template-no-async-pipe-duplication"]}}return d.add(s),null},{requires:{htmlAst:true}});var Qr=new Set(["fdescribe","fit","describe.only","it.only","test.only","context.only","xdescribe","xit","xtest","xcontext"]),Zr=new Set(["xdescribe","xit","xtest","xcontext"]);function Ft(t){return t.type==="Identifier"?t.name??null:null}var _t=createCallExpressionRule("spec-no-focused-test",(t,e)=>{var r;let n;if(!((r=e.filePath).endsWith(".spec.ts")||r.endsWith(".test.ts")))return null;let a=g(t.callee);if(!a)return null;let s=(n=Ft(a)||(function(i){if(i.type==="MemberExpression"||i.type==="StaticMemberExpression"||i.type==="OptionalMemberExpression"){let l=g(i.object),o=i.property?.name??"",u=(l?.type==="Identifier"?l.name:"")??"";return u?`${u}.${o}`:null}return null})(a))&&Qr.has(n)?n:null;if(!s){if(Ft(a)==="pending"){let i=b(t),{line:l,column:o}=e.locator.location(i);return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:"`pending()` disables the test body, so the committed suite can miss coverage.",line:l,column:o,severity:"error",fix:x["spec-no-focused-test"]}}return null}let c=b(t),{line:f,column:d}=e.locator.location(c),p=Zr.has(s)?`\`${s}\` disables a test that may be forgotten.`:`\`${s}\` is a focused test helper that can skip the rest of the suite in CI.`;return {filePath:e.filePath,ruleName:"spec-no-focused-test",message:p,line:f,column:d,severity:"error",fix:x["spec-no-focused-test"]}},{dependencyType:"spec",requires:{tsAst:true}});function $t(){R(tt,"correctness"),R(rt,"correctness"),R(nt,"correctness"),R(ot,"correctness"),R(at,"performance"),R(lt,"performance"),R(ct,"performance"),R(pt,"performance"),R(ft,"performance"),R(mt,"security"),R(dt,"security"),R(gt,"ssr"),R(ht,"ssr"),R(Et,"reactivity"),R(xt,"reactivity"),R(bt,"reactivity"),R(At,"reactivity"),R(Ct,"reactivity"),R(Nt,"reactivity"),R(wt,"reactivity"),R(Mt,"modern-api"),R(Pt,"modern-api"),R(Tt,"modern-api"),R(Dt,"modern-api"),R(It,"template"),R(jt,"template"),R(_t,"testing");}var Bt=(t,e,r,n,a)=>{let s=0,c=0;for(let f of r)for(let d of f.failures)d.severity==="error"?s++:d.severity==="warn"&&c++;return {kind:"file-progress",filePath:t,taskCount:e,issueCount:s+c,errorCount:s,warningCount:c,duration:n,typeAware:a}};$t(),configureRuleExecutor(Xe,Ke),process.on("message",t=>{on(t);});var on=async t=>{let e=createTypeAwareAnalysisContext(t.rootDir,t.files,t.parserOptions,{buildProjectContext:t.buildProjectContext,programRootFiles:t.programRootFiles});try{await e.warmup(),process.send?.({kind:"ready"});let r=groupTasksByFile(t.tasks);await an(Array.from(r),Math.max(1,t.fileConcurrency??1),async([n,a])=>{process.send?.({kind:"file-start",filePath:n});let s=performance.now();try{let c=await executeBatchedTasks(a,e);Ut(n,a.length,c,performance.now()-s),qt(n,c);}catch{Ut(n,a.length,[],performance.now()-s),qt(n,[]);}finally{e.evict(n),requestGarbageCollectionUnderPressure(.8);}}),process.send?.({kind:"complete"});}catch(r){process.send?.({kind:"error",error:r instanceof Error?r.message:String(r)});}finally{e.dispose(),process.disconnect?.();}};async function an(t,e,r){let n=Array(t.length),a=0,s=Math.min(e,t.length);return await Promise.all(Array.from({length:s},async()=>{for(;a<t.length;){let c=a++;n[c]=await r(t[c]);}})),n}var Ut=(t,e,r,n)=>{process.send?.(Bt(t,e,r,n,true));},qt=(t,e)=>{process.send?.({kind:"file-result",filePath:t,results:e});};//# sourceMappingURL=type-aware-worker.js.map | ||
| //# sourceMappingURL=type-aware-worker.js.map |
+5
-5
| { | ||
| "name": "@ngcompass/rules", | ||
| "version": "0.1.9-beta", | ||
| "version": "0.2.0-beta", | ||
| "description": "Rules collection for ngcompass", | ||
@@ -32,6 +32,6 @@ "sideEffects": false, | ||
| "dependencies": { | ||
| "@ngcompass/common": "0.1.9-beta", | ||
| "@ngcompass/ast": "0.1.9-beta", | ||
| "@ngcompass/planner": "0.1.9-beta", | ||
| "@ngcompass/engine": "0.1.9-beta" | ||
| "@ngcompass/common": "0.2.0-beta", | ||
| "@ngcompass/engine": "0.2.0-beta", | ||
| "@ngcompass/ast": "0.2.0-beta", | ||
| "@ngcompass/planner": "0.2.0-beta" | ||
| }, | ||
@@ -38,0 +38,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1850592
0.06%3025
0.03%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated