eslint-plugin-rxjs-x
raw JSON → 1.0.2 verified Sat Apr 25 auth: no javascript
Modern ESLint plugin for RxJS, forked from the unmaintained eslint-plugin-rxjs. v1.0.2 requires ESLint ^10.0.1, Node ^20.19.0 || ^22.13.0 || >=24, and RxJS ^7.2.0 with TypeScript >=4.8.4 <6.1.0. Ships TypeScript types. Offers flat-config-only recommended and strict configs, with 33+ rules. Breaking from v0.x: ESLint 10 required, Node 18 dropped, eslintrc unsupported, and namespace changed from 'rxjs' to 'rxjs-x'. Provides typed linting via dependency on typescript-eslint.
Common errors
error Error: Cannot find module 'eslint-plugin-rxjs-x' ↓
cause Package not installed or wrong import path.
fix
npm install eslint-plugin-rxjs-x --save-dev
error Configuration for rule "rxjs-x/no-subject-value" is invalid: Value "error" is not a valid severity. ↓
cause Using old eslintrc syntax with 'extends' containing 'plugin:rxjs-x/recommended'.
fix
Use flat config: import rxjsX from 'eslint-plugin-rxjs-x' and extend rxjsX.configs.recommended.
error TypeError: eslint-plugin-rxjs-x is not a function ↓
cause Using require() instead of import in flat config.
fix
Use 'import rxjsX from 'eslint-plugin-rxjs-x'' in ESM context.
error Parsing error: ESLint was configured to run on files that are not included in the project's TypeScript configuration. ↓
cause Missing 'projectService: true' or TypeScript config not found.
fix
Add 'projectService: true' to parserOptions and ensure tsconfig is present.
error Cannot read properties of undefined (reading 'configs') ↓
cause Importing default export incorrectly in CommonJS.
fix
Switch to ESM or use dynamic import: const rxjsX = await import('eslint-plugin-rxjs-x').then(m => m.default);
Warnings
breaking ESLint v10 required; Node.js v18 support dropped. ↓
fix Upgrade to ESLint ^10.0.1 and Node.js ^20.19.0 || ^22.13.0 || >=24.
breaking eslintrc config no longer supported; only flat config with import/export. ↓
fix Migrate to flat config using import statements and defineConfig.
breaking Namespace changed from 'rxjs' to 'rxjs-x'; all rule references must be updated. ↓
fix Replace 'rxjs/' with 'rxjs-x/' in all ESLint config rules and inline disable comments.
breaking Rule 'rxjs/no-ignored-observable' replaced by 'rxjs-x/no-floating-observable'. ↓
fix Use 'rxjs-x/no-floating-observable' instead of 'rxjs/no-ignored-observable'.
deprecated 'recommended-legacy' config removed in v1; use flat config only. ↓
fix Use rxjsX.configs.recommended in flat config.
gotcha Typed linting requires projectService: true in parserOptions. ↓
fix Add 'projectService: true' to parserOptions; otherwise type-dependent rules won't work.
gotcha Peer dep upper bounds: rxjs ^7.2.0, typescript <6.1.0. ↓
fix Ensure RxJS is ^7.2.0 and TypeScript >=4.8.4 <6.1.0.
Install
npm install eslint-plugin-rxjs-x yarn add eslint-plugin-rxjs-x pnpm add eslint-plugin-rxjs-x Imports
- default import wrong
const rxjsX = require('eslint-plugin-rxjs-x')correctimport rxjsX from 'eslint-plugin-rxjs-x' - configs wrong
rxjsX.configs['recommended']correctrxjsX.configs.recommended - rules prefix in inline comments wrong
// eslint-disable-next-line rxjs/no-subject-valuecorrect// eslint-disable-next-line rxjs-x/no-subject-value - flat config with typescript-eslint wrong
module.exports = { plugins: ['rxjs-x'], extends: ['plugin:rxjs-x/recommended'] }correctimport tseslint from 'typescript-eslint'; import rxjsX from 'eslint-plugin-rxjs-x'; export default tseslint.config({ extends: [...tseslint.configs.recommended, rxjsX.configs.recommended], languageOptions: { parserOptions: { projectService: true } } })
Quickstart
// @ts-check
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
import rxjsX from 'eslint-plugin-rxjs-x';
export default defineConfig({
extends: [
tseslint.configs.recommended,
rxjsX.configs.recommended,
],
languageOptions: {
parserOptions: {
projectService: true,
},
},
});