@rx-angular/eslint-plugin
@rx-angular/eslint-plugin is a set of ESLint rules that keep an Angular codebase
zoneless-ready and enforce RxState discipline.
- Change-detection discipline: no hand-rolled
detectChanges/markForCheck; no layout-sensitive APIs that force style recalculation. - RxState discipline: no imperative RxState calls inside reactive methods; no subscriptions outside the constructor.
- Zoneless readiness: the six
no-zone-*rules flag Zone-patched browser, RxJS, andNgZone.run*APIs. They are legacy-guarded: a no-op once the app runs zoneless (Angular v21+). See Zoneless & how Zone.js affected change detection. - Value-semantics hygiene: flags Lodash
cloneDeep/isEqualin favour of native equivalents.
When to use it
Add it when you want the linter to guard a reactive, zoneless-ready codebase. The plugin flags the imperative change-detection calls, Zone-critical APIs, layout-thrashing calls, and RxState anti-patterns that get in the way of reactive, performant, Zone-less Angular, so they surface in the linter instead of in production.
Install
The rules are TypeScript-aware, so they need @typescript-eslint/parser.
npm install --save-dev @typescript-eslint/parser @rx-angular/eslint-plugin
Then extend the recommended or zoneless preset.
Install and configure the ESLint plugin
covers flat config and .eslintrc.
@rx-angular/eslint-plugin has no direct peer dependency on Angular — it lints
your project's TypeScript output through @typescript-eslint, so it works with
any Angular version supported by the @typescript-eslint/parser version you
have installed. See the package README
for the peer dependency table, and the
official Angular versioning guide for
Angular's own support windows.
Where to go next
- How-to: Install and configure the ESLint plugin:
install the parser and plugin, then extend the
recommendedorzonelesspreset (flat config or.eslintrc). - Reference: Rules overview: all 12 rules, what each flags, and which are legacy-guarded.
- Concept: Zoneless & how Zone.js affected change detection.