Registry / testing / eslint-plugin-rxjs-angular

eslint-plugin-rxjs-angular

JSON →
library2.0.1jsnpmunverified

ESLint plugin providing RxJS-specific lint rules for Angular applications. Version 2.0.1, actively maintained by cartant. It offers three opinionated rules: prefer-async-pipe (forbids subscribe in components), prefer-composition (forbids uncomposed subscribe), and prefer-takeuntil (requires takeUntil with subscribe). Unlike general RxJS linting tools, this plugin targets Angular-specific patterns. Requires ESLint ^8.0.0, TypeScript >=4.0.0, and @typescript-eslint/parser.

npm install eslint-plugin-rxjs-angular
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-RXJS
E
eslint-plugin-rxjs-angular
testingjavascriptv2.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rxjs-angular
import { rules } from 'eslint-plugin-rxjs-angular'
const rules = require('eslint-plugin-rxjs-angular')
Use import or require('eslint-plugin-rxjs-angular') for plugin object. The plugin is configured as a string in .eslintrc.
prefer-async-pipe
"rxjs-angular/prefer-async-pipe": "error"
"rxjs-angular/prefer-async-pipe": "warn"
Configure rule in ESLint config under rules key.
prefer-takeuntil
"rxjs-angular/prefer-takeuntil": "error"
define rule via import
Rule is accessed via string name in ESLint config.

Configures ESLint with @typescript-eslint/parser and enables all three rxjs-angular rules.

// .eslintrc.js const { join } = require("path"); module.exports = { parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: 2019, project: join(__dirname, "./tsconfig.json"), sourceType: "module" }, plugins: ["rxjs-angular"], extends: [], rules: { "rxjs-angular/prefer-async-pipe": "error", "rxjs-angular/prefer-composition": "error", "rxjs-angular/prefer-takeuntil": ["error", { checkComplete: true, checkDecorators: ["Component"] }] } };
Debug
Known issues
gotchaRules are opinionated and no recommended configuration provided; you must explicitly enable each rule.
fix
Add desired rules to 'rules' in ESLint config.
affects: >=0.0.0
gotchaAll rules require TypeScript parser and project option; without project, rules may not work correctly.
fix
Ensure '@typescript-eslint/parser' is configured with 'project' pointing to tsconfig.json.
affects: >=1.0.0
gotchaprefer-composition and prefer-takeuntil only apply to subscribe calls; they do not flag other async patterns.
fix
Use additional lint rules for other async operations if needed.
affects: >=0.0.0
gotchaprefer-composition's default options do not include services, directives, or pipes; only components are checked by default.
fix
Configure 'checkDecorators' option to include additional Angular decorators.
affects: >=1.0.0
Errors
Common errors & fixes
Definition for rule 'rxjs-angular/prefer-async-pipe' was not found
Plugin not installed or not listed in plugins
fix
Run 'npm install eslint-plugin-rxjs-angular --save-dev' and add 'plugins: ["rxjs-angular"]' to config.
Cannot read property 'getDeclaredVariables' of undefined
Missing 'project' in parserOptions
fix
Add 'project: join(__dirname, './tsconfig.json')' to parserOptions.
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/some-file.ts` using `parserOptions.project`: ... but that file does not exist in the project
tsconfig.json does not include the file being linted
fix
Ensure tsconfig.json includes all linted files or use a separate tsconfig.eslint.json.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin to work
typescriptrequiredpeer dependency required for TypeScript rules
@typescript-eslint/parserrequiredrequired for parsing TypeScript source
Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-rxjs-angular — npm install eslint-plugin-rxjs-angular · libregistry