{"id":19926,"library":"eslint-plugin-rxjs-angular","title":"eslint-plugin-rxjs-angular","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/cartant/eslint-plugin-rxjs-angular","tags":["javascript","lint","rules","eslint","rxjs","angular"],"install":[{"cmd":"npm install eslint-plugin-rxjs-angular","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-rxjs-angular","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-rxjs-angular","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to work","package":"eslint","optional":false},{"reason":"peer dependency required for TypeScript rules","package":"typescript","optional":false},{"reason":"required for parsing TypeScript source","package":"@typescript-eslint/parser","optional":false}],"imports":[{"note":"Use import or require('eslint-plugin-rxjs-angular') for plugin object. The plugin is configured as a string in .eslintrc.","wrong":"const rules = require('eslint-plugin-rxjs-angular')","symbol":"rxjs-angular","correct":"import { rules } from 'eslint-plugin-rxjs-angular'"},{"note":"Configure rule in ESLint config under rules key.","wrong":"\"rxjs-angular/prefer-async-pipe\": \"warn\"","symbol":"prefer-async-pipe","correct":"\"rxjs-angular/prefer-async-pipe\": \"error\""},{"note":"Rule is accessed via string name in ESLint config.","wrong":"define rule via import","symbol":"prefer-takeuntil","correct":"\"rxjs-angular/prefer-takeuntil\": \"error\""}],"quickstart":{"code":"// .eslintrc.js\nconst { join } = require(\"path\");\nmodule.exports = {\n  parser: \"@typescript-eslint/parser\",\n  parserOptions: {\n    ecmaVersion: 2019,\n    project: join(__dirname, \"./tsconfig.json\"),\n    sourceType: \"module\"\n  },\n  plugins: [\"rxjs-angular\"],\n  extends: [],\n  rules: {\n    \"rxjs-angular/prefer-async-pipe\": \"error\",\n    \"rxjs-angular/prefer-composition\": \"error\",\n    \"rxjs-angular/prefer-takeuntil\": [\"error\", { checkComplete: true, checkDecorators: [\"Component\"] }]\n  }\n};","lang":"javascript","description":"Configures ESLint with @typescript-eslint/parser and enables all three rxjs-angular rules."},"warnings":[{"fix":"Add desired rules to 'rules' in ESLint config.","message":"Rules are opinionated and no recommended configuration provided; you must explicitly enable each rule.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure '@typescript-eslint/parser' is configured with 'project' pointing to tsconfig.json.","message":"All rules require TypeScript parser and project option; without project, rules may not work correctly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use additional lint rules for other async operations if needed.","message":"prefer-composition and prefer-takeuntil only apply to subscribe calls; they do not flag other async patterns.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Configure 'checkDecorators' option to include additional Angular decorators.","message":"prefer-composition's default options do not include services, directives, or pipes; only components are checked by default.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-rxjs-angular --save-dev' and add 'plugins: [\"rxjs-angular\"]' to config.","cause":"Plugin not installed or not listed in plugins","error":"Definition for rule 'rxjs-angular/prefer-async-pipe' was not found"},{"fix":"Add 'project: join(__dirname, './tsconfig.json')' to parserOptions.","cause":"Missing 'project' in parserOptions","error":"Cannot read property 'getDeclaredVariables' of undefined"},{"fix":"Ensure tsconfig.json includes all linted files or use a separate tsconfig.eslint.json.","cause":"tsconfig.json does not include the file being linted","error":"Parsing error: ESLint was configured to run on `<tsconfigRootDir>/some-file.ts` using `parserOptions.project`: ... but that file does not exist in the project"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}