This repository is an Angular 17+ application in TypeScript, with standalone components, signals, RxJS and HttpClient, and optionally server-side rendering. Review .ts and .html template changes according to the rules below.
DomSanitizer.bypassSecurityTrustHtml,…Url,…ResourceUrl,…Scriptor…Styleon a value that is not a constant is CRITICAL: it turns off Angular's XSS protection for that value.- Writing HTML through the DOM (
nativeElement.innerHTML,insertAdjacentHTML,Renderer2.setProperty(el, 'innerHTML', …)) with data that is not a constant is CRITICAL. - An HTTP interceptor that adds credentials or a bearer token must check the request URL is our own API. Attaching it to every request is CRITICAL: the token goes to third-party hosts.
- A secret in
environment*.tsor any source file is CRITICAL: it ships to the browser. - A route guard is a user-experience feature, not access control. A change that relies on
canActivatealone to protect data the API returns without its own check is WARNING.
- A
subscribe()in a component, directive or long-lived service withouttakeUntilDestroyed, theasyncpipe,toSignal, or a stored subscription that is unsubscribed is WARNING (memory leak and duplicate work).HttpClientcalls that complete on their own are exempt. - Typeahead or route-param streams that start a request per value need
switchMap(or explicit cancellation);mergeMapor a nestedsubscribethere is WARNING: an older response can overwrite a newer one. - An
catchError-less stream that drives the UI or an effect stops for good after the first error (WARNING). - Nested
subscribecalls are SUGGESTION; compose with operators.
- Writing to a signal inside
computed()is WARNING. - Mutating an object or array that is an
@Input()or signal value in place, in anOnPushcomponent or a signal, is WARNING: the view does not update. Replace the value instead. - A new
@forwithtrack $indexover a list that can be reordered or edited is WARNING; track a stable id.
- Direct use of
window,document,localStorageornavigatorin code that also runs on the server, withoutisPlatformBrowserorafterNextRender, is WARNING.
- A URL or query string built from user input without
HttpParamsorencodeURIComponentis WARNING. - A missing runtime shape check on a response from the app's own API is SUGGESTION at most.
- An error swallowed in
subscribe({ error })orcatchError(() => EMPTY)with no user feedback or logging is WARNING.
Formatting and lint are enforced by Prettier and angular-eslint, and the compiler runs with strict templates; do not comment on them. Prefer the patterns already used in the surrounding feature (signals or observables) over generic preferences.